replace PCPU_GET(cpuid) with curcpu and PCPU_GET(curthread) with curthread
This commit is contained in:
parent
95473f3b86
commit
4cb380a33e
@ -395,8 +395,8 @@ cpu_mp_bootstrap(struct pcpu *pc)
|
||||
|
||||
smp_cpus++;
|
||||
KASSERT(curthread != NULL, ("cpu_mp_bootstrap: curthread"));
|
||||
PCPU_SET(other_cpus, all_cpus & ~(1 << PCPU_GET(cpuid)));
|
||||
printf("AP: #%d\n", PCPU_GET(cpuid));
|
||||
PCPU_SET(other_cpus, all_cpus & ~(1 << curcpu));
|
||||
printf("AP: #%d\n", curcpu);
|
||||
csa->csa_count--;
|
||||
membar(StoreLoad);
|
||||
csa->csa_state = CPU_BOOTSTRAP;
|
||||
@ -442,8 +442,8 @@ void
|
||||
cpu_ipi_stop(struct trapframe *tf)
|
||||
{
|
||||
|
||||
CTR1(KTR_SMP, "cpu_ipi_stop: stopped %d", PCPU_GET(cpuid));
|
||||
savectx(&stoppcbs[PCPU_GET(cpuid)]);
|
||||
CTR1(KTR_SMP, "cpu_ipi_stop: stopped %d", curcpu);
|
||||
savectx(&stoppcbs[curcpu]);
|
||||
atomic_set_acq_int(&stopped_cpus, PCPU_GET(cpumask));
|
||||
while ((started_cpus & PCPU_GET(cpumask)) == 0) {
|
||||
if ((shutdown_cpus & PCPU_GET(cpumask)) != 0) {
|
||||
@ -452,7 +452,7 @@ cpu_ipi_stop(struct trapframe *tf)
|
||||
}
|
||||
atomic_clear_rel_int(&started_cpus, PCPU_GET(cpumask));
|
||||
atomic_clear_rel_int(&stopped_cpus, PCPU_GET(cpumask));
|
||||
CTR1(KTR_SMP, "cpu_ipi_stop: restarted %d", PCPU_GET(cpuid));
|
||||
CTR1(KTR_SMP, "cpu_ipi_stop: restarted %d", curcpu);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -88,7 +88,7 @@ static __inline void
|
||||
tick_process(struct trapframe *tf)
|
||||
{
|
||||
|
||||
if (PCPU_GET(cpuid) == 0)
|
||||
if (curcpu == 0)
|
||||
hardclock(TRAPF_USERMODE(tf), TRAPF_PC(tf));
|
||||
else
|
||||
hardclock_cpu(TRAPF_USERMODE(tf));
|
||||
@ -177,7 +177,7 @@ tick_start(void)
|
||||
{
|
||||
u_long base, s;
|
||||
|
||||
if (PCPU_GET(cpuid) == 0)
|
||||
if (curcpu == 0)
|
||||
intr_setup(PIL_TICK, tick_hardclock, -1, NULL, NULL);
|
||||
|
||||
/*
|
||||
|
@ -245,7 +245,7 @@ trap_init(void)
|
||||
vm_paddr_t mmfsa;
|
||||
int i;
|
||||
|
||||
mmfsa = mmu_fault_status_area + (MMFSA_SIZE*PCPU_GET(cpuid));
|
||||
mmfsa = mmu_fault_status_area + (MMFSA_SIZE*curcpu);
|
||||
set_wstate(WSTATE_KERN);
|
||||
set_mmfsa_scratchpad(mmfsa);
|
||||
|
||||
@ -276,7 +276,7 @@ trap(struct trapframe *tf, int64_t type, uint64_t data)
|
||||
register_t addr;
|
||||
ksiginfo_t ksi;
|
||||
|
||||
td = PCPU_GET(curthread);
|
||||
td = curthread;
|
||||
|
||||
CTR4(KTR_TRAP, "trap: %p type=%s (%s) pil=%#lx", td,
|
||||
trap_msg[trapno],
|
||||
@ -474,7 +474,7 @@ trap_pfault(struct thread *td, struct trapframe *tf, int64_t type, uint64_t data
|
||||
|
||||
#if 0
|
||||
CTR4(KTR_TRAP, "trap_pfault: td=%p pm_ctx=%#lx va=%#lx ctx=%#lx",
|
||||
td, p->p_vmspace->vm_pmap.pm_context[PCPU_GET(cpuid)], va, ctx);
|
||||
td, p->p_vmspace->vm_pmap.pm_context, va, ctx);
|
||||
#endif
|
||||
KASSERT(td->td_pcb != NULL, ("trap_pfault: pcb NULL"));
|
||||
KASSERT(td->td_proc != NULL, ("trap_pfault: curproc NULL"));
|
||||
@ -583,7 +583,7 @@ syscall(struct trapframe *tf)
|
||||
int narg;
|
||||
int error;
|
||||
|
||||
td = PCPU_GET(curthread);
|
||||
td = curthread;
|
||||
KASSERT(td != NULL, ("trap: curthread NULL"));
|
||||
KASSERT(td->td_proc != NULL, ("trap: curproc NULL"));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user