Module Name:    src
Committed By:   cherry
Date:           Sat Nov 10 16:28:06 UTC 2012

Modified Files:
        src/sys/arch/amd64/amd64: spl.S
        src/sys/arch/i386/i386: spl.S
        src/sys/arch/xen/x86: hypervisor_machdep.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/amd64/amd64/spl.S
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/i386/i386/spl.S
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/xen/x86/hypervisor_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amd64/amd64/spl.S
diff -u src/sys/arch/amd64/amd64/spl.S:1.25 src/sys/arch/amd64/amd64/spl.S:1.26
--- src/sys/arch/amd64/amd64/spl.S:1.25	Fri Nov  2 08:31:28 2012
+++ src/sys/arch/amd64/amd64/spl.S	Sat Nov 10 16:28:06 2012
@@ -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 @@ doreti_checkast:
 	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 */

Index: src/sys/arch/i386/i386/spl.S
diff -u src/sys/arch/i386/i386/spl.S:1.37 src/sys/arch/i386/i386/spl.S:1.38
--- src/sys/arch/i386/i386/spl.S:1.37	Fri Jun 15 14:09:26 2012
+++ src/sys/arch/i386/i386/spl.S	Sat Nov 10 16:28:06 2012
@@ -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 @@ doreti_checkast:
 #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()

Index: src/sys/arch/xen/x86/hypervisor_machdep.c
diff -u src/sys/arch/xen/x86/hypervisor_machdep.c:1.21 src/sys/arch/xen/x86/hypervisor_machdep.c:1.22
--- src/sys/arch/xen/x86/hypervisor_machdep.c:1.21	Tue Dec 27 07:47:00 2011
+++ src/sys/arch/xen/x86/hypervisor_machdep.c	Sat Nov 10 16:28:06 2012
@@ -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 @@ evt_do_hypervisor_callback(struct cpu_in
 	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 */

Reply via email to