From owner-svn-src-projects@FreeBSD.ORG Fri Oct 4 01:42:28 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C578016A; Fri, 4 Oct 2013 01:42:28 +0000 (UTC) (envelope-from cherry@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 B2A552CB1; Fri, 4 Oct 2013 01:42:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r941gSeo074365; Fri, 4 Oct 2013 01:42:28 GMT (envelope-from cherry@svn.freebsd.org) Received: (from cherry@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r941gS0Y074362; Fri, 4 Oct 2013 01:42:28 GMT (envelope-from cherry@svn.freebsd.org) Message-Id: <201310040142.r941gS0Y074362@svn.freebsd.org> From: "Cherry G. Mathew" Date: Fri, 4 Oct 2013 01:42:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r256036 - in projects/amd64_xen_pv/sys: amd64/include amd64/xen conf X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Oct 2013 01:42:28 -0000 Author: cherry Date: Fri Oct 4 01:42:27 2013 New Revision: 256036 URL: http://svnweb.freebsd.org/changeset/base/256036 Log: Glue in cpu enumeration without -DSMP. This is a shim for until we get an MP build for amd64 pv. Approved by: gibbs(implicit) Modified: projects/amd64_xen_pv/sys/amd64/include/smp.h projects/amd64_xen_pv/sys/amd64/xen/machdep.c projects/amd64_xen_pv/sys/conf/files.amd64 Modified: projects/amd64_xen_pv/sys/amd64/include/smp.h ============================================================================== --- projects/amd64_xen_pv/sys/amd64/include/smp.h Fri Oct 4 01:39:20 2013 (r256035) +++ projects/amd64_xen_pv/sys/amd64/include/smp.h Fri Oct 4 01:42:27 2013 (r256036) @@ -90,5 +90,10 @@ void smp_masked_invltlb(cpuset_t mask, s #endif /* !LOCORE */ #endif /* SMP */ +#ifdef XEN +/* XXX: shim - remove when we get -D SMP */ +void cpu_add(u_int apic_id, char boot_cpu); +#endif + #endif /* _KERNEL */ #endif /* _MACHINE_SMP_H_ */ Modified: projects/amd64_xen_pv/sys/amd64/xen/machdep.c ============================================================================== --- projects/amd64_xen_pv/sys/amd64/xen/machdep.c Fri Oct 4 01:39:20 2013 (r256035) +++ projects/amd64_xen_pv/sys/amd64/xen/machdep.c Fri Oct 4 01:42:27 2013 (r256036) @@ -88,6 +88,7 @@ #include #include #include +#include #include #include @@ -859,6 +860,56 @@ cpu_pcpu_init(struct pcpu *pcpu, int cpu pcpu->pc_acpi_id = 0xffffffff; } +/* XXX: Delete when we get mp_machdep.c */ +/* Dummy defines to get x86/x86/local_apic.c to link. */ +int Xspuriousint, Xtimerint, Xerrorint, Xcmcint, Xapic_isr1; +int Xapic_isr2, Xapic_isr3, Xapic_isr4, Xapic_isr5; +int Xapic_isr6, Xapic_isr7; +int cmc_intr; + +void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int ist) +{ +} + + +struct cpu_info { + int cpu_present:1; + int cpu_bsp:1; + int cpu_disabled:1; +}; + +/* We don't want to #include MAX_APIC_ID) { + panic("SMP: APIC ID %d too high", apic_id); + return; + } + KASSERT(cpu_info[apic_id].cpu_present == 0, ("CPU %d added twice", + apic_id)); + cpu_info[apic_id].cpu_present = 1; + if (boot_cpu) { + KASSERT(boot_cpu_id == -1, + ("CPU %d claims to be BSP, but CPU %d already is", apic_id, + boot_cpu_id)); + boot_cpu_id = apic_id; + cpu_info[apic_id].cpu_bsp = 1; + } + if (mp_ncpus < MAXCPU) + mp_ncpus++; + if (bootverbose) + printf("SMP: Added CPU %d (%s)\n", apic_id, boot_cpu ? "BSP" : + "AP"); +} +/* Delete when we get mp_machdep.c : XXX*/ + void spinlock_enter(void) { Modified: projects/amd64_xen_pv/sys/conf/files.amd64 ============================================================================== --- projects/amd64_xen_pv/sys/conf/files.amd64 Fri Oct 4 01:39:20 2013 (r256035) +++ projects/amd64_xen_pv/sys/conf/files.amd64 Fri Oct 4 01:42:27 2013 (r256036) @@ -557,7 +557,7 @@ x86/x86/fdt_machdep.c optional fdt x86/x86/intr_machdep.c standard x86/x86/io_apic.c optional native x86/x86/legacy.c optional native -x86/x86/local_apic.c optional native +x86/x86/local_apic.c standard x86/x86/mca.c optional native x86/x86/mptable.c optional native mptable x86/x86/mptable_pci.c optional native mptable pci