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.
This commit is contained in:
parent
6bf50f98b1
commit
ab2bf9ff6a
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user