Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci/bktr Sigh.



details:   https://anonhg.NetBSD.org/src/rev/0998fba578d6
branches:  trunk
changeset: 507201:0998fba578d6
user:      ross <ross%NetBSD.org@localhost>
date:      Fri Mar 16 19:32:35 2001 +0000

description:
Sigh.

Revert the revert. Naturally, I considered OpenBSD and FreeBSD when I fixed
the incorrect use of the spl*() interface. The change I made is _required_
for both NetBSD _and_ OpenBSD, or the code won't even COMPILE except on
i386, and it is acceptable on FreeBSD. Your revert and mod rebroke it on
OpenBSD and tangled things up on NetBSD.  It made no difference on FreeBSD.

In particular, there are 2,895 uses of splx() within the FreeBSD kernel,
and only a mere 21, that's "twenty one" uses of intrmask_t, and those are
almost exclusively in the guts of the interrupt implementation, _not_ in
the _use_ of the exported spl*() functions.  It's perfectly OK to `int s
= spltty()' in a portable driver in FreeBSD.

For that matter, FreeBSD (-current at least) does not even *use* spl*()
any more and stubs them all out with inlines that do _nothing_ except return
0, making intrmask_t vs int _even less_ important there than it already
was.

I think it's great that you want to start hacking on the kernel, but do
note that this is certainly the most simple of the kernel interfaces. It
just gets worse from here. Be careful out there!

diffstat:

 sys/dev/pci/bktr/bktr_os.h |  13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)

diffs (27 lines):

diff -r 03e6c96af510 -r 0998fba578d6 sys/dev/pci/bktr/bktr_os.h
--- a/sys/dev/pci/bktr/bktr_os.h        Fri Mar 16 18:11:57 2001 +0000
+++ b/sys/dev/pci/bktr/bktr_os.h        Fri Mar 16 19:32:35 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bktr_os.h,v 1.4 2001/03/16 15:06:24 wiz Exp $  */
+/*     $NetBSD: bktr_os.h,v 1.5 2001/03/16 19:32:35 ross Exp $ */
 
 /* FreeBSD: src/sys/dev/bktr/bktr_os.h,v 1.4 2000/04/16 07:56:58 roger Exp */
 
@@ -66,17 +66,6 @@
 /************************************/
 /* *** Interrupt Enable/Disable *** */
 /************************************/
-#if defined(__FreeBSD__)
-#define DECLARE_INTR_MASK(s)   intrmask_t s
-#define DISABLE_INTR(s)                s = spltty()
-#define ENABLE_INTR(s)         splx(s)
-#elif defined(__NetBSD__)
 #define DECLARE_INTR_MASK(s)   int s
 #define DISABLE_INTR(s)                s = spltty()
 #define ENABLE_INTR(s)         splx(s)
-#else
-#define DECLARE_INTR_MASK(s)   /* no need to declare 's' */
-#define DISABLE_INTR(s)                disable_intr()
-#define ENABLE_INTR(s)         enable_intr()
-#endif
-



Home | Main Index | Thread Index | Old Index