diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2013-09-09 12:49:19 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2013-09-09 12:49:19 +0000 |
commit | 40b0e2de83eaed293efb6d1a6202b71aa813e4af (patch) | |
tree | 2be3320476202a4d6b786fcd7355d130c30cf0b2 | |
parent | 9c7a32d39919735caaff636fa621ee0306559f4b (diff) | |
download | FreeBSD-src-40b0e2de83eaed293efb6d1a6202b71aa813e4af.zip FreeBSD-src-40b0e2de83eaed293efb6d1a6202b71aa813e4af.tar.gz |
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)
-rw-r--r-- | sys/powerpc/include/platform.h | 1 | ||||
-rw-r--r-- | sys/powerpc/powerpc/mp_machdep.c | 3 | ||||
-rw-r--r-- | sys/powerpc/powerpc/platform.c | 6 | ||||
-rw-r--r-- | sys/powerpc/powerpc/platform_if.m | 12 |
4 files changed, 22 insertions, 0 deletions
diff --git a/sys/powerpc/include/platform.h b/sys/powerpc/include/platform.h index 48ea0e6..d93088c 100644 --- a/sys/powerpc/include/platform.h +++ b/sys/powerpc/include/platform.h @@ -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); diff --git a/sys/powerpc/powerpc/mp_machdep.c b/sys/powerpc/powerpc/mp_machdep.c index b6d977b..6835d0c 100644 --- a/sys/powerpc/powerpc/mp_machdep.c +++ b/sys/powerpc/powerpc/mp_machdep.c @@ -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++; diff --git a/sys/powerpc/powerpc/platform.c b/sys/powerpc/powerpc/platform.c index 169bbc1..6f7e7b5 100644 --- a/sys/powerpc/powerpc/platform.c +++ b/sys/powerpc/powerpc/platform.c @@ -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) diff --git a/sys/powerpc/powerpc/platform_if.m b/sys/powerpc/powerpc/platform_if.m index 94383c3..cd878e0 100644 --- a/sys/powerpc/powerpc/platform_if.m +++ b/sys/powerpc/powerpc/platform_if.m @@ -80,6 +80,10 @@ CODE { { return (VM_MAX_ADDRESS); } + static void platform_null_smp_ap_init(platform_t plat) + { + return; + } }; /** @@ -185,6 +189,14 @@ METHOD int smp_start_cpu { }; /** + * @brief Start a CPU + * + */ +METHOD void smp_ap_init { + platform_t _plat; +} DEFAULT platform_null_smp_ap_init; + +/** * @brief Return SMP topology */ METHOD cpu_group_t smp_topo { |