Port-m68k archive

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

Re: diffs around makeiplcookie()



I wrote:

> isaki%pastel-flower.jp@localhost wrote:
> 
> > 3) According to the discussion before
> >    (http://mail-index.netbsd.org/tech-kern/2006/07/01/0000.html
> >    by yamt-san and tsutsui-san),  The conversion by ipl2XXX_table[]
> >    should be in makeiplcookie() than splraiseipl() ?
> > 
> >     used in makeiplcookie(): atari, luna68k, hp300, mvme68k,
> >                              news68k, next68k, sun68k, x68k
> >     used in splraiseipl():   amiga, cesfic, mac68k
> 
> Ah, now I realize why ipl2XXX_table[] is used in splraiseipl()
> in those ports.
> 
> If ipl2XXX_table[] could be updated during cpu_configure(9),
> we can't use an ipl2XXX_table[IPL_FOO] value as a cookie
> because it could have a different value after cpu_configure(9)
> if makeiplcookie(9) is called before cpu_configure(9).
 :
> On mac68k, ipl2psl_table[] is initialized in machdep.c:mac68k_init()
> so it may be safe.

After some thoughts, ipl2psl_table[] on mac68k could still be
updated during cpu_configure(9), so I'll backout part of my
changes to make makeiplcookie(9) return IPL values, not PSL.
(i.e. we can use PSL bit values as ipl_cookie_t only if
 ipl2psl_table[] is const)

---
Index: arch/mac68k/include/intr.h
===================================================================
RCS file: /cvsroot/src/sys/arch/mac68k/include/intr.h,v
retrieving revision 1.30
diff -u -r1.30 intr.h
--- arch/mac68k/include/intr.h  19 Jun 2008 13:56:22 -0000      1.30
+++ arch/mac68k/include/intr.h  11 Jul 2008 18:51:03 -0000
@@ -67,21 +67,21 @@
 
 typedef int ipl_t;
 typedef struct {
-       uint16_t _psl;
+       uint16_t _ipl;
 } ipl_cookie_t;
 
 static inline ipl_cookie_t
 makeiplcookie(ipl_t ipl)
 {
 
-       return (ipl_cookie_t){._psl = ipl2psl_table[ipl]};
+       return (ipl_cookie_t){._ipl = ipl};
 }
 
 static inline int
 splraiseipl(ipl_cookie_t icookie)
 {
 
-       return _splraise(icookie._psl);
+       return _splraise(ipl2psl_table[icookie._ipl]);
 }
 
 #include <sys/spl.h>
---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index