Subject: kernel DELAY() and interrupts
To: None <port-i386@NetBSD.ORG>
From: Matthias Drochner <drochner@zelux6.zel.kfa-juelich.de>
List: port-i386
Date: 02/03/1998 21:01:58
There are some pieces which don't fit well
together in the i386 port (or: I don't understand
them):
The DELAY() or delay() function cannot be used
before startrtclock() is called (from the beginning of
configure()). That's obvious - the timer registers
are not necessarily set up at this point. This affects
basically the console drivers. (It could be improved,
but this is not my point.)
The strange thing is that delay() calls "gettick()"
(in isa/clock.c) which enables interrupts as a side
effect. This means it shouldn't be called in device
probe / attach at all (or stray interrupts will occur).
This looks more like a bug to me (which would be easy
to fix - use kind of pushfl - popfl). Or is it considered
normal that interrupts are enabled during autoconfi-
guration as long as no device interrupt handler is called?
(There was an "interrupt autodetection" feature for
ISA devices in former times.)
Can anybody explain what a device driver can rely on?

best regards
Matthias