mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Add hook called when every new processor is brought online -- including the
BSP -- so that platform modules have a chance to add the new CPU to any internal bookkeeping. Approved by: re (kib)
This commit is contained in:
parent
e52f055d23
commit
0658fe8ce1
4 changed files with 22 additions and 0 deletions
|
|
@ -52,6 +52,7 @@ int platform_smp_first_cpu(struct cpuref *);
|
|||
int platform_smp_next_cpu(struct cpuref *);
|
||||
int platform_smp_get_bsp(struct cpuref *);
|
||||
int platform_smp_start_cpu(struct pcpu *);
|
||||
void platform_smp_ap_init(void);
|
||||
|
||||
const char *installed_platform(void);
|
||||
void platform_probe_and_attach(void);
|
||||
|
|
|
|||
|
|
@ -91,6 +91,9 @@ machdep_ap_bootstrap(void)
|
|||
#endif
|
||||
decr_ap_init();
|
||||
|
||||
/* Give platform code a chance to do anything necessary */
|
||||
platform_smp_ap_init();
|
||||
|
||||
/* Serialize console output and AP count increment */
|
||||
mtx_lock_spin(&ap_boot_mtx);
|
||||
ap_awake++;
|
||||
|
|
|
|||
|
|
@ -141,6 +141,12 @@ platform_smp_start_cpu(struct pcpu *cpu)
|
|||
return (PLATFORM_SMP_START_CPU(plat_obj, cpu));
|
||||
}
|
||||
|
||||
void
|
||||
platform_smp_ap_init()
|
||||
{
|
||||
PLATFORM_SMP_AP_INIT(plat_obj);
|
||||
}
|
||||
|
||||
#ifdef SMP
|
||||
struct cpu_group *
|
||||
cpu_topo(void)
|
||||
|
|
|
|||
|
|
@ -80,6 +80,10 @@ CODE {
|
|||
{
|
||||
return (VM_MAX_ADDRESS);
|
||||
}
|
||||
static void platform_null_smp_ap_init(platform_t plat)
|
||||
{
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -184,6 +188,14 @@ METHOD int smp_start_cpu {
|
|||
struct pcpu *_cpu;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Start a CPU
|
||||
*
|
||||
*/
|
||||
METHOD void smp_ap_init {
|
||||
platform_t _plat;
|
||||
} DEFAULT platform_null_smp_ap_init;
|
||||
|
||||
/**
|
||||
* @brief Return SMP topology
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue