mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-16 21:34:10 +00:00
o) When trying to determine whether the pcpu pointer is a managed address, check
not just that it is greater than the minimal kernel virtual address, but also that it is less than the maximal kernel virtual address. On n64 kernels, the pcpup comes out of a direct-mapped address that, with an unsigned compare, is rather greater than the minimal kernel virtual address. o) Turn the panic if interrupts are disabled in cpu_idle into a KASSERT since on other architectures it's behind INVARIANTS anyway. o) Add a check that not all interrupts are masked, too. o) Add cpu_idleclock() and cpu_activeclock() use to cpu_idle as is done on other architectures.
This commit is contained in:
parent
5cc703974c
commit
5610751bf1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216862
|
@ -426,8 +426,10 @@ cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t size)
|
|||
pcpu->pc_next_asid = 1;
|
||||
pcpu->pc_asid_generation = 1;
|
||||
#ifdef SMP
|
||||
if ((vm_offset_t)pcpup >= VM_MIN_KERNEL_ADDRESS)
|
||||
if ((vm_offset_t)pcpup >= VM_MIN_KERNEL_ADDRESS &&
|
||||
(vm_offset_t)pcpup <= VM_MAX_KERNEL_ADDRESS) {
|
||||
mips_pcpu_tlb_init(pcpu);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -483,10 +485,20 @@ spinlock_exit(void)
|
|||
void
|
||||
cpu_idle(int busy)
|
||||
{
|
||||
if (mips_rd_status() & MIPS_SR_INT_IE)
|
||||
__asm __volatile ("wait");
|
||||
else
|
||||
panic("ints disabled in idleproc!");
|
||||
KASSERT((mips_rd_status() & MIPS_SR_INT_IE) != 0,
|
||||
("interrupts disabled in idle process."));
|
||||
KASSERT((mips_rd_status() & MIPS_INT_MASK) != 0,
|
||||
("all interrupts masked in idle process."));
|
||||
|
||||
if (!busy) {
|
||||
critical_enter();
|
||||
cpu_idleclock();
|
||||
}
|
||||
__asm __volatile ("wait");
|
||||
if (!busy) {
|
||||
cpu_activeclock();
|
||||
critical_exit();
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
|
|
Loading…
Reference in a new issue