diff options
author | marcel <marcel@FreeBSD.org> | 2012-07-08 18:00:22 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2012-07-08 18:00:22 +0000 |
commit | 070f1b40dee0fd645f5c23ef2e65056284f5e544 (patch) | |
tree | 50a51e53336ff06150ff30aa883b2df99ccb502f /sys/ia64/ia64 | |
parent | bfa21239bc8d06798b0135e51be7bdad2368cad8 (diff) | |
download | FreeBSD-src-070f1b40dee0fd645f5c23ef2e65056284f5e544.zip FreeBSD-src-070f1b40dee0fd645f5c23ef2e65056284f5e544.tar.gz |
Move PCPU initialization to a new function called cpu_pcpu_setup().
This makes it easier to add additional CPU or platform information
to the per-CPU structure without duplicated code.
Diffstat (limited to 'sys/ia64/ia64')
-rw-r--r-- | sys/ia64/ia64/machdep.c | 10 | ||||
-rw-r--r-- | sys/ia64/ia64/mp_machdep.c | 5 |
2 files changed, 11 insertions, 4 deletions
diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index 49a9057..fbc35d1 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -506,6 +506,14 @@ cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t size) } void +cpu_pcpu_setup(struct pcpu *pc, u_int acpi_id, u_int sapic_id) +{ + + pc->pc_acpi_id = acpi_id; + pc->pc_md.lid = IA64_LID_SET_SAPIC_ID(sapic_id); +} + +void spinlock_enter(void) { struct thread *td; @@ -791,7 +799,7 @@ ia64_init(void) ia64_set_k4((u_int64_t)pcpup); pcpu_init(pcpup, 0, sizeof(pcpu0)); dpcpu_init(ia64_physmem_alloc(DPCPU_SIZE, PAGE_SIZE), 0); - PCPU_SET(md.lid, ia64_get_lid()); + cpu_pcpu_setup(pcpup, ~0U, ia64_get_lid()); PCPU_SET(curthread, &thread0); /* diff --git a/sys/ia64/ia64/mp_machdep.c b/sys/ia64/ia64/mp_machdep.c index 77c12b7..8f92460 100644 --- a/sys/ia64/ia64/mp_machdep.c +++ b/sys/ia64/ia64/mp_machdep.c @@ -309,9 +309,8 @@ cpu_mp_add(u_int acpi_id, u_int id, u_int eid) } else pc = pcpup; - pc->pc_acpi_id = acpi_id; - pc->pc_md.lid = IA64_LID_SET_SAPIC_ID(sapic_id); - + cpu_pcpu_setup(pc, acpi_id, sapic_id); + CPU_SET(pc->pc_cpuid, &all_cpus); } |