summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2004-02-03 06:35:29 +0000
committerbde <bde@FreeBSD.org>2004-02-03 06:35:29 +0000
commit5499170a1210255c5ce193940b542f21618b681d (patch)
tree9076380b592e88594ed8e2f8cefe5d8357a273eb /sys
parentaea62cb1afb02fec29102c23f92b8fd307287e79 (diff)
downloadFreeBSD-src-5499170a1210255c5ce193940b542f21618b681d.zip
FreeBSD-src-5499170a1210255c5ce193940b542f21618b681d.tar.gz
Removed bogus checks that (PCPU_GET(curpcb) != NULL). Rev.1.586 of
machdep.c fixed the missing early initialization of curpcb, so curpcb is now always set together with curthread and it cannot be NULL except before the IDT has been set up (so trap() is unreachable) or after a memory error. In any case, it was often used without checking. curcpb shouldn't exist anyway. It doesn't exist for most non-i386 arches. It just caches curthread->td_pcb in a global. This was a better idea before it was per-cpu. trap() and some other places can get at it more efficiently using td->td_pcb instead of PCPU_GET(curpcb). The main exception is support.s which mostly wants only curpcb->pcb_onfault.
Diffstat (limited to 'sys')
-rw-r--r--sys/i386/i386/trap.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c
index 5c8866a..2a0ae0d 100644
--- a/sys/i386/i386/trap.c
+++ b/sys/i386/i386/trap.c
@@ -505,8 +505,7 @@ trap(frame)
frame.tf_eip = (int)doreti_popl_fs_fault;
goto out;
}
- if (PCPU_GET(curpcb) != NULL &&
- PCPU_GET(curpcb)->pcb_onfault != NULL) {
+ if (PCPU_GET(curpcb)->pcb_onfault != NULL) {
frame.tf_eip =
(int)PCPU_GET(curpcb)->pcb_onfault;
goto out;
@@ -727,7 +726,6 @@ trap_pfault(frame, usermode, eva)
nogo:
if (!usermode) {
if (td->td_intr_nesting_level == 0 &&
- PCPU_GET(curpcb) != NULL &&
PCPU_GET(curpcb)->pcb_onfault != NULL) {
frame->tf_eip = (int)PCPU_GET(curpcb)->pcb_onfault;
return (0);
OpenPOWER on IntegriCloud