From owner-svn-src-head@FreeBSD.ORG Mon Sep 9 12:49:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5CFB3FD9; Mon, 9 Sep 2013 12:49:20 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 301E321E2; Mon, 9 Sep 2013 12:49:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r89CnKnX021357; Mon, 9 Sep 2013 12:49:20 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r89CnJgU021353; Mon, 9 Sep 2013 12:49:19 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201309091249.r89CnJgU021353@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 9 Sep 2013 12:49:19 +0000 (UTC) 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 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2013 12:49:20 -0000 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 {