From 4de6ba366b9da28cd4de4946dd19e3904504a0d5 Mon Sep 17 00:00:00 2001 From: bouyer Date: Sat, 16 Apr 2005 23:33:17 +0000 Subject: [PATCH] Remove functions that just call another one. Inline a function used at only one place. --- sys/arch/xen/include/hypervisor.h | 8 ++--- sys/arch/xen/xen/evtchn.c | 51 +++++++------------------------ sys/arch/xen/xen/xbdback.c | 4 +-- sys/arch/xen/xen/xennetback.c | 4 +-- 4 files changed, 18 insertions(+), 49 deletions(-) diff --git a/sys/arch/xen/include/hypervisor.h b/sys/arch/xen/include/hypervisor.h index e5486fff2c70..ad2913c08967 100644 --- a/sys/arch/xen/include/hypervisor.h +++ b/sys/arch/xen/include/hypervisor.h @@ -1,4 +1,4 @@ -/* $NetBSD: hypervisor.h,v 1.11 2005/04/16 22:49:37 bouyer Exp $ */ +/* $NetBSD: hypervisor.h,v 1.12 2005/04/16 23:33:17 bouyer Exp $ */ /* * @@ -87,16 +87,14 @@ struct intrframe; void do_hypervisor_callback(struct intrframe *regs); void hypervisor_notify_via_evtchn(unsigned int); void hypervisor_enable_event(unsigned int); -void hypervisor_disable_event(unsigned int); -void hypervisor_acknowledge_event(unsigned int); -void hypervisor_enable_ipl(unsigned int); -void hypervisor_set_ipending(int, int, 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); +void hypervisor_enable_ipl(unsigned int); +void hypervisor_set_ipending(int, int, int); /* * Assembler stubs for hyper-calls. diff --git a/sys/arch/xen/xen/evtchn.c b/sys/arch/xen/xen/evtchn.c index 1f4324d9a71a..c0a2fef6a570 100644 --- a/sys/arch/xen/xen/evtchn.c +++ b/sys/arch/xen/xen/evtchn.c @@ -1,4 +1,4 @@ -/* $NetBSD: evtchn.c,v 1.5 2005/04/16 22:49:38 bouyer Exp $ */ +/* $NetBSD: evtchn.c,v 1.6 2005/04/16 23:33:18 bouyer Exp $ */ /* * @@ -34,7 +34,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.5 2005/04/16 22:49:38 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: evtchn.c,v 1.6 2005/04/16 23:33:18 bouyer Exp $"); #include #include @@ -77,7 +77,6 @@ static int pirq_to_evtch[NR_PIRQS]; /* PIRQ needing notify */ static u_int32_t pirq_needs_unmask_notify[NR_EVENT_CHANNELS / 32]; int pirq_interrupt(void *); -void pirq_notify(int); physdev_op_t physdev_op_notify = { .cmd = PHYSDEVOP_IRQ_UNMASK_NOTIFY, }; @@ -164,7 +163,8 @@ do_event(int evtch, struct intrframe *regs) #endif ci = &cpu_info_primary; - hypervisor_acknowledge_event(evtch); + hypervisor_mask_event(evtch); + hypervisor_clear_event(evtch); /* * Shortcut for the debug handler, we want it to always run, @@ -397,19 +397,6 @@ pirq_interrupt(void *arg) return ret; } -void -pirq_notify(int evtch) -{ - - if (pirq_needs_unmask_notify[evtch >> 5] & (1 << (evtch & 0x1f))) { -#ifdef IRQ_DEBUG - if (irq == IRQ_DEBUG) - printf("pirq_notify(%d)\n", evtch); -#endif - (void)HYPERVISOR_physdev_op(&physdev_op_notify); - } -} - #endif /* DOM0OPS */ int @@ -541,30 +528,14 @@ hypervisor_enable_event(unsigned int evtch) hypervisor_unmask_event(evtch); #ifdef DOM0OPS - pirq_notify(evtch); + if (pirq_needs_unmask_notify[evtch >> 5] & (1 << (evtch & 0x1f))) { +#ifdef IRQ_DEBUG + if (irq == IRQ_DEBUG) + printf("pirq_notify(%d)\n", evtch); #endif -} - -void -hypervisor_disable_event(unsigned int evtch) -{ -#ifdef IRQ_DEBUG - if (evtch == IRQ_DEBUG) - printf("hypervisor_disable_evtch: evtch %d\n", evtch); -#endif - - hypervisor_mask_event(evtch); -} - -void -hypervisor_acknowledge_event(unsigned int evtch) -{ -#ifdef IRQ_DEBUG - if (evtch == IRQ_DEBUG) - printf("hypervisor_acknowledge_evtch: evtch %d\n", evtch); -#endif - hypervisor_mask_event(evtch); - hypervisor_clear_event(evtch); + (void)HYPERVISOR_physdev_op(&physdev_op_notify); + } +#endif /* DOM0OPS */ } #if 0 diff --git a/sys/arch/xen/xen/xbdback.c b/sys/arch/xen/xen/xbdback.c index e77a92762b3f..4423eea0b82e 100644 --- a/sys/arch/xen/xen/xbdback.c +++ b/sys/arch/xen/xen/xbdback.c @@ -1,4 +1,4 @@ -/* $NetBSD: xbdback.c,v 1.8 2005/04/16 22:49:38 bouyer Exp $ */ +/* $NetBSD: xbdback.c,v 1.9 2005/04/16 23:33:18 bouyer Exp $ */ /* * Copyright (c) 2005 Manuel Bouyer. @@ -283,7 +283,7 @@ xbdback_ctrlif_rx(ctrl_msg_t *msg, unsigned long id) req->status = BLKIF_BE_STATUS_INTERFACE_NOT_FOUND; goto end; } - hypervisor_disable_event(xbdi->evtchn); + hypervisor_mask_event(xbdi->evtchn); event_remove_handler(xbdi->evtchn, xbdback_evthandler, xbdi); ring_addr = (vaddr_t)xbdi->blk_ring; pmap_remove(pmap_kernel(), ring_addr, ring_addr + PAGE_SIZE); diff --git a/sys/arch/xen/xen/xennetback.c b/sys/arch/xen/xen/xennetback.c index 352e3232f2b5..02ab84a4dff9 100644 --- a/sys/arch/xen/xen/xennetback.c +++ b/sys/arch/xen/xen/xennetback.c @@ -1,4 +1,4 @@ -/* $NetBSD: xennetback.c,v 1.7 2005/04/16 22:49:38 bouyer Exp $ */ +/* $NetBSD: xennetback.c,v 1.8 2005/04/16 23:33:18 bouyer Exp $ */ /* * Copyright (c) 2005 Manuel Bouyer. @@ -374,7 +374,7 @@ fail_1: } xneti->status = DISCONNECTED; xneti->xni_if.if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); - hypervisor_disable_event(xneti->xni_evtchn); + hypervisor_mask_event(xneti->xni_evtchn); event_remove_handler(xneti->xni_evtchn, xennetback_evthandler, xneti); ring_addr = (vaddr_t)xneti->xni_rxring;