From owner-svn-src-stable-8@FreeBSD.ORG Tue Jul 20 20:15:33 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 156DE106566B; Tue, 20 Jul 2010 20:15:33 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 029D88FC13; Tue, 20 Jul 2010 20:15:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6KKFWMn098567; Tue, 20 Jul 2010 20:15:32 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6KKFWFC098562; Tue, 20 Jul 2010 20:15:32 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201007202015.o6KKFWFC098562@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 20 Jul 2010 20:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210315 - in stable/8/sys: amd64/acpica conf dev/acpica modules/acpi/acpi X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2010 20:15:33 -0000 Author: jkim Date: Tue Jul 20 20:15:32 2010 New Revision: 210315 URL: http://svn.freebsd.org/changeset/base/210315 Log: MFC: r209957, r210003, r210005 - Move i386-inherited logic of building ACPI headers for acpi_wakeup.c into better places and remove intermediate makefile and shell scripts. This makes parallel kernel build little bit safer for amd64. - Make SMP code path in acpi.c conditional at run-time. - Define SMP unconditionally for amd64 and remove opt_global.h from SRCS in sys/modules/acpi/acpi/Makefile. Note it is done just for correctness sake because we do not build, ship, or support acpi.ko on amd64. Deleted: stable/8/sys/amd64/acpica/Makefile stable/8/sys/amd64/acpica/genwakecode.sh stable/8/sys/amd64/acpica/genwakedata.sh Modified: stable/8/sys/amd64/acpica/acpi_wakecode.S stable/8/sys/conf/files.amd64 stable/8/sys/dev/acpica/acpi.c stable/8/sys/modules/acpi/acpi/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/acpica/acpi_wakecode.S ============================================================================== --- stable/8/sys/amd64/acpica/acpi_wakecode.S Tue Jul 20 19:43:25 2010 (r210314) +++ stable/8/sys/amd64/acpica/acpi_wakecode.S Tue Jul 20 20:15:32 2010 (r210315) @@ -29,8 +29,6 @@ * $FreeBSD$ */ -#define LOCORE - #include #include Modified: stable/8/sys/conf/files.amd64 ============================================================================== --- stable/8/sys/conf/files.amd64 Tue Jul 20 19:43:25 2010 (r210314) +++ stable/8/sys/conf/files.amd64 Tue Jul 20 20:15:32 2010 (r210315) @@ -70,17 +70,26 @@ hptrr_lib.o optional hptrr \ amd64/acpica/OsdEnvironment.c optional acpi amd64/acpica/acpi_machdep.c optional acpi amd64/acpica/acpi_switch.S optional acpi -acpi_wakecode.h optional acpi \ - dependency "$S/amd64/acpica/acpi_wakecode.S assym.s" \ - compile-with "${MAKE} -f $S/amd64/acpica/Makefile ${.TARGET} MAKESRCPATH=$S/amd64/acpica" \ +acpi_wakecode.o optional acpi \ + dependency "$S/amd64/acpica/acpi_wakecode.S assym.s" \ + compile-with "${NORMAL_S}" \ no-obj no-implicit-rule before-depend \ - clean "acpi_wakecode.h acpi_wakecode.o acpi_wakecode.bin" -# -acpi_wakedata.h optional acpi \ - dependency "$S/amd64/acpica/acpi_wakecode.S assym.s" \ - compile-with "${MAKE} -f $S/amd64/acpica/Makefile ${.TARGET} MAKESRCPATH=$S/amd64/acpica" \ - no-obj no-implicit-rule before-depend \ - clean "acpi_wakedata.h acpi_wakecode.o acpi_wakecode.bin" + clean "acpi_wakecode.o" +acpi_wakecode.bin optional acpi \ + dependency "acpi_wakecode.o" \ + compile-with "objcopy -S -O binary acpi_wakecode.o ${.TARGET}" \ + no-obj no-implicit-rule before-depend \ + clean "acpi_wakecode.bin" +acpi_wakecode.h optional acpi \ + dependency "acpi_wakecode.bin" \ + compile-with "file2c -sx 'static char wakecode[] = {' '};' < acpi_wakecode.bin > ${.TARGET}" \ + no-obj no-implicit-rule before-depend \ + clean "acpi_wakecode.h" +acpi_wakedata.h optional acpi \ + dependency "acpi_wakecode.o" \ + compile-with 'nm -n --defined-only acpi_wakecode.o | while read offset dummy what; do echo "#define $${what} 0x$${offset}"; done > ${.TARGET}' \ + no-obj no-implicit-rule before-depend \ + clean "acpi_wakedata.h" # amd64/acpica/acpi_wakeup.c optional acpi amd64/acpica/madt.c optional acpi Modified: stable/8/sys/dev/acpica/acpi.c ============================================================================== --- stable/8/sys/dev/acpica/acpi.c Tue Jul 20 19:43:25 2010 (r210314) +++ stable/8/sys/dev/acpica/acpi.c Tue Jul 20 20:15:32 2010 (r210315) @@ -46,9 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef SMP #include -#endif #include #include @@ -2536,11 +2534,11 @@ acpi_EnterSleepState(struct acpi_softc * return_ACPI_STATUS (AE_OK); } -#ifdef SMP - thread_lock(curthread); - sched_bind(curthread, 0); - thread_unlock(curthread); -#endif + if (smp_started) { + thread_lock(curthread); + sched_bind(curthread, 0); + thread_unlock(curthread); + } /* * Be sure to hold Giant across DEVICE_SUSPEND/RESUME since non-MPSAFE @@ -2621,11 +2619,11 @@ backout: mtx_unlock(&Giant); -#ifdef SMP - thread_lock(curthread); - sched_unbind(curthread); - thread_unlock(curthread); -#endif + if (smp_started) { + thread_lock(curthread); + sched_unbind(curthread); + thread_unlock(curthread); + } /* Allow another sleep request after a while. */ timeout(acpi_sleep_enable, sc, hz * ACPI_MINIMUM_AWAKETIME); Modified: stable/8/sys/modules/acpi/acpi/Makefile ============================================================================== --- stable/8/sys/modules/acpi/acpi/Makefile Tue Jul 20 19:43:25 2010 (r210314) +++ stable/8/sys/modules/acpi/acpi/Makefile Tue Jul 20 20:15:32 2010 (r210315) @@ -99,15 +99,28 @@ SRCS+= assym.s madt.c CLEANFILES+= acpi_wakecode.bin acpi_wakecode.h acpi_wakecode.o .if ${MACHINE_ARCH} == "amd64" -SRCS+= acpi_switch.S opt_global.h +.if !defined(KERNBUILDDIR) +CFLAGS+=-DSMP +.endif +SRCS+= acpi_switch.S acpi_wakedata.h CLEANFILES+= acpi_wakedata.h ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} acpi_switch.o: acpi_switch.S ${CC} -c ${ASM_CFLAGS} ${WERROR} ${.IMPSRC} -.endif - +acpi_wakecode.o: acpi_wakecode.S assym.s + ${CC} -c ${ASM_CFLAGS} ${WERROR} ${.IMPSRC} +acpi_wakecode.bin: acpi_wakecode.o + objcopy -S -O binary acpi_wakecode.o ${.TARGET} +acpi_wakecode.h: acpi_wakecode.bin + file2c -sx 'static char wakecode[] = {' '};' < acpi_wakecode.bin > \ + ${.TARGET} +acpi_wakedata.h: acpi_wakecode.o + nm -n --defined-only ${.ALLSRC} | while read offset dummy what; do \ + echo "#define $${what} 0x$${offset}"; done > ${.TARGET} +.else acpi_wakecode.h: acpi_wakecode.S assym.s ${MAKE} -f ${.CURDIR}/../../../${MACHINE_ARCH}/acpica/Makefile \ MAKESRCPATH=${.CURDIR}/../../../${MACHINE_ARCH}/acpica +.endif .include