Module Name:    src
Committed By:   skrll
Date:           Sat Apr  3 07:46:02 UTC 2010

Modified Files:
        src/sys/arch/hp700/include: cpu.h intr.h
        src/sys/arch/hppa/hppa: hppa_machdep.c trap.c vm_machdep.c
        src/sys/arch/hppa/include: proc.h

Log Message:
Add md_astpending to struct mdlwp and use it.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/hp700/include/cpu.h
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/hp700/include/intr.h
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/hppa/hppa/hppa_machdep.c
cvs rdiff -u -r1.85 -r1.86 src/sys/arch/hppa/hppa/trap.c
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/hppa/hppa/vm_machdep.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/hppa/include/proc.h

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/hp700/include/cpu.h
diff -u src/sys/arch/hp700/include/cpu.h:1.43 src/sys/arch/hp700/include/cpu.h:1.44
--- src/sys/arch/hp700/include/cpu.h:1.43	Fri Apr  2 19:33:16 2010
+++ src/sys/arch/hp700/include/cpu.h	Sat Apr  3 07:46:01 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.43 2010/04/02 19:33:16 skrll Exp $	*/
+/*	$NetBSD: cpu.h,v 1.44 2010/04/03 07:46:01 skrll Exp $	*/
 
 /*	$OpenBSD: cpu.h,v 1.55 2008/07/23 17:39:35 kettenis Exp $	*/
 
@@ -216,8 +216,8 @@
 #define	CLKF_INTR(framep)	((framep)->cf_flags & TFF_INTR)
 #define	CLKF_USERMODE(framep)	((framep)->cf_flags & T_USER)
 
