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.
This commit is contained in:
parent
6d5cb58b5f
commit
0aa31a3393
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=238257
@ -505,6 +505,14 @@ cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t size)
|
||||
pcpu->pc_acpi_id = 0xffffffff;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
@ -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);
|
||||
|
||||
/*
|
||||
|
@ -309,8 +309,7 @@ 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);
|
||||
}
|
||||
|
@ -61,6 +61,7 @@ ia64_bsp_adjust(uint64_t bsp, int nslots)
|
||||
#ifdef _KERNEL
|
||||
|
||||
struct _special;
|
||||
struct pcpu;
|
||||
struct thread;
|
||||
struct trapframe;
|
||||
|
||||
@ -80,6 +81,7 @@ void *acpi_find_table(const char *sig);
|
||||
void busdma_swi(void);
|
||||
int copyout_regstack(struct thread *, uint64_t *, uint64_t *);
|
||||
void cpu_mp_add(u_int, u_int, u_int);
|
||||
void cpu_pcpu_setup(struct pcpu *, u_int, u_int);
|
||||
int do_ast(struct trapframe *);
|
||||
void ia32_trap(int, struct trapframe *);
|
||||
int ia64_count_cpus(void);
|
||||
|
Loading…
Reference in New Issue
Block a user