Author: jkim
Date: Mon Jul 12 21:08:35 2010
New Revision: 209957
URL: http://svn.freebsd.org/changeset/base/209957

Log:
  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.

Deleted:
  head/sys/amd64/acpica/Makefile
  head/sys/amd64/acpica/genwakecode.sh
  head/sys/amd64/acpica/genwakedata.sh
Modified:
  head/sys/amd64/acpica/acpi_wakecode.S
  head/sys/conf/files.amd64
  head/sys/modules/acpi/acpi/Makefile

Modified: head/sys/amd64/acpica/acpi_wakecode.S
==============================================================================
--- head/sys/amd64/acpica/acpi_wakecode.S       Mon Jul 12 20:45:37 2010        
(r209956)
+++ head/sys/amd64/acpica/acpi_wakecode.S       Mon Jul 12 21:08:35 2010        
(r209957)
@@ -29,8 +29,6 @@
  * $FreeBSD$
  */
 
-#define LOCORE
-
 #include <machine/asmacros.h>
 #include <machine/specialreg.h>
 

Modified: head/sys/conf/files.amd64
==============================================================================
--- head/sys/conf/files.amd64   Mon Jul 12 20:45:37 2010        (r209956)
+++ head/sys/conf/files.amd64   Mon Jul 12 21:08:35 2010        (r209957)
@@ -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: head/sys/modules/acpi/acpi/Makefile
==============================================================================
--- head/sys/modules/acpi/acpi/Makefile Mon Jul 12 20:45:37 2010        
(r209956)
+++ head/sys/modules/acpi/acpi/Makefile Mon Jul 12 21:08:35 2010        
(r209957)
@@ -99,15 +99,25 @@ 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
+SRCS+= acpi_switch.S acpi_wakedata.h opt_global.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 <bsd.kmod.mk>
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to