diff options
author | peter <peter@FreeBSD.org> | 2003-05-22 20:09:50 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2003-05-22 20:09:50 +0000 |
commit | eb87db7a61e5671b0b789bee7cd3d1da818b1a24 (patch) | |
tree | 963f7b6aa700eb48b96e8cd80cb98802a50a4a21 /sys/amd64 | |
parent | 3a541607e82fc56a24d00bce842250d57891c35e (diff) | |
download | FreeBSD-src-eb87db7a61e5671b0b789bee7cd3d1da818b1a24.zip FreeBSD-src-eb87db7a61e5671b0b789bee7cd3d1da818b1a24.tar.gz |
Merge from i386/trap.c rev 1.252. Use td_critnest instead of the
spinlocks count for explicitly enabling interrupts.
Approved by: re (blanket)
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/trap.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 1abab3b..bc69e42 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -39,7 +39,7 @@ */ /* - * 386 Trap and System call handling + * AMD64 Trap and System call handling */ #include "opt_clock.h" @@ -194,10 +194,10 @@ trap(frame) printf("kernel trap %d with interrupts disabled\n", type); /* - * We shouldn't enable interrupts while holding a - * spin lock. + * We shouldn't enable interrupts while in a critical + * section. */ - if (PCPU_GET(spinlocks) == NULL) + if (td->td_critnest == 0) enable_intr(); } } @@ -205,14 +205,14 @@ trap(frame) code = frame.tf_err; if (type == T_PAGEFLT) { /* - * If we get a page fault while holding a spin lock, then + * If we get a page fault while in a critical section, then * it is most likely a fatal kernel page fault. The kernel * is already going to panic trying to get a sleep lock to * do the VM lookup, so just consider it a fatal trap so the * kernel can print out a useful trap message and even get * to the debugger. */ - if (PCPU_GET(spinlocks) != NULL) + if (td->td_critnest == 0) trap_fatal(&frame, frame.tf_addr); } |