Module Name:    src
Committed By:   matt
Date:           Tue Jun 21 06:38:51 UTC 2011

Modified Files:
        src/sys/arch/powerpc/booke: trap.c
        src/sys/arch/powerpc/ibm4xx: trap.c
        src/sys/arch/powerpc/powerpc: trap.c

Log Message:
Switch to use new common cpu_ast routine.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/powerpc/booke/trap.c
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/powerpc/ibm4xx/trap.c
cvs rdiff -u -r1.143 -r1.144 src/sys/arch/powerpc/powerpc/trap.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/powerpc/booke/trap.c
diff -u src/sys/arch/powerpc/booke/trap.c:1.11 src/sys/arch/powerpc/booke/trap.c:1.12
--- src/sys/arch/powerpc/booke/trap.c:1.11	Mon Jun 20 20:24:28 2011
+++ src/sys/arch/powerpc/booke/trap.c	Tue Jun 21 06:38:50 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.11 2011/06/20 20:24:28 matt Exp $	*/
+/*	$NetBSD: trap.c,v 1.12 2011/06/21 06:38:50 matt Exp $	*/
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -39,7 +39,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.11 2011/06/20 20:24:28 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.12 2011/06/21 06:38:50 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -793,15 +793,7 @@
 		break;
 	case T_AST:
 		KASSERT(usertrap);
-		l->l_md.md_astpending = 0;	/* we are about to do it */
-		ci->ci_data.cpu_nsoft++;
-		if (l->l_pflag & LP_OWEUPC) {
-			l->l_pflag &= ~LP_OWEUPC;
-			ADDUPROF(l);
-		}
-		/* Check whether we are being preempted. */
-		if (ci->ci_want_resched)
-			preempt();
+		cpu_ast(l, ci);
 		if (tf->tf_fixreg[1] & 0x80000000) {
 			printf("%s(ast-exit): pid %d.%d (%s): invalid sp %#lx\n",
 			    __func__, p->p_pid, l->l_lid, p->p_comm,

Index: src/sys/arch/powerpc/ibm4xx/trap.c
diff -u src/sys/arch/powerpc/ibm4xx/trap.c:1.61 src/sys/arch/powerpc/ibm4xx/trap.c:1.62
--- src/sys/arch/powerpc/ibm4xx/trap.c:1.61	Sat Jun 18 06:41:41 2011
+++ src/sys/arch/powerpc/ibm4xx/trap.c	Tue Jun 21 06:38:50 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.61 2011/06/18 06:41:41 matt Exp $	*/
+/*	$NetBSD: trap.c,v 1.62 2011/06/21 06:38:50 matt Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.61 2011/06/18 06:41:41 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.62 2011/06/21 06:38:50 matt Exp $");
 
 #include "opt_altivec.h"
 #include "opt_ddb.h"
@@ -297,18 +297,9 @@
 		break;
 
 	case EXC_AST|EXC_USER:
-		l->l_md.md_astpending = 0;	/* we are about to do it */
-		//curcpu()->ci_data.cpu_nast++;
-		if (l->l_pflag & LP_OWEUPC) {
-			l->l_pflag &= ~LP_OWEUPC;
-			ADDUPROF(l);
-		}
-		/* Check whether we are being preempted. */
-		if (curcpu()->ci_want_resched)
-			preempt();
+		cpu_ast(l, curcpu());
 		break;
 
-
 	case EXC_ALI|EXC_USER:
 		if (fix_unaligned(l, tf) != 0) {
 			KSI_INIT_TRAP(&ksi);

Index: src/sys/arch/powerpc/powerpc/trap.c
diff -u src/sys/arch/powerpc/powerpc/trap.c:1.143 src/sys/arch/powerpc/powerpc/trap.c:1.144
--- src/sys/arch/powerpc/powerpc/trap.c:1.143	Mon Jun 20 05:59:06 2011
+++ src/sys/arch/powerpc/powerpc/trap.c	Tue Jun 21 06:38:50 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.143 2011/06/20 05:59:06 matt Exp $	*/
+/*	$NetBSD: trap.c,v 1.144 2011/06/21 06:38:50 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.143 2011/06/20 05:59:06 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.144 2011/06/21 06:38:50 matt Exp $");
 
 #include "opt_altivec.h"
 #include "opt_ddb.h"
@@ -345,15 +345,7 @@
 		break;
 
 	case EXC_AST|EXC_USER:
-		l->l_md.md_astpending = 0;	/* we are about to do it */
-		//ci->ci_data.cpu_nast++;
-		if (l->l_pflag & LP_OWEUPC) {
-			l->l_pflag &= ~LP_OWEUPC;
-			ADDUPROF(l);
-		}
-		/* Check whether we are being preempted. */
-		if (ci->ci_want_resched)
-			preempt();
+		cpu_ast(l, ci);
 		break;
 
 	case EXC_ALI|EXC_USER:

Reply via email to