summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2006-12-17 01:31:56 +0000
committerkmacy <kmacy@FreeBSD.org>2006-12-17 01:31:56 +0000
commit4cb380a33e5a8705671c98ae7c29653c74c5a58a (patch)
tree7826fd014d43cc755584a30b985c250356e5dfa9
parent95473f3b865bcc6d4732108dc401db69509651b2 (diff)
downloadFreeBSD-src-4cb380a33e5a8705671c98ae7c29653c74c5a58a.zip
FreeBSD-src-4cb380a33e5a8705671c98ae7c29653c74c5a58a.tar.gz
replace PCPU_GET(cpuid) with curcpu and PCPU_GET(curthread) with curthread
-rw-r--r--sys/sun4v/sun4v/mp_machdep.c10
-rw-r--r--sys/sun4v/sun4v/tick.c4
-rw-r--r--sys/sun4v/sun4v/trap.c8
3 files changed, 11 insertions, 11 deletions
diff --git a/sys/sun4v/sun4v/mp_machdep.c b/sys/sun4v/sun4v/mp_machdep.c
index 01756d6..d3cea9d 100644
--- a/sys/sun4v/sun4v/mp_machdep.c
+++ b/sys/sun4v/sun4v/mp_machdep.c
@@ -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
diff --git a/sys/sun4v/sun4v/tick.c b/sys/sun4v/sun4v/tick.c
index 0f0e1aa..4d91899 100644
--- a/sys/sun4v/sun4v/tick.c
+++ b/sys/sun4v/sun4v/tick.c
@@ -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);
/*
diff --git a/sys/sun4v/sun4v/trap.c b/sys/sun4v/sun4v/trap.c
index c8a5f38..2698813 100644
--- a/sys/sun4v/sun4v/trap.c
+++ b/sys/sun4v/sun4v/trap.c
@@ -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"));
OpenPOWER on IntegriCloud