diff options
author | jake <jake@FreeBSD.org> | 2001-01-21 19:25:07 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2001-01-21 19:25:07 +0000 |
commit | 937122ae6dc02a639d13dd06132201548bd7364f (patch) | |
tree | 75b59a2832d9f622680ddf91bb405ee9b1f761d4 /sys/dev | |
parent | d326c51b74ea24afabc190774a1b7721c3e6d1e8 (diff) | |
download | FreeBSD-src-937122ae6dc02a639d13dd06132201548bd7364f.zip FreeBSD-src-937122ae6dc02a639d13dd06132201548bd7364f.tar.gz |
Make intr_nesting_level per-process, rather than per-cpu. Setup
interrupt threads to run with it always >= 1, so that malloc can
detect M_WAITOK from "interrupt" context. This is also necessary
in order to context switch from sched_ithd() directly.
Reviewed By: peter
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/usb/ohci.c | 2 | ||||
-rw-r--r-- | sys/dev/usb/uhci.c | 2 | ||||
-rw-r--r-- | sys/dev/usb/usbdi.c | 2 | ||||
-rw-r--r-- | sys/dev/vinum/vinumhdr.h | 2 | ||||
-rw-r--r-- | sys/dev/vinum/vinummemory.c | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c index c9062a4..c2abcd8 100644 --- a/sys/dev/usb/ohci.c +++ b/sys/dev/usb/ohci.c @@ -1889,7 +1889,7 @@ ohci_abort_xfer(xfer, status) timeout(ohci_abort_xfer_end, xfer, hz / USB_FRAMES_PER_SECOND); } else { #if defined(DIAGNOSTIC) && defined(__i386__) && defined(__FreeBSD__) - KASSERT(PCPU_GET(intr_nesting_level) == 0, + KASSERT(curproc->p_intr_nesting_level == 0, ("ohci_abort_req in interrupt context")); #endif usb_delay_ms(opipe->pipe.device->bus, 1); diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c index 7098db1..1628268 100644 --- a/sys/dev/usb/uhci.c +++ b/sys/dev/usb/uhci.c @@ -1610,7 +1610,7 @@ uhci_abort_xfer(usbd_xfer_handle xfer, usbd_status status) timeout(uhci_abort_xfer_end, xfer, hz / USB_FRAMES_PER_SECOND); } else { #if defined(DIAGNOSTIC) && defined(__i386__) && defined(__FreeBSD__) - KASSERT(PCPU_GET(intr_nesting_level) == 0, + KASSERT(curproc->p_intr_nesting_level == 0, ("ohci_abort_req in interrupt context")); #endif usb_delay_ms(xfer->pipe->device->bus, 1); diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c index c39a856..6203e8a 100644 --- a/sys/dev/usb/usbdi.c +++ b/sys/dev/usb/usbdi.c @@ -931,7 +931,7 @@ usbd_do_request_flags(dev, req, data, flags, actlen) #ifdef DIAGNOSTIC #if defined(__i386__) && defined(__FreeBSD__) - KASSERT(PCPU_GET(intr_nesting_level) == 0, + KASSERT(curproc->p_intr_nesting_level == 0, ("usbd_do_request: in interrupt context")); #endif if (dev->bus->intr_context) { diff --git a/sys/dev/vinum/vinumhdr.h b/sys/dev/vinum/vinumhdr.h index 8a5f70e..2b7d290 100644 --- a/sys/dev/vinum/vinumhdr.h +++ b/sys/dev/vinum/vinumhdr.h @@ -87,7 +87,7 @@ void FFree (void *mem, char *, int); #define LOCKDRIVE(d) lockdrive (d, __FILE__, __LINE__) #else #define Malloc(x) malloc((x), M_DEVBUF, \ - PCPU_GET(intr_nesting_level) == 0? M_WAITOK: M_NOWAIT) + curproc->p_intr_nesting_level == 0? M_WAITOK: M_NOWAIT) #define Free(x) free((x), M_DEVBUF) #define LOCKDRIVE(d) lockdrive (d) #endif diff --git a/sys/dev/vinum/vinummemory.c b/sys/dev/vinum/vinummemory.c index e28f7ae..58eea67 100644 --- a/sys/dev/vinum/vinummemory.c +++ b/sys/dev/vinum/vinummemory.c @@ -151,7 +151,7 @@ MMalloc(int size, char *file, int line) return 0; /* can't continue */ } /* Wait for malloc if we can */ - result = malloc(size, M_DEVBUF, PCPU_GET(intr_nesting_level) == 0 ? M_WAITOK : M_NOWAIT); + result = malloc(size, M_DEVBUF, curproc->p_intr_nesting_level == 0 ? M_WAITOK : M_NOWAIT); if (result == NULL) log(LOG_ERR, "vinum: can't allocate %d bytes from %s:%d\n", size, file, line); else { |