summaryrefslogtreecommitdiffstats
path: root/drivers/char/mem.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-23 00:40:54 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-23 00:40:54 +0000
commit529c593ece216e4aaffd36bd940cb94f1fa63129 (patch)
tree78f1c0b805f5656aa7b0417a043c5346f700a2cf /drivers/char/mem.c
parent0bd079751d25808d1972baee5c4eaa1db2227257 (diff)
Merge with 2.3.43. I did ignore all modifications to the qlogicisp.c
driver due to the Origin A64 hacks.
Diffstat (limited to 'drivers/char/mem.c')
-rw-r--r--drivers/char/mem.c115
1 files changed, 35 insertions, 80 deletions
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 <asm/pgtable.h>
*/
-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();