diff options
author | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2006-03-03 18:26:41 +0100 |
---|---|---|
committer | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2006-03-03 18:26:41 +0100 |
commit | d870b4b7091a192b6513500f5679cdc6e4145041 (patch) | |
tree | f44cfd90642efb5adfa80740eec765b6f06d6d97 /xen/common/perfc.c | |
parent | 39dbaabab798eb9faddff91e3e6cbff8b2d8051b (diff) | |
download | xen-d870b4b7091a192b6513500f5679cdc6e4145041.tar.gz xen-d870b4b7091a192b6513500f5679cdc6e4145041.tar.bz2 xen-d870b4b7091a192b6513500f5679cdc6e4145041.zip |
Move dom0_op hypercall to the guest_handle interface (inside Xen).
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/common/perfc.c')
-rw-r--r-- | xen/common/perfc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/xen/common/perfc.c b/xen/common/perfc.c index afb9af0bfa..782bb4f774 100644 --- a/xen/common/perfc.c +++ b/xen/common/perfc.c @@ -5,9 +5,10 @@ #include <xen/perfc.h> #include <xen/keyhandler.h> #include <xen/spinlock.h> +#include <xen/mm.h> +#include <xen/guest_access.h> #include <public/dom0_ops.h> #include <asm/uaccess.h> -#include <xen/mm.h> #undef PERFCOUNTER #undef PERFCOUNTER_CPU @@ -131,12 +132,12 @@ void perfc_reset(unsigned char key) static dom0_perfc_desc_t perfc_d[NR_PERFCTRS]; static int perfc_init = 0; -static int perfc_copy_info(dom0_perfc_desc_t *desc) +static int perfc_copy_info(guest_handle(dom0_perfc_desc_t) desc) { unsigned int i, j; atomic_t *counters = (atomic_t *)&perfcounters; - if ( desc == NULL ) + if ( guest_handle_is_null(desc) ) return 0; /* We only copy the name and array-size information once. */ @@ -196,7 +197,7 @@ static int perfc_copy_info(dom0_perfc_desc_t *desc) } } - return (copy_to_user(desc, perfc_d, NR_PERFCTRS * sizeof(*desc)) ? + return (copy_to_guest(desc, (dom0_perfc_desc_t *)perfc_d, NR_PERFCTRS) ? -EFAULT : 0); } |