#include <linux/slab.h>
#include <linux/kernel.h>
-#include <asm/naca.h>
-#include <asm/paca.h>
#include <asm/systemcfg.h>
#include <asm/rtas.h>
#include <asm/uaccess.h>
#include <asm/prom.h>
static loff_t page_map_seek( struct file *file, loff_t off, int whence);
-static ssize_t page_map_read( struct file *file, char *buf, size_t nbytes, loff_t *ppos);
+static ssize_t page_map_read( struct file *file, char __user *buf, size_t nbytes,
+ loff_t *ppos);
static int page_map_mmap( struct file *file, struct vm_area_struct *vma );
static struct file_operations page_map_fops = {
};
#endif
-/*
- * NOTE: since paca data is always in flux the values will never be a
- * consistant set.
- */
-static void __init proc_create_paca(struct proc_dir_entry *dir, int num)
-{
- struct proc_dir_entry *ent;
- struct paca_struct *lpaca = paca + num;
- char buf[16];
-
- sprintf(buf, "%02x", num);
- ent = create_proc_entry(buf, S_IRUSR, dir);
- if (ent) {
- ent->nlink = 1;
- ent->data = lpaca;
- ent->size = 4096;
- ent->proc_fops = &page_map_fops;
- }
-}
-
/*
* Create the ppc64 and ppc64/rtas directories early. This allows us to
* assume that they have been previously created in drivers.
static int __init proc_ppc64_init(void)
{
- unsigned long i;
struct proc_dir_entry *pde;
- pde = create_proc_entry("ppc64/naca", S_IRUSR, NULL);
- if (!pde)
- return 1;
- pde->nlink = 1;
- pde->data = naca;
- pde->size = 4096;
- pde->proc_fops = &page_map_fops;
-
pde = create_proc_entry("ppc64/systemcfg", S_IFREG|S_IRUGO, NULL);
if (!pde)
return 1;
pde->size = 4096;
pde->proc_fops = &page_map_fops;
- /* /proc/ppc64/paca/XX -- raw paca contents. Only readable to root */
- pde = proc_mkdir("ppc64/paca", NULL);
- if (!pde)
- return 1;
- for_each_cpu(i)
- proc_create_paca(pde, i);
-
#ifdef CONFIG_PPC_PSERIES
if ((systemcfg->platform & PLATFORM_PSERIES))
proc_ppc64_create_ofdt();
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 __user *buf, size_t nbytes,
+ loff_t *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 ((vma->vm_end - vma->vm_start) > dp->size)
return -EINVAL;
- remap_page_range( vma, vma->vm_start, __pa(dp->data), dp->size, vma->vm_page_prot );
+ remap_pfn_range(vma, vma->vm_start, __pa(dp->data) >> PAGE_SHIFT,
+ dp->size, vma->vm_page_prot);
return 0;
}
* whole nodes along with their properties. Operations on individual
* properties are not implemented (yet).
*/
-static ssize_t ofdt_write(struct file *file, const char __user *buf, size_t count, loff_t *off)
+static ssize_t ofdt_write(struct file *file, const char __user *buf, size_t count,
+ loff_t *off)
{
int rv = 0;
char *kbuf;
return rv;
}
-static struct property *new_property(const char *name, const int length, const unsigned char *value, struct property *last)
+static struct property *new_property(const char *name, const int length,
+ const unsigned char *value, struct property *last)
{
struct property *new = kmalloc(sizeof(*new), GFP_KERNEL);
* this function does no allocation or copying of the data. Return value
* is set to the next name in buf, or NULL on error.
*/
-static char * parse_next_property(char *buf, char *end, char **name, int *length, unsigned char **value)
+static char * parse_next_property(char *buf, char *end, char **name, int *length,
+ unsigned char **value)
{
char *tmp;
tmp = strchr(buf, ' ');
if (!tmp) {
- printk(KERN_ERR "property parse failed in %s at line %d\n", __FUNCTION__, __LINE__);
+ printk(KERN_ERR "property parse failed in %s at line %d\n",
+ __FUNCTION__, __LINE__);
return NULL;
}
*tmp = '\0';
if (++tmp >= end) {
- printk(KERN_ERR "property parse failed in %s at line %d\n", __FUNCTION__, __LINE__);
+ printk(KERN_ERR "property parse failed in %s at line %d\n",
+ __FUNCTION__, __LINE__);
return NULL;
}
*length = -1;
*length = simple_strtoul(tmp, &tmp, 10);
if (*length == -1) {
- printk(KERN_ERR "property parse failed in %s at line %d\n", __FUNCTION__, __LINE__);
+ printk(KERN_ERR "property parse failed in %s at line %d\n",
+ __FUNCTION__, __LINE__);
return NULL;
}
if (*tmp != ' ' || ++tmp >= end) {
- printk(KERN_ERR "property parse failed in %s at line %d\n", __FUNCTION__, __LINE__);
+ printk(KERN_ERR "property parse failed in %s at line %d\n",
+ __FUNCTION__, __LINE__);
return NULL;
}
*value = tmp;
tmp += *length;
if (tmp > end) {
- printk(KERN_ERR "property parse failed in %s at line %d\n", __FUNCTION__, __LINE__);
+ printk(KERN_ERR "property parse failed in %s at line %d\n",
+ __FUNCTION__, __LINE__);
return NULL;
}
else if (tmp < end && *tmp != ' ' && *tmp != '\0') {
- printk(KERN_ERR "property parse failed in %s at line %d\n", __FUNCTION__, __LINE__);
+ printk(KERN_ERR "property parse failed in %s at line %d\n",
+ __FUNCTION__, __LINE__);
return NULL;
}
tmp++;