Port-m68k archive

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

Re: diffs around makeiplcookie()



(I added Cc: to port-atari@)

At Wed, 25 Jun 2008 23:27:55 +0900,
Izumi Tsutsui wrote:
> > Here is a patch for atari, next68k, mvme68k.
> > These are compiled but not tested.
> 
> next68k and mvme68k look okay.

Thank you. I've commited.

> For atari, maybe we should see if there are some opinions
> abount current implementation on port-atari.

According to opinions on port-atari@,
how about this?

Index: 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/intr.c        28 Apr 2008 20:23:14 -0000      1.14
+++ atari/intr.c        26 Jun 2008 03:13:05 -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: include/intr.h
===================================================================
RCS file: /cvsroot/src/sys/arch/atari/include/intr.h,v
retrieving revision 1.17
diff -u -r1.17 intr.h
--- include/intr.h      28 Apr 2008 20:23:15 -0000      1.17
+++ include/intr.h      26 Jun 2008 03:13:05 -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: vme/if_le_vme.c
===================================================================
RCS file: /cvsroot/src/sys/arch/atari/vme/if_le_vme.c,v
retrieving revision 1.23
diff -u -r1.23 if_le_vme.c
--- vme/if_le_vme.c     4 Apr 2008 12:25:06 -0000       1.23
+++ vme/if_le_vme.c     26 Jun 2008 03:13:05 -0000
@@ -324,7 +324,7 @@
        struct lance_softc      *sc = &lesc->sc_am7990.lsc;
        uint16_t                csr0;
 
-       if ((sr & PSL_IPL) < (IPL_NET & PSL_IPL))
+       if ((sr & PSL_IPL) < (ipl2psl_table[IPL_NET] & PSL_IPL))
                am7990_intr(sc);
        else {
                sc->sc_saved_csr0 = csr0 = lerdcsr(sc, LE_CSR0);
---
Tetsuya Isaki <isaki%pastel-flower.jp@localhost / isaki%NetBSD.org@localhost>


Home | Main Index | Thread Index | Old Index