Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch Remove e a redundant layer of function calling in t...



details:   https://anonhg.NetBSD.org/src/rev/74dd5021d8a2
branches:  trunk
changeset: 782638:74dd5021d8a2
user:      cherry <cherry%NetBSD.org@localhost>
date:      Sat Nov 10 16:28:06 2012 +0000

description:
Remove e a redundant layer of function calling in the event handling path

diffstat:

 sys/arch/amd64/amd64/spl.S            |  17 +--------------
 sys/arch/i386/i386/spl.S              |  40 +---------------------------------
 sys/arch/xen/x86/hypervisor_machdep.c |  15 ++++++++----
 3 files changed, 13 insertions(+), 59 deletions(-)

diffs (131 lines):

diff -r 10754d5a74c6 -r 74dd5021d8a2 sys/arch/amd64/amd64/spl.S
--- a/sys/arch/amd64/amd64/spl.S        Sat Nov 10 16:18:41 2012 +0000
+++ b/sys/arch/amd64/amd64/spl.S        Sat Nov 10 16:28:06 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: spl.S,v 1.25 2012/11/02 08:31:28 yamt Exp $    */
+/*     $NetBSD: spl.S,v 1.26 2012/11/10 16:28:06 cherry Exp $  */
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -344,18 +344,3 @@
        call    _C_LABEL(do_pmap_load)
        CLI(si)
        jmp     doreti_checkast         /* recheck ASTs */
-
-#ifdef XEN
-NENTRY(call_evtchn_do_event)
-       incl    CPUVAR(IDEPTH)
-       call    _C_LABEL(evtchn_do_event)
-       decl    CPUVAR(IDEPTH)
-       ret
-#ifdef DOM0OPS
-NENTRY(call_xenevt_event)
-       incl    CPUVAR(IDEPTH)
-       call    _C_LABEL(xenevt_event)
-       decl    CPUVAR(IDEPTH)
-       ret
-#endif /* DOM0OPS */
-#endif /* XEN */
diff -r 10754d5a74c6 -r 74dd5021d8a2 sys/arch/i386/i386/spl.S
--- a/sys/arch/i386/i386/spl.S  Sat Nov 10 16:18:41 2012 +0000
+++ b/sys/arch/i386/i386/spl.S  Sat Nov 10 16:28:06 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: spl.S,v 1.37 2012/06/15 14:09:26 yamt Exp $    */
+/*     $NetBSD: spl.S,v 1.38 2012/11/10 16:28:06 cherry Exp $  */
 
 /*
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: spl.S,v 1.37 2012/06/15 14:09:26 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spl.S,v 1.38 2012/11/10 16:28:06 cherry Exp $");
 
 #include "opt_vm86.h"
 #include "opt_ddb.h"
@@ -322,42 +322,6 @@
 #endif /* defined(DEBUG) */
 IDTVEC_END(doreti)
 
-#ifdef XEN
-/*
- * void evtchn_do_event(int evtch, struct intrframe *regs)
- */
-
-ENTRY(call_evtchn_do_event)
-       IDEPTH_INCR
-       /*
-        * IDEPTH_INCR leaves old %esp in %eax.
-        */
-       pushl   8(%eax) /* regs */
-       pushl   4(%eax) /* evtch */
-       call    _C_LABEL(evtchn_do_event)
-       addl    $8, %esp
-       IDEPTH_DECR
-       ret
-END(call_evtchn_do_event)
-#ifdef DOM0OPS
-/*
- * void xenevt_event(int port)
- */
-
-ENTRY(call_xenevt_event)
-       IDEPTH_INCR
-       /*
-        * IDEPTH_INCR leaves old %esp in %eax.
-        */
-       pushl   4(%eax) /* evtch */
-       call    _C_LABEL(xenevt_event)
-       addl    $4, %esp
-       IDEPTH_DECR
-       ret
-END(call_xenevt_event)
-#endif /* DOM0OPS */
-#endif /* XEN */
-
 #ifndef XEN
 /*
  * Xsoftintr()
diff -r 10754d5a74c6 -r 74dd5021d8a2 sys/arch/xen/x86/hypervisor_machdep.c
--- a/sys/arch/xen/x86/hypervisor_machdep.c     Sat Nov 10 16:18:41 2012 +0000
+++ b/sys/arch/xen/x86/hypervisor_machdep.c     Sat Nov 10 16:28:06 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hypervisor_machdep.c,v 1.21 2011/12/27 07:47:00 cherry Exp $   */
+/*     $NetBSD: hypervisor_machdep.c,v 1.22 2012/11/10 16:28:06 cherry Exp $   */
 
 /*
  *
@@ -54,7 +54,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.21 2011/12/27 07:47:00 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hypervisor_machdep.c,v 1.22 2012/11/10 16:28:06 cherry Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -226,15 +226,20 @@
        if (port == PORT_DEBUG)
                printf("do_hypervisor_callback event %d\n", port);
 #endif
-       if (evtsource[port])
-               call_evtchn_do_event(port, regs);
+       if (evtsource[port]) {
+               ci->ci_idepth++;
+               evtchn_do_event(port, regs);
+               ci->ci_idepth--;
+       }
 #ifdef DOM0OPS
        else  {
                if (ci->ci_ilevel < IPL_HIGH) {
                        /* fast path */
                        int oipl = ci->ci_ilevel;
                        ci->ci_ilevel = IPL_HIGH;
-                       call_xenevt_event(port);
+                       ci->ci_idepth++;                        
+                       xenevt_event(port);
+                       ci->ci_idepth--;
                        ci->ci_ilevel = oipl;
                } else {
                        /* set pending event */



Home | Main Index | Thread Index | Old Index