From 529c593ece216e4aaffd36bd940cb94f1fa63129 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Wed, 23 Feb 2000 00:40:54 +0000 Subject: Merge with 2.3.43. I did ignore all modifications to the qlogicisp.c driver due to the Origin A64 hacks. --- drivers/char/mem.c | 115 ++++++++++++++++------------------------------------- 1 file changed, 35 insertions(+), 80 deletions(-) (limited to 'drivers/char/mem.c') diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 21247facb..09c12be26 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c @@ -145,11 +145,15 @@ static ssize_t write_mem(struct file * file, const char * buf, return do_write_mem(file, __va(p), p, buf, count, ppos); } +#ifndef pgprot_noncached + /* * This should probably be per-architecture in */ -static inline unsigned long pgprot_noncached(unsigned long prot) +static inline pgprot_t pgprot_noncached(pgprot_t _prot) { + unsigned long prot = pgprot_val(_prot); + #if defined(__i386__) /* On PPro and successors, PCD alone doesn't always mean uncached because of interactions with the MTRRs. PCD | PWT @@ -173,9 +177,11 @@ static inline unsigned long pgprot_noncached(unsigned long prot) prot &= ~(L_PTE_CACHEABLE | L_PTE_BUFFERABLE); #endif - return prot; + return __pgprot(prot); } +#endif /* !pgprot_noncached */ + /* * Architectures vary in how they handle caching for addresses * outside of main memory. @@ -208,8 +214,7 @@ static int mmap_mem(struct file * file, struct vm_area_struct * vma) * done non-cached. */ if (noncached_address(offset) || (file->f_flags & O_SYNC)) - pgprot_val(vma->vm_page_prot) - = pgprot_noncached(pgprot_val(vma->vm_page_prot)); + vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); /* * Don't dump addresses that are not real memory to a core file. @@ -487,88 +492,48 @@ static int open_port(struct inode * inode, struct file * filp) #define open_kmem open_mem static struct file_operations mem_fops = { - memory_lseek, - read_mem, - write_mem, - NULL, /* mem_readdir */ - NULL, /* mem_poll */ - NULL, /* mem_ioctl */ - mmap_mem, - open_mem, - NULL, /* flush */ - NULL, /* no special release code */ - NULL /* fsync */ + llseek: memory_lseek, + read: read_mem, + write: write_mem, + mmap: mmap_mem, + open: open_mem, }; static struct file_operations kmem_fops = { - memory_lseek, - read_kmem, - write_kmem, - NULL, /* kmem_readdir */ - NULL, /* kmem_poll */ - NULL, /* kmem_ioctl */ - mmap_kmem, - open_kmem, - NULL, /* flush */ - NULL, /* no special release code */ - NULL /* fsync */ + llseek: memory_lseek, + read: read_kmem, + write: write_kmem, + mmap: mmap_kmem, + open: open_kmem, }; static struct file_operations null_fops = { - null_lseek, - read_null, - write_null, - NULL, /* null_readdir */ - NULL, /* null_poll */ - NULL, /* null_ioctl */ - NULL, /* null_mmap */ - NULL, /* no special open code */ - NULL, /* flush */ - NULL, /* no special release code */ - NULL /* fsync */ + llseek: null_lseek, + read: read_null, + write: write_null, }; #if (!defined(CONFIG_PPC) && !defined(__mc68000__) && !defined(__mips__)) || \ defined(CONFIG_HAVE_IO_PORTS) static struct file_operations port_fops = { - memory_lseek, - read_port, - write_port, - NULL, /* port_readdir */ - NULL, /* port_poll */ - NULL, /* port_ioctl */ - NULL, /* port_mmap */ - open_port, - NULL, /* flush */ - NULL, /* no special release code */ - NULL /* fsync */ + llseek: memory_lseek, + read: read_port, + write: write_port, + open: open_port, }; #endif static struct file_operations zero_fops = { - zero_lseek, - read_zero, - write_zero, - NULL, /* zero_readdir */ - NULL, /* zero_poll */ - NULL, /* zero_ioctl */ - mmap_zero, - NULL, /* no special open code */ - NULL, /* flush */ - NULL /* no special release code */ + llseek: zero_lseek, + read: read_zero, + write: write_zero, + mmap: mmap_zero, }; static struct file_operations full_fops = { - full_lseek, - read_full, - write_full, - NULL, /* full_readdir */ - NULL, /* full_poll */ - NULL, /* full_ioctl */ - NULL, /* full_mmap */ - NULL, /* no special open code */ - NULL, /* flush */ - NULL /* no special release code */ + llseek: full_lseek, + read: read_full, + write: write_full, }; static int memory_open(struct inode * inode, struct file * filp) @@ -610,17 +575,7 @@ static int memory_open(struct inode * inode, struct file * filp) } static struct file_operations memory_fops = { - NULL, /* lseek */ - NULL, /* read */ - NULL, /* write */ - NULL, /* readdir */ - NULL, /* poll */ - NULL, /* ioctl */ - NULL, /* mmap */ - memory_open, /* just a selector for the real open */ - NULL, /* flush */ - NULL, /* release */ - NULL /* fsync */ + open: memory_open, /* just a selector for the real open */ }; int __init chr_dev_init(void) @@ -633,7 +588,7 @@ int __init chr_dev_init(void) usb_init(); #endif #ifdef CONFIG_I2C - i2c_init_all(); + i2c_init_all(); #endif #if defined (CONFIG_FB) fbmem_init(); -- cgit v1.2.3