ia64/xen-unstable

changeset 18697:0978bdc056c8

Simplify set_px_info hypercall 32-on-64 compatibility shim.

Mark processor_px as 'checking' and translate handle to simplify
actual code doing in the translation.
(According to Jan Beulich's suggestion)

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Oct 22 11:53:51 2008 +0100 (2008-10-22)
parents 02c8733e2d91
children 008505c3c65a
files xen/arch/x86/x86_64/cpufreq.c xen/include/xlat.lst
line diff
     1.1 --- a/xen/arch/x86/x86_64/cpufreq.c	Wed Oct 22 17:20:15 2008 +0900
     1.2 +++ b/xen/arch/x86/x86_64/cpufreq.c	Wed Oct 22 11:53:51 2008 +0100
     1.3 @@ -56,34 +56,13 @@ compat_set_px_pminfo(uint32_t cpu, struc
     1.4  	return -EFAULT;
     1.5  
     1.6  #define XLAT_processor_performance_HNDL_states(_d_, _s_) do { \
     1.7 -    xen_processor_px_t *xen_states = NULL; \
     1.8 -\
     1.9 -    if ( likely((_s_)->state_count > 0) ) \
    1.10 -    { \
    1.11 -        XEN_GUEST_HANDLE(compat_processor_px_t) states; \
    1.12 -        compat_processor_px_t state; \
    1.13 -        int i; \
    1.14 -\
    1.15 -        xen_states = xlat_malloc_array(xlat_page_current, \
    1.16 -                               xen_processor_px_t, (_s_)->state_count); \
    1.17 -        if ( unlikely(xen_states == NULL) ) \
    1.18 -            return -EFAULT; \
    1.19 -\
    1.20 -        if ( unlikely(!compat_handle_okay((_s_)->states, \
    1.21 -                                (_s_)->state_count)) ) \
    1.22 -            return -EFAULT; \
    1.23 -        guest_from_compat_handle(states, (_s_)->states); \
    1.24 -\
    1.25 -        for ( i = 0; i < _s_->state_count; i++ ) \
    1.26 -        { \
    1.27 -           if ( unlikely(copy_from_guest_offset(&state, states, i, 1)) ) \
    1.28 -               return -EFAULT; \
    1.29 -           XLAT_processor_px(&xen_states[i], &state); \
    1.30 -        } \
    1.31 -    } \
    1.32 -\
    1.33 -    set_xen_guest_handle((_d_)->states, xen_states); \
    1.34 +    XEN_GUEST_HANDLE(compat_processor_px_t) states; \
    1.35 +    if ( unlikely(!compat_handle_okay((_s_)->states, (_s_)->state_count)) ) \
    1.36 +        return -EFAULT; \
    1.37 +    guest_from_compat_handle(states, (_s_)->states); \
    1.38 +    (_d_)->states = guest_handle_cast(states, xen_processor_px_t); \
    1.39  } while (0)
    1.40 +
    1.41      XLAT_processor_performance(xen_perf, perf);
    1.42  #undef XLAT_processor_performance_HNDL_states
    1.43  
     2.1 --- a/xen/include/xlat.lst	Wed Oct 22 17:20:15 2008 +0900
     2.2 +++ b/xen/include/xlat.lst	Wed Oct 22 11:53:51 2008 +0100
     2.3 @@ -56,6 +56,6 @@
     2.4  !	processor_flags			platform.h
     2.5  !	processor_power			platform.h
     2.6  !	pct_register			platform.h
     2.7 -!	processor_px			platform.h
     2.8 +?	processor_px			platform.h
     2.9  !	psd_package			platform.h
    2.10  !	processor_performance		platform.h