This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / arch / ppc64 / kernel / proc_ppc64.c
index ed172cd..c0ee1a2 100644 (file)
@@ -84,7 +84,7 @@ static int __init proc_ppc64_create(void)
 {
        struct proc_dir_entry *root;
 
-       root = proc_mkdir("ppc64", NULL);
+       root = proc_mkdir("ppc64", 0);
        if (!root)
                return 1;
 
@@ -94,7 +94,7 @@ static int __init proc_ppc64_create(void)
        if (!proc_mkdir("rtas", root))
                return 1;
 
-       if (!proc_symlink("rtas", NULL, "ppc64/rtas"))
+       if (!proc_symlink("rtas", 0, "ppc64/rtas"))
                return 1;
 
        return 0;
@@ -161,10 +161,21 @@ static loff_t page_map_seek( struct file *file, loff_t off, int whence)
        return (file->f_pos = new);
 }
 
-static ssize_t page_map_read( struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
+static ssize_t page_map_read( struct file *file, char *buf, size_t nbytes, loff_t *ppos)
 {
+       unsigned pos = *ppos;
        struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode);
-       return simple_read_from_buffer(buf, nbytes, ppos, dp->data, dp->size);
+
+       if ( pos >= dp->size )
+               return 0;
+       if ( nbytes >= dp->size )
+               nbytes = dp->size;
+       if ( pos + nbytes > dp->size )
+               nbytes = dp->size - pos;
+
+       copy_to_user( buf, (char *)dp->data + pos, nbytes );
+       *ppos = pos + nbytes;
+       return nbytes;
 }
 
 static int page_map_mmap( struct file *file, struct vm_area_struct *vma )