inline 2 trivial functions that are called often (according to profiling

data).
This commit is contained in:
bouyer 2005-09-20 20:33:53 +00:00
parent 0b1f7e4a8c
commit 8519a64973
3 changed files with 25 additions and 31 deletions

View File

@ -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 <sys/cdefs.h> #include <sys/cdefs.h>
__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 <sys/cdefs.h> #include <sys/cdefs.h>
#include <sys/param.h> #include <sys/param.h>
@ -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 */ /* #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(void);
int int
stipending() stipending()

View File

@ -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 */ /* hypervisor.c */
struct intrframe; struct intrframe;
void do_hypervisor_callback(struct intrframe *regs); void do_hypervisor_callback(struct intrframe *regs);
void hypervisor_notify_via_evtchn(unsigned int);
void hypervisor_enable_event(unsigned int); void hypervisor_enable_event(unsigned int);
/* hypervisor_machdep.c */ /* hypervisor_machdep.c */
void hypervisor_unmask_event(unsigned int); void hypervisor_unmask_event(unsigned int);
void hypervisor_mask_event(unsigned int); void hypervisor_mask_event(unsigned int);
void hypervisor_clear_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_enable_ipl(unsigned int);
void hypervisor_set_ipending(u_int32_t, int, 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; 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_ */ #endif /* _XEN_HYPERVISOR_H_ */

View File

@ -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. * Copyright (c) 2005 Manuel Bouyer.
@ -63,7 +63,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
__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 <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -293,16 +293,6 @@ hypervisor_print(aux, parent)
return (UNCONF); 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 #ifdef DOM0OPS
#define DIR_MODE (S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) #define DIR_MODE (S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)