-#define	cpu_signotify(l)	(setsoftast())
-#define	cpu_need_proftick(l)	((l)->l_pflag |= LP_OWEUPC, setsoftast())
+#define	cpu_signotify(l)	(setsoftast(l))
+#define	cpu_need_proftick(l)	((l)->l_pflag |= LP_OWEUPC, setsoftast(l))
 
 #include <sys/cpu_data.h>
 struct cpu_info {

Index: src/sys/arch/hp700/include/intr.h
diff -u src/sys/arch/hp700/include/intr.h:1.16 src/sys/arch/hp700/include/intr.h:1.17
--- src/sys/arch/hp700/include/intr.h:1.16	Wed Mar 31 12:56:14 2010
+++ src/sys/arch/hp700/include/intr.h	Sat Apr  3 07:46:01 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.16 2010/03/31 12:56:14 skrll Exp $	*/
+/*	$NetBSD: intr.h,v 1.17 2010/04/03 07:46:01 skrll Exp $	*/
 /*	$OpenBSD: intr.h,v 1.26 2009/12/29 13:11:40 jsing Exp $	*/
 
 /*-
@@ -57,9 +57,6 @@
 /* The priority level masks. */
 extern int imask[NIPL];
 
-/* The asynchronous system trap flag. */
-extern volatile int astpending;
-
 /* splraise()/spllower() are in locore.S */
 int splraise(int);
 void spllower(int);
@@ -91,7 +88,7 @@
 
 #include <sys/spl.h>
 
-#define	setsoftast()	(astpending = 1)
+#define	setsoftast(l)	((l)->l_md.md_astpending = 1)
 #define	setsoftnet()	hp700_intr_schedule(softnetmask)
 
 void	hp700_intr_schedule(int);

Index: src/sys/arch/hppa/hppa/hppa_machdep.c
diff -u src/sys/arch/hppa/hppa/hppa_machdep.c:1.20 src/sys/arch/hppa/hppa/hppa_machdep.c:1.21
--- src/sys/arch/hppa/hppa/hppa_machdep.c:1.20	Tue Mar 16 16:20:19 2010
+++ src/sys/arch/hppa/hppa/hppa_machdep.c	Sat Apr  3 07:46:02 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: hppa_machdep.c,v 1.20 2010/03/16 16:20:19 skrll Exp $	*/
+/*	$NetBSD: hppa_machdep.c,v 1.21 2010/04/03 07:46:02 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hppa_machdep.c,v 1.20 2010/03/16 16:20:19 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hppa_machdep.c,v 1.21 2010/04/03 07:46:02 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -351,6 +351,10 @@
 	}
 }
 
+/*
+ * Preempt the current LWP if in interrupt from user mode,
+ * or after the current trap/syscall if in system mode.
+ */
 void
 cpu_need_resched(struct cpu_info *ci, int flags)
 {
@@ -359,8 +363,7 @@
 	if (ci->ci_want_resched && !immed)
 		return;
 	ci->ci_want_resched = 1;
-	/* setsoftast(ci->ci_data.cpu_onproc); */
-	setsoftast();
+	setsoftast(ci->ci_data.cpu_onproc);
 
 #ifdef MULTIPROCESSOR
 	if (ci->ci_curlwp != ci->ci_data.cpu_idlelwp) {

Index: src/sys/arch/hppa/hppa/trap.c
diff -u src/sys/arch/hppa/hppa/trap.c:1.85 src/sys/arch/hppa/hppa/trap.c:1.86
--- src/sys/arch/hppa/hppa/trap.c:1.85	Wed Mar 31 12:56:14 2010
+++ src/sys/arch/hppa/hppa/trap.c	Sat Apr  3 07:46:02 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.85 2010/03/31 12:56:14 skrll Exp $	*/
+/*	$NetBSD: trap.c,v 1.86 2010/04/03 07:46:02 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.85 2010/03/31 12:56:14 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.86 2010/04/03 07:46:02 skrll Exp $");
 
 /* #define INTRDEBUG */
 /* #define TRAPDEBUG */
@@ -174,8 +174,6 @@
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 
-volatile int astpending;
-
 void pmap_hptdump(void);
 void syscall(struct trapframe *, int *);
 
@@ -205,11 +203,12 @@
 {
 	struct proc *p = l->l_proc;
 
-	if (astpending) {
-		astpending = 0;
-		if (curcpu()->ci_want_resched) {
+	if (l->l_md.md_astpending) {
+		l->l_md.md_astpending = 0;
+		uvmexp.softs++;
+
+		if (curcpu()->ci_want_resched)
 			preempt();
-		}
 	}
 
 	mi_userret(l);

Index: src/sys/arch/hppa/hppa/vm_machdep.c
diff -u src/sys/arch/hppa/hppa/vm_machdep.c:1.43 src/sys/arch/hppa/hppa/vm_machdep.c:1.44
--- src/sys/arch/hppa/hppa/vm_machdep.c:1.43	Thu Apr  1 12:09:39 2010
+++ src/sys/arch/hppa/hppa/vm_machdep.c	Sat Apr  3 07:46:02 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.43 2010/04/01 12:09:39 skrll Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.44 2010/04/03 07:46:02 skrll Exp $	*/
 
 /*	$OpenBSD: vm_machdep.c,v 1.64 2008/09/30 18:54:26 miod Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.43 2010/04/01 12:09:39 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.44 2010/04/03 07:46:02 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -93,6 +93,7 @@
 	pcb1 = lwp_getpcb(l1);
 	pcb2 = lwp_getpcb(l2);
 
+	l2->l_md.md_astpending = 0;
 	l2->l_md.md_flags = 0;
 
 	/* Flush the parent LWP out of the FPU. */

Index: src/sys/arch/hppa/include/proc.h
diff -u src/sys/arch/hppa/include/proc.h:1.9 src/sys/arch/hppa/include/proc.h:1.10
--- src/sys/arch/hppa/include/proc.h:1.9	Wed Mar 31 06:40:30 2010
+++ src/sys/arch/hppa/include/proc.h	Sat Apr  3 07:46:02 2010
@@ -1,6 +1,6 @@
-/*	$NetBSD: proc.h,v 1.9 2010/03/31 06:40:30 skrll Exp $	*/
+/*	$NetBSD: proc.h,v 1.10 2010/04/03 07:46:02 skrll Exp $	*/
 
-/*	$OpenBSD: proc.h,v 1.1 1998/07/07 21:32:44 mickey Exp $	*/
+/*	$OpenBSD: proc.h,v 1.4 2009/12/29 13:11:40 jsing Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -43,6 +43,7 @@
  */
 struct mdlwp {
 	struct		trapframe *md_regs;	/* registers on current frame */
+	volatile int	md_astpending;		/* AST pending for this LWP */
 	int		md_flags;		/* machine-dependent flags */
 
 	vaddr_t		md_bpva;

Reply via email to