From 8519a64973fae4bfafa100b4f031a73027c2681a Mon Sep 17 00:00:00 2001 From: bouyer Date: Tue, 20 Sep 2005 20:33:53 +0000 Subject: [PATCH] inline 2 trivial functions that are called often (according to profiling data). --- sys/arch/xen/i386/hypervisor_machdep.c | 17 ++--------------- sys/arch/xen/include/hypervisor.h | 25 +++++++++++++++++++++---- sys/arch/xen/xen/hypervisor.c | 14 ++------------ 3 files changed, 25 insertions(+), 31 deletions(-) diff --git a/sys/arch/xen/i386/hypervisor_machdep.c b/sys/arch/xen/i386/hypervisor_machdep.c index a34178a71108..a4c43d1a6ffb 100644 --- a/sys/arch/xen/i386/hypervisor_machdep.c +++ b/sys/arch/xen/i386/hypervisor_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: hypervisor_machdep.c,v 1.12 2005/04/30 08:37:16 yamt Exp $ */ +/* $NetBSD: hypervisor_machdep.c,v 1.13 2005/09/20 20:33:53 bouyer Exp $ */ /* * @@ -59,7 +59,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.12 2005/04/30 08:37:16 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.13 2005/09/20 20:33:53 bouyer Exp $"); #include #include @@ -74,19 +74,6 @@ __KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.12 2005/04/30 08:37:16 yamt /* #define PORT_DEBUG -1 */ -/* - * Force a proper event-channel callback from Xen after clearing the - * callback mask. We do this in a very simple manner, by making a call - * down into Xen. The pending flag will be checked by Xen on return. - */ -void -hypervisor_force_callback(void) -{ - // DDD printf("hypervisor_force_callback\n"); - - (void)HYPERVISOR_xen_version(0); -} - int stipending(void); int stipending() diff --git a/sys/arch/xen/include/hypervisor.h b/sys/arch/xen/include/hypervisor.h index afd1231b4fb3..1f2fa392d13a 100644 --- a/sys/arch/xen/include/hypervisor.h +++ b/sys/arch/xen/include/hypervisor.h @@ -1,4 +1,4 @@ -/* $NetBSD: hypervisor.h,v 1.14 2005/05/11 13:53:41 yamt Exp $ */ +/* $NetBSD: hypervisor.h,v 1.15 2005/09/20 20:33:53 bouyer Exp $ */ /* * @@ -85,15 +85,12 @@ extern union start_info_union start_info_union; /* hypervisor.c */ struct intrframe; void do_hypervisor_callback(struct intrframe *regs); -void hypervisor_notify_via_evtchn(unsigned int); void hypervisor_enable_event(unsigned int); /* hypervisor_machdep.c */ void hypervisor_unmask_event(unsigned int); void hypervisor_mask_event(unsigned int); void hypervisor_clear_event(unsigned int); -void hypervisor_force_callback(void) - __attribute__((no_instrument_function)); /* used by mcount */ void hypervisor_enable_ipl(unsigned int); void hypervisor_set_ipending(u_int32_t, int, int); @@ -528,4 +525,24 @@ HYPERVISOR_vm_assist(unsigned int cmd, unsigned int type) return ret; } +/* + * Force a proper event-channel callback from Xen after clearing the + * callback mask. We do this in a very simple manner, by making a call + * down into Xen. The pending flag will be checked by Xen on return. + */ +static inline void hypervisor_force_callback(void) +{ + (void)HYPERVISOR_xen_version(0); +} __attribute__((no_instrument_function)) /* used by mcount */ + +static inline void +hypervisor_notify_via_evtchn(unsigned int port) +{ + evtchn_op_t op; + + op.cmd = EVTCHNOP_send; + op.u.send.local_port = port; + (void)HYPERVISOR_event_channel_op(&op); +} + #endif /* _XEN_HYPERVISOR_H_ */ diff --git a/sys/arch/xen/xen/hypervisor.c b/sys/arch/xen/xen/hypervisor.c index 46e3ba69685d..ff1011efd253 100644 --- a/sys/arch/xen/xen/hypervisor.c +++ b/sys/arch/xen/xen/hypervisor.c @@ -1,4 +1,4 @@ -/* $NetBSD: hypervisor.c,v 1.16 2005/08/21 22:20:28 bouyer Exp $ */ +/* $NetBSD: hypervisor.c,v 1.17 2005/09/20 20:33:53 bouyer Exp $ */ /* * Copyright (c) 2005 Manuel Bouyer. @@ -63,7 +63,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.16 2005/08/21 22:20:28 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hypervisor.c,v 1.17 2005/09/20 20:33:53 bouyer Exp $"); #include #include @@ -293,16 +293,6 @@ hypervisor_print(aux, parent) return (UNCONF); } -void -hypervisor_notify_via_evtchn(unsigned int port) -{ - evtchn_op_t op; - - op.cmd = EVTCHNOP_send; - op.u.send.local_port = port; - (void)HYPERVISOR_event_channel_op(&op); -} - #ifdef DOM0OPS #define DIR_MODE (S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)