debuggers.hg
changeset 614:17bca2096d98
bitkeeper revision 1.319 (3f0c1fe9J6WyGCxorp5Dcd0G7QYjwQ)
Very slight tidy up.
Very slight tidy up.
author | sos22@labyrinth.cl.cam.ac.uk |
---|---|
date | Wed Jul 09 14:00:09 2003 +0000 (2003-07-09) |
parents | 956f93d4092c |
children | cc54519f9a1a bd90bd0c8b23 |
files | xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_core.c |
line diff
1.1 --- a/xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_core.c Wed Jul 09 12:40:18 2003 +0000 1.2 +++ b/xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_core.c Wed Jul 09 14:00:09 2003 +0000 1.3 @@ -149,40 +149,6 @@ static void create_proc_dom_entries(int 1.4 } 1.5 } 1.6 1.7 -static int dom0_cmd_write(struct file *file, const char *buffer, size_t size, 1.8 - loff_t *off) 1.9 -{ 1.10 - dom0_op_t op; 1.11 - int ret = 0; 1.12 - 1.13 - copy_from_user(&op, buffer, sizeof(dom0_op_t)); 1.14 - 1.15 - if ( op.cmd == MAP_DOM_MEM ) 1.16 - { 1.17 - /* This is now an ioctl, and shouldn't be being written to the 1.18 - command file. */ 1.19 - ret = -EOPNOTSUPP; 1.20 - } 1.21 - else if ( op.cmd == DO_PGUPDATES ) 1.22 - { 1.23 - /* Now an ioctl. */ 1.24 - ret = -EOPNOTSUPP; 1.25 - } 1.26 - else if (op.cmd == DOM0_CREATEDOMAIN) 1.27 - { 1.28 - /* This is now handled through an ioctl interface. Trying to 1.29 - do it this way means the /proc files for the new domain 1.30 - don't get created properly. */ 1.31 - ret = -EOPNOTSUPP; 1.32 - } 1.33 - else 1.34 - { 1.35 - ret = HYPERVISOR_dom0_op(&op); 1.36 - } 1.37 - 1.38 - return ret; 1.39 -} 1.40 - 1.41 /*********************************************************************** 1.42 * 1.43 * Implementation of /proc/xeno/domains 1.44 @@ -277,7 +243,20 @@ static struct file_operations proc_xeno_ 1.45 release: seq_release, 1.46 }; 1.47 1.48 -/* END OF /proc/xeno/domains */ 1.49 +/*********************************************************************** 1.50 + * 1.51 + * Implementation of /proc/xeno/dom0_cmd 1.52 + */ 1.53 + 1.54 +static int dom0_cmd_write(struct file *file, const char *buffer, size_t size, 1.55 + loff_t *off) 1.56 +{ 1.57 + dom0_op_t op; 1.58 + 1.59 + copy_from_user(&op, buffer, sizeof(dom0_op_t)); 1.60 + 1.61 + return HYPERVISOR_dom0_op(&op); 1.62 +} 1.63 1.64 static int handle_dom0_cmd_createdomain(unsigned long data) 1.65 { 1.66 @@ -307,7 +286,7 @@ static int handle_dom0_cmd_createdomain( 1.67 succeeded, because Xen doesn't appear to want to tell us... */ 1.68 1.69 /* The only time I've actually got this to happen was when trying 1.70 - to crate a domain with more memory than is actually in the 1.71 + to create a domain with more memory than is actually in the 1.72 machine, so we guess the error code is ENOMEM. */ 1.73 return -ENOMEM; 1.74 } 1.75 @@ -322,20 +301,15 @@ static int handle_dom0_cmd_createdomain( 1.76 static unsigned long handle_dom0_cmd_mapdommem(unsigned long data) 1.77 { 1.78 struct dom0_mapdommem_args argbuf; 1.79 - unsigned long addr; 1.80 1.81 if (copy_from_user(&argbuf, (void *)data, sizeof(argbuf))) 1.82 return -EFAULT; 1.83 - /* This seems to be assuming that the root of the page table is in 1.84 - the first frame of the new domain's physical memory? */ 1.85 1.86 - addr = direct_mmap(argbuf.start_pfn << PAGE_SHIFT, 1.87 + return direct_mmap(argbuf.start_pfn << PAGE_SHIFT, 1.88 argbuf.tot_pages << PAGE_SHIFT, 1.89 PAGE_SHARED, 1.90 MAP_DISCONT, 1.91 argbuf.tot_pages); 1.92 - 1.93 - return addr; 1.94 } 1.95 1.96 static int handle_dom0_cmd_unmapdommem(unsigned long data)