aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/acpica/Makefile33
-rw-r--r--sys/amd64/acpica/acpi_wakecode.S2
-rwxr-xr-xsys/amd64/acpica/genwakecode.sh6
-rwxr-xr-xsys/amd64/acpica/genwakedata.sh9
-rw-r--r--sys/conf/files.amd6429
-rw-r--r--sys/modules/acpi/acpi/Makefile16
6 files changed, 32 insertions, 63 deletions
diff --git a/sys/amd64/acpica/Makefile b/sys/amd64/acpica/Makefile
deleted file mode 100644
index 743728051e97..000000000000
--- a/sys/amd64/acpica/Makefile
+++ /dev/null
@@ -1,33 +0,0 @@
-# $FreeBSD$
-
-# Correct path for kernel builds
-# Don't rely on the kernel's .depend file
-.ifdef MAKESRCPATH
-.PATH: ${MAKESRCPATH}
-DEPENDFILE=
-.else
-MAKESRCPATH= ${.CURDIR}
-CLEANFILES= acpi_wakecode.h acpi_wakedata.h acpi_wakecode.bin acpi_wakecode.o
-.endif
-.if ${CC} == "icc"
-CFLAGS+= -restrict
-NOSTDINC= -X
-.else
-NOSTDINC= -nostdinc
-.endif
-CFLAGS+= ${NOSTDINC} -include opt_global.h -I. -I${MAKESRCPATH}/../..
-
-all: acpi_wakecode.h acpi_wakedata.h
-
-acpi_wakecode.o: acpi_wakecode.S assym.s
-
-acpi_wakecode.bin: acpi_wakecode.o
- objcopy -S -O binary acpi_wakecode.o acpi_wakecode.bin
-
-acpi_wakecode.h: acpi_wakecode.bin
- sh ${MAKESRCPATH}/genwakecode.sh > acpi_wakecode.h
-
-acpi_wakedata.h: acpi_wakecode.bin
- sh ${MAKESRCPATH}/genwakedata.sh > acpi_wakedata.h
-
-.include <bsd.prog.mk>
diff --git a/sys/amd64/acpica/acpi_wakecode.S b/sys/amd64/acpica/acpi_wakecode.S
index 94a34f782ded..c8dfc3827dc2 100644
--- a/sys/amd64/acpica/acpi_wakecode.S
+++ b/sys/amd64/acpica/acpi_wakecode.S
@@ -29,8 +29,6 @@
* $FreeBSD$
*/
-#define LOCORE
-
#include <machine/asmacros.h>
#include <machine/specialreg.h>
diff --git a/sys/amd64/acpica/genwakecode.sh b/sys/amd64/acpica/genwakecode.sh
deleted file mode 100755
index c9d0077de56a..000000000000
--- a/sys/amd64/acpica/genwakecode.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-# $FreeBSD$
-#
-file2c -sx 'static char wakecode[] = {' '};' <acpi_wakecode.bin
-
-exit 0
diff --git a/sys/amd64/acpica/genwakedata.sh b/sys/amd64/acpica/genwakedata.sh
deleted file mode 100755
index 6d4181ecacaf..000000000000
--- a/sys/amd64/acpica/genwakedata.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-# $FreeBSD$
-#
-nm -n --defined-only acpi_wakecode.o | while read offset dummy what
-do
- echo "#define ${what} 0x${offset}"
-done
-
-exit 0
diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64
index cd273ce8707d..3f7e284bcba0 100644
--- a/sys/conf/files.amd64
+++ b/sys/conf/files.amd64
@@ -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
diff --git a/sys/modules/acpi/acpi/Makefile b/sys/modules/acpi/acpi/Makefile
index 2606023dbafb..4b3d4735bc5c 100644
--- a/sys/modules/acpi/acpi/Makefile
+++ b/sys/modules/acpi/acpi/Makefile
@@ -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>