Port-m68k archive

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

Re: diffs around makeiplcookie()



At Sun, 15 Jun 2008 15:13:07 +0900,
Izumi Tsutsui wrote:
> > Thank you, tsutsui-san.  I also prefer your proposal.
> > I'll do the rest within few weeks.
> 
> I'll also take mac68k and check it on my LC630.

Here is a patch for atari, next68k, mvme68k.
These are compiled but not tested.

For mvme68k, I swapped IPL_SOFTCLOCK and IPL_SOFTBIO
to sort it as described in spl(9).  I think that it's
not problem.

And I have a question for atari.  I'll post it to
port-atari@ later.

Index: atari/atari/intr.c
===================================================================
RCS file: /cvsroot/src/sys/arch/atari/atari/intr.c,v
retrieving revision 1.14
diff -u -r1.14 intr.c
--- atari/atari/intr.c  28 Apr 2008 20:23:14 -0000      1.14
+++ atari/atari/intr.c  23 Jun 2008 04:12:30 -0000
@@ -326,20 +326,13 @@
        return idepth != 0;
 }
 
-static const int ipl2psl_table[] = {
-       [IPL_NONE]       = PSL_IPL0,
-       [IPL_SOFTCLOCK]  = PSL_IPL1,
-       [IPL_SOFTBIO]    = PSL_IPL1,
-       [IPL_SOFTNET]    = PSL_IPL1,
-       [IPL_SOFTSERIAL] = PSL_IPL1,
-       [IPL_VM]         = PSL_IPL4,
-       [IPL_SCHED]      = PSL_IPL6,
-       [IPL_HIGH]       = PSL_IPL7,
+const uint16_t ipl2psl_table[NIPL] = {
+       [IPL_NONE]       = PSL_S | PSL_IPL0,
+       [IPL_SOFTCLOCK]  = PSL_S | PSL_IPL1,
+       [IPL_SOFTBIO]    = PSL_S | PSL_IPL1,
+       [IPL_SOFTNET]    = PSL_S | PSL_IPL1,
+       [IPL_SOFTSERIAL] = PSL_S | PSL_IPL1,
+       [IPL_VM]         = PSL_S | PSL_IPL4,
+       [IPL_SCHED]      = PSL_S | PSL_IPL6,
+       [IPL_HIGH]       = PSL_S | PSL_IPL7,
 };
-
-ipl_cookie_t
-makeiplcookie(ipl_t ipl)
-{
-
-       return (ipl_cookie_t){._psl = ipl2psl_table[ipl] | PSL_S};
-}
Index: atari/include/intr.h
===================================================================
RCS file: /cvsroot/src/sys/arch/atari/include/intr.h,v
retrieving revision 1.17
diff -u -r1.17 intr.h
--- atari/include/intr.h        28 Apr 2008 20:23:15 -0000      1.17
+++ atari/include/intr.h        23 Jun 2008 04:12:30 -0000
@@ -64,12 +64,19 @@
 #ifdef _KERNEL
 int spl0 __P((void));
 
+extern const uint16_t ipl2psl_table[NIPL];
+
 typedef int ipl_t;
 typedef struct {
        uint16_t _psl;
 } ipl_cookie_t;
 
-ipl_cookie_t makeiplcookie(ipl_t);
+static inline ipl_cookie_t
+makeiplcookie(ipl_t ipl)
+{
+
+       return (ipl_cookie_t){._psl = ipl2psl_table[ipl]};
+}
 
 static inline int
 splraiseipl(ipl_cookie_t icookie)
Index: next68k/include/intr.h
===================================================================
RCS file: /cvsroot/src/sys/arch/next68k/include/intr.h,v
retrieving revision 1.20
diff -u -r1.20 intr.h
--- next68k/include/intr.h      3 Dec 2007 15:34:06 -0000       1.20
+++ next68k/include/intr.h      23 Jun 2008 04:12:31 -0000
@@ -61,17 +61,22 @@
 #define        IPL_SOFTSERIAL  4
 #define        IPL_VM          5
 #define        IPL_SCHED       6
-#define        IPL_HIGH        6
-#define        NIPL            7
+#define        IPL_HIGH        7
+#define        NIPL            8
+
+extern const uint16_t ipl2psl_table[NIPL];
 
 typedef int ipl_t;
 typedef struct {
        uint16_t _psl;
 } ipl_cookie_t;
 
-extern const int ipl2psl_table[NIPL];
+static inline ipl_cookie_t
+makeiplcookie(ipl_t ipl)
+{
 
-ipl_cookie_t makeiplcookie(ipl_t);
+       return (ipl_cookie_t){._psl = ipl2psl_table[ipl]};
+}
 
 static inline int
 splraiseipl(ipl_cookie_t icookie)
Index: next68k/next68k/isr.c
===================================================================
RCS file: /cvsroot/src/sys/arch/next68k/next68k/isr.c,v
retrieving revision 1.25
diff -u -r1.25 isr.c
--- next68k/next68k/isr.c       28 Apr 2008 20:23:30 -0000      1.25
+++ next68k/next68k/isr.c       23 Jun 2008 04:12:31 -0000
@@ -400,19 +400,13 @@
 }
 #endif
 
-const int ipl2psl_table[NIPL] = {
-       [IPL_NONE]       = PSL_IPL0,
-       [IPL_SOFTCLOCK]  = PSL_IPL1,
-       [IPL_SOFTNET]    = PSL_IPL1,
-       [IPL_SOFTSERIAL] = PSL_IPL1,
-       [IPL_SOFTBIO]    = PSL_IPL1,
-       [IPL_VM]         = PSL_IPL6,
-       [IPL_SCHED]      = PSL_IPL7,
+const uint16_t ipl2psl_table[NIPL] = {
+       [IPL_NONE]       = PSL_S | PSL_IPL0,
+       [IPL_SOFTCLOCK]  = PSL_S | PSL_IPL1,
+       [IPL_SOFTNET]    = PSL_S | PSL_IPL1,
+       [IPL_SOFTSERIAL] = PSL_S | PSL_IPL1,
+       [IPL_SOFTBIO]    = PSL_S | PSL_IPL1,
+       [IPL_VM]         = PSL_S | PSL_IPL6,
+       [IPL_SCHED]      = PSL_S | PSL_IPL7,
+       [IPL_HIGH]       = PSL_S | PSL_IPL7,
 };
-
-ipl_cookie_t
-makeiplcookie(ipl_t ipl)
-{
-
-       return (ipl_cookie_t){._psl = ipl2psl_table[ipl] | PSL_S};
-}
Index: mvme68k/include/intr.h
===================================================================
RCS file: /cvsroot/src/sys/arch/mvme68k/include/intr.h,v
retrieving revision 1.18
diff -u -r1.18 intr.h
--- mvme68k/include/intr.h      28 Apr 2008 20:23:29 -0000      1.18
+++ mvme68k/include/intr.h      23 Jun 2008 04:12:31 -0000
@@ -36,13 +36,14 @@
 #include <machine/psl.h>
 
 #define        IPL_NONE        0       /* disable only this interrupt */
-#define        IPL_SOFTCLOCK   2       /* clock software interrupts */
-#define        IPL_SOFTBIO     1       /* block software interrupts */
+#define        IPL_SOFTCLOCK   1       /* clock software interrupts */
+#define        IPL_SOFTBIO     2       /* block software interrupts */
 #define        IPL_SOFTNET     3       /* network software interrupts */
 #define        IPL_SOFTSERIAL  4       /* serial software interrupts */
 #define        IPL_VM          5
 #define        IPL_SCHED       6
-#define        IPL_HIGH        6
+#define        IPL_HIGH        7
+#define        NIPL            8
 
 #ifdef _KERNEL
 #define spl0()                 _spl0()
@@ -56,12 +57,19 @@
 
 #ifndef _LOCORE
 
+extern const uint16_t ipl2psl_table[NIPL];
+
 typedef int ipl_t;
 typedef struct {
        uint16_t _psl;
 } ipl_cookie_t;
 
-ipl_cookie_t makeiplcookie(ipl_t);
+static inline ipl_cookie_t
+makeiplcookie(ipl_t ipl)
+{
+
+       return (ipl_cookie_t){._psl = ipl2psl_table[ipl]};
+}
 
 static inline int
 splraiseipl(ipl_cookie_t icookie)
Index: mvme68k/mvme68k/machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mvme68k/mvme68k/machdep.c,v
retrieving revision 1.127
diff -u -r1.127 machdep.c
--- mvme68k/mvme68k/machdep.c   12 Jan 2008 09:54:29 -0000      1.127
+++ mvme68k/mvme68k/machdep.c   23 Jun 2008 04:12:31 -0000
@@ -1177,19 +1177,13 @@
     return ENOEXEC;
 }
 
-const static int ipl2psl_table[] = {
-       [IPL_NONE] = PSL_IPL0,
-       [IPL_SOFTBIO] = PSL_IPL1,
-       [IPL_SOFTCLOCK] = PSL_IPL1,
-       [IPL_SOFTNET] = PSL_IPL1,
-       [IPL_SOFTSERIAL] = PSL_IPL1,
-       [IPL_VM] = PSL_IPL3,
-       [IPL_SCHED] = PSL_IPL7,
+const uint16_t ipl2psl_table[NIPL] = {
+       [IPL_NONE]       = PSL_S | PSL_IPL0,
+       [IPL_SOFTCLOCK]  = PSL_S | PSL_IPL1,
+       [IPL_SOFTBIO]    = PSL_S | PSL_IPL1,
+       [IPL_SOFTNET]    = PSL_S | PSL_IPL1,
+       [IPL_SOFTSERIAL] = PSL_S | PSL_IPL1,
+       [IPL_VM]         = PSL_S | PSL_IPL3,
+       [IPL_SCHED]      = PSL_S | PSL_IPL7,
+       [IPL_HIGH]       = PSL_S | PSL_IPL7,
 };
-
-ipl_cookie_t
-makeiplcookie(ipl_t ipl)
-{
-
-       return (ipl_cookie_t){._psl = ipl2psl_table[ipl] | PSL_S};
-}
---
Tetsuya Isaki <isaki%pastel-flower.jp@localhost / isaki%NetBSD.org@localhost>


Home | Main Index | Thread Index | Old Index