Date: Mon, 9 Sep 2013 12:49:19 +0000 (UTC) From: Nathan Whitehorn <nwhitehorn@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255417 - in head/sys/powerpc: include powerpc Message-ID: <201309091249.r89CnJgU021353@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: nwhitehorn Date: Mon Sep 9 12:49:19 2013 New Revision: 255417 URL: http://svnweb.freebsd.org/changeset/base/255417 Log: 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) Modified: head/sys/powerpc/include/platform.h head/sys/powerpc/powerpc/mp_machdep.c head/sys/powerpc/powerpc/platform.c head/sys/powerpc/powerpc/platform_if.m Modified: head/sys/powerpc/include/platform.h ============================================================================== --- head/sys/powerpc/include/platform.h Mon Sep 9 12:45:41 2013 (r255416) +++ head/sys/powerpc/include/platform.h Mon Sep 9 12:49:19 2013 (r255417) @@ -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); Modified: head/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/mp_machdep.c Mon Sep 9 12:45:41 2013 (r255416) +++ head/sys/powerpc/powerpc/mp_machdep.c Mon Sep 9 12:49:19 2013 (r255417) @@ -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++; Modified: head/sys/powerpc/powerpc/platform.c ============================================================================== --- head/sys/powerpc/powerpc/platform.c Mon Sep 9 12:45:41 2013 (r255416) +++ head/sys/powerpc/powerpc/platform.c Mon Sep 9 12:49:19 2013 (r255417) @@ -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) Modified: head/sys/powerpc/powerpc/platform_if.m ============================================================================== --- head/sys/powerpc/powerpc/platform_if.m Mon Sep 9 12:45:41 2013 (r255416) +++ head/sys/powerpc/powerpc/platform_if.m Mon Sep 9 12:49:19 2013 (r255417) @@ -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 {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309091249.r89CnJgU021353>