[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] cleanups
# HG changeset patch # User kaf24@xxxxxxxxxxxxxxxxxxxx # Node ID a5e9a7fcade9c8e4cd2b16954984ee4f6a24fac0 # Parent 16cd990994d54b28280f587ac876f14c15f1f4a8 cleanups diff -r 16cd990994d5 -r a5e9a7fcade9 tools/python/xen/lowlevel/xc/xc.c --- a/tools/python/xen/lowlevel/xc/xc.c Fri Sep 9 15:52:52 2005 +++ b/tools/python/xen/lowlevel/xc/xc.c Fri Sep 9 16:17:17 2005 @@ -756,7 +756,7 @@ "xen_major", xen_version >> 16, "xen_minor", (xen_version & 0xffff), "xen_extra", xen_extra, - "xen_caps", xen_caps.caps, + "xen_caps", xen_caps, "xen_params", str, "xen_changeset", xen_chgset, "cc_compiler", xen_cc.compiler, diff -r 16cd990994d5 -r a5e9a7fcade9 xen/arch/x86/dom0_ops.c --- a/xen/arch/x86/dom0_ops.c Fri Sep 9 15:52:52 2005 +++ b/xen/arch/x86/dom0_ops.c Fri Sep 9 16:17:17 2005 @@ -35,13 +35,13 @@ static void write_msr_for(void *unused) { - if (((1 << current->processor) & msr_cpu_mask)) + if ( ((1 << current->processor) & msr_cpu_mask) ) (void)wrmsr_user(msr_addr, msr_lo, msr_hi); } static void read_msr_for(void *unused) { - if (((1 << current->processor) & msr_cpu_mask)) + if ( ((1 << current->processor) & msr_cpu_mask) ) (void)rdmsr_user(msr_addr, msr_lo, msr_hi); } @@ -189,11 +189,11 @@ pi->total_pages = max_page; pi->free_pages = avail_domheap_pages(); pi->cpu_khz = cpu_khz; - memset( pi->hw_cap, 0, sizeof(pi->hw_cap) ); - memcpy( pi->hw_cap, boot_cpu_data.x86_capability, NCAPINTS*4 ); + memset(pi->hw_cap, 0, sizeof(pi->hw_cap)); + memcpy(pi->hw_cap, boot_cpu_data.x86_capability, NCAPINTS*4); ret = 0; - if( copy_to_user(u_dom0_op, op, sizeof(*op)) ) - ret = -EINVAL; + if ( copy_to_user(u_dom0_op, op, sizeof(*op)) ) + ret = -EFAULT; } break; diff -r 16cd990994d5 -r a5e9a7fcade9 xen/arch/x86/setup.c --- a/xen/arch/x86/setup.c Fri Sep 9 15:52:52 2005 +++ b/xen/arch/x86/setup.c Fri Sep 9 16:17:17 2005 @@ -93,8 +93,6 @@ #endif EXPORT_SYMBOL(mmu_cr4_features); -int hvm_enabled = 0; /* can we run unmodified guests */ - struct vcpu *idle_task[NR_CPUS] = { &idle0_vcpu }; int acpi_disabled; @@ -533,43 +531,44 @@ startup_cpu_idle_loop(); } -void arch_get_xen_caps(xen_capabilities_info_t *info) +void arch_get_xen_caps(xen_capabilities_info_t info) { - char *p=info->caps; - - *p=0; - -#ifdef CONFIG_X86_32 - -#ifndef CONFIG_X86_PAE - p+=sprintf(p,"xen_%d.%d_x86_32 ",XEN_VERSION,XEN_SUBVERSION); - if(hvm_enabled) - { - p+=sprintf(p,"hvm_%d.%d_x86_32 ",XEN_VERSION,XEN_SUBVERSION); - } + char *p = info; + +#if defined(CONFIG_X86_32) && !defined(CONFIG_X86_PAE) + + p += sprintf(p, "xen_%d.%d_x86_32 ", XEN_VERSION, XEN_SUBVERSION); + if ( hvm_enabled ) + p += sprintf(p, "hvm_%d.%d_x86_32 ", XEN_VERSION, XEN_SUBVERSION); + +#elif defined(CONFIG_X86_32) && defined(CONFIG_X86_PAE) + + p += sprintf(p, "xen_%d.%d_x86_32p ", XEN_VERSION, XEN_SUBVERSION); + if ( hvm_enabled ) + { + //p += sprintf(p, "hvm_%d.%d_x86_32 ", XEN_VERSION, XEN_SUBVERSION); + //p += sprintf(p, "hvm_%d.%d_x86_32p ", XEN_VERSION, XEN_SUBVERSION); + } + +#elif defined(CONFIG_X86_64) + + p += sprintf(p, "xen_%d.%d_x86_64 ", XEN_VERSION, XEN_SUBVERSION); + if ( hvm_enabled ) + { + //p += sprintf(p, "hvm_%d.%d_x86_32 ", XEN_VERSION, XEN_SUBVERSION); + //p += sprintf(p, "hvm_%d.%d_x86_32p ", XEN_VERSION, XEN_SUBVERSION); + p += sprintf(p, "hvm_%d.%d_x86_64 ", XEN_VERSION, XEN_SUBVERSION); + } + #else - p+=sprintf(p,"xen_%d.%d_x86_32p ",XEN_VERSION,XEN_SUBVERSION); - if(hvm_enabled) - { - //p+=sprintf(p,"hvm_%d.%d_x86_32 ",XEN_VERSION,XEN_SUBVERSION); - //p+=sprintf(p,"hvm_%d.%d_x86_32p ",XEN_VERSION,XEN_SUBVERSION); - } - -#endif - -#else /* !CONFIG_X86_32 */ - p+=sprintf(p,"xen_%d.%d_x86_64 ",XEN_VERSION,XEN_SUBVERSION); - if(hvm_enabled) - { - //p+=sprintf(p,"hvm_%d.%d_x86_32 ",XEN_VERSION,XEN_SUBVERSION); - //p+=sprintf(p,"hvm_%d.%d_x86_32p ",XEN_VERSION,XEN_SUBVERSION); - p+=sprintf(p,"hvm_%d.%d_x86_64 ",XEN_VERSION,XEN_SUBVERSION); - } + + p++; + #endif - BUG_ON((p-info->caps)>sizeof(*info)); - - if(p>info->caps) *(p-1) = 0; + *(p-1) = 0; + + BUG_ON((p - info) > sizeof(info)); } /* diff -r 16cd990994d5 -r a5e9a7fcade9 xen/arch/x86/vmx.c --- a/xen/arch/x86/vmx.c Fri Sep 9 15:52:52 2005 +++ b/xen/arch/x86/vmx.c Fri Sep 9 16:17:17 2005 @@ -44,13 +44,13 @@ #include <public/io/ioreq.h> +int hvm_enabled; + #ifdef CONFIG_VMX int vmcs_size; unsigned int opt_vmx_debug_level = 0; integer_param("vmx_debug", opt_vmx_debug_level); - -extern int hvm_enabled; #ifdef TRACE_BUFFER static unsigned long trace_values[NR_CPUS][4]; diff -r 16cd990994d5 -r a5e9a7fcade9 xen/common/kernel.c --- a/xen/common/kernel.c Fri Sep 9 15:52:52 2005 +++ b/xen/common/kernel.c Fri Sep 9 16:17:17 2005 @@ -114,12 +114,12 @@ case XENVER_capabilities: { xen_capabilities_info_t info; - extern void arch_get_xen_caps(xen_capabilities_info_t * info); - - memset(&info, 0, sizeof(info)); - arch_get_xen_caps(&info); + extern void arch_get_xen_caps(xen_capabilities_info_t info); - if ( copy_to_user(arg, &info, sizeof(info)) ) + memset(info, 0, sizeof(info)); + arch_get_xen_caps(info); + + if ( copy_to_user(arg, info, sizeof(info)) ) return -EFAULT; return 0; } @@ -127,7 +127,6 @@ case XENVER_parameters: { xen_parameters_info_t info = { .virt_start = HYPERVISOR_VIRT_START }; - if ( copy_to_user(arg, &info, sizeof(info)) ) return -EFAULT; return 0; diff -r 16cd990994d5 -r a5e9a7fcade9 xen/include/asm-x86/vmx.h --- a/xen/include/asm-x86/vmx.h Fri Sep 9 15:52:52 2005 +++ b/xen/include/asm-x86/vmx.h Fri Sep 9 16:17:17 2005 @@ -27,6 +27,8 @@ #include <asm/i387.h> #include <public/io/ioreq.h> + +extern int hvm_enabled; extern void vmx_asm_vmexit_handler(struct cpu_user_regs); extern void vmx_asm_do_resume(void); diff -r 16cd990994d5 -r a5e9a7fcade9 xen/include/public/version.h --- a/xen/include/public/version.h Fri Sep 9 15:52:52 2005 +++ b/xen/include/public/version.h Fri Sep 9 16:17:17 2005 @@ -29,16 +29,14 @@ } xen_compile_info_t; #define XENVER_capabilities 3 -typedef struct xen_capabilities_info { - char caps[1024]; -} xen_capabilities_info_t; +typedef char xen_capabilities_info_t[1024]; #define XENVER_changeset 4 typedef char xen_changeset_info_t[64]; #define XENVER_parameters 5 -typedef struct xen_paramaters_info { -unsigned long virt_start; +typedef struct xen_parameters_info { + unsigned long virt_start; } xen_parameters_info_t; #endif /* __XEN_PUBLIC_VERSION_H__ */ _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |