Subject: splraiseipl
To: None <port-pdp10@netbsd.org>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: port-pdp10
Date: 09/30/2006 17:36:15
--NextPart-20060930163541-0902600
Content-Type: Text/Plain; charset=us-ascii

hi,

can anyone review the attached patch?

YAMAMOTO Takashi

--NextPart-20060930163541-0902600
Content-Type: Text/Plain; charset=us-ascii
Content-Disposition: attachment; filename="a.diff"

Index: include/intr.h
===================================================================
RCS file: /cvsroot/src/sys/arch/pdp10/include/intr.h,v
retrieving revision 1.2
diff -u -p -r1.2 intr.h
--- include/intr.h	11 Dec 2005 12:18:34 -0000	1.2
+++ include/intr.h	30 Sep 2006 07:59:30 -0000
@@ -87,6 +87,14 @@ int spltty(void);
 int spl0(void);
 int spllock(void);
 int splx(int);
+
+typedef int ipl_t;
+typedef struct {
+	_pi;
+} ipl_cookie_t;
+int splraiseipl(ipl_cookie_t);
+ipl_cookie_t makeiplcookie(ipl_t);
+
 #if 0
 extern void *softintr_establish(int, void (*)(void *), void *);
 void softintr_schedule(void *arg);
Index: pdp10/locore.S
===================================================================
RCS file: /cvsroot/src/sys/arch/pdp10/pdp10/locore.S,v
retrieving revision 1.2
diff -u -p -r1.2 locore.S
--- pdp10/locore.S	11 Dec 2005 12:18:34 -0000	1.2
+++ pdp10/locore.S	30 Sep 2006 07:59:31 -0000
@@ -260,6 +260,12 @@ ENTRY(spl0)		# Unblock everything
 	cono PI,PI_LVLON|PI_ON|PI_ALL
 	popj SP,
 
+ENTRY(splraiseipl)
+	SVPRI
+	move %2,-1(SP)
+	cono PI,%2
+	popj SP,
+
 
 /*
  * This routine is problematic. The only way to lower an interrupt is
Index: pdp10/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/pdp10/pdp10/machdep.c,v
retrieving revision 1.8
diff -u -p -r1.8 machdep.c
--- pdp10/machdep.c	11 Dec 2005 12:18:34 -0000	1.8
+++ pdp10/machdep.c	30 Sep 2006 07:59:31 -0000
@@ -41,6 +41,8 @@
 #include <sys/buf.h>
 #include <sys/conf.h>
 
+#include <machine/intr.h>
+
 #include <dev/cons.h>
 
 int physmem;
@@ -208,3 +210,11 @@ cpu_switchto (struct lwp *p, struct lwp 
 	panic("cpu_switchto");
 }
 
+ipl_cookie_t
+makeiplcookie(ipl_t ipl)
+{
+	ipl_cookie_t icookie;
+
+	icookie._pi = PI_LVLOFF | IPL2PI(ipl);
+	return icookie;
+}

--NextPart-20060930163541-0902600--