--- zzzz-none-000/linux-2.4.17/drivers/char/mem.c 2001-12-21 17:41:54.000000000 +0000 +++ sangam-fb-322/linux-2.4.17/drivers/char/mem.c 2004-11-24 13:23:20.000000000 +0000 @@ -26,6 +26,9 @@ #include #include +#ifdef CONFIG_SENSORS +extern void sensors_init_all(void); +#endif #ifdef CONFIG_I2C extern int i2c_init_all(void); #endif @@ -41,6 +44,9 @@ #if defined(CONFIG_S390_TAPE) && defined(CONFIG_S390_TAPE_CHAR) extern void tapechar_init(void); #endif +#ifdef CONFIG_VMEBUS +extern void vmebus_init(void); +#endif static ssize_t do_write_mem(struct file * file, void *p, unsigned long realp, const char * buf, size_t count, loff_t *ppos) @@ -101,7 +107,7 @@ } } #endif - if (copy_to_user(buf, __va(p), count)) + if (copy_to_user(buf, (char *)__va(p), count)) return -EFAULT; read += count; *ppos += read; @@ -119,7 +125,7 @@ return 0; if (count > end_mem - p) count = end_mem - p; - return do_write_mem(file, __va(p), p, buf, count, ppos); + return do_write_mem(file, (char *)__va(p), p, buf, count, ppos); } #ifndef pgprot_noncached @@ -198,10 +204,10 @@ vma->vm_flags |= VM_RESERVED; /* - * Don't dump addresses that are not real memory to a core file. + * Dump addresses that are real memory to a core file. */ - if (offset >= __pa(high_memory) || (file->f_flags & O_SYNC)) - vma->vm_flags |= VM_IO; + if (offset < __pa(high_memory) && !(file->f_flags & O_SYNC)) + vma->vm_flags &= ~VM_IO; if (remap_page_range(vma->vm_start, offset, vma->vm_end-vma->vm_start, vma->vm_page_prot)) @@ -400,7 +406,7 @@ if (count > size) count = size; - zap_page_range(mm, addr, count); + zap_page_range(mm, addr, count, ZPR_NORMAL); zeromap_page_range(addr, count, PAGE_COPY); size -= count; @@ -473,6 +479,7 @@ return shmem_zero_setup(vma); if (zeromap_page_range(vma->vm_start, vma->vm_end - vma->vm_start, vma->vm_page_prot)) return -EAGAIN; + vma->vm_flags &= ~VM_IO; return 0; } @@ -672,6 +679,13 @@ #if defined(CONFIG_S390_TAPE) && defined(CONFIG_S390_TAPE_CHAR) tapechar_init(); #endif +#ifdef CONFIG_VMEBUS + vmebus_init(); +#endif +#ifdef CONFIG_SENSORS + sensors_init_all(); +#endif + return 0; }