diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index c9555079c6a..c6a3260e6ac 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -239,13 +239,28 @@ dev/acpica/acpi_if.m standard dev/acpi_support/acpi_wmi_if.m standard dev/wpi/if_wpi.c optional wpi i386/acpica/acpi_machdep.c optional acpi -i386/acpica/acpi_wakeup.c optional acpi -acpi_wakecode.h optional acpi \ - dependency "$S/i386/acpica/acpi_wakecode.S assym.s" \ - compile-with "${MAKE} -f $S/i386/acpica/Makefile MAKESRCPATH=$S/i386/acpica" \ +acpi_wakecode.o optional acpi \ + dependency "$S/i386/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" + 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" # +i386/acpica/acpi_wakeup.c optional acpi i386/bios/apm.c optional apm i386/bios/mca_machdep.c optional mca i386/bios/smapi.c optional smapi diff --git a/sys/i386/acpica/Makefile b/sys/i386/acpica/Makefile deleted file mode 100644 index 87061d67247..00000000000 --- a/sys/i386/acpica/Makefile +++ /dev/null @@ -1,30 +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_wakecode.bin acpi_wakecode.o -.endif -.if ${CC:T:Micc} == "icc" -CFLAGS+= -restrict -NOSTDINC= -X -.else -NOSTDINC= -nostdinc -.endif -CFLAGS+= ${NOSTDINC} -I. -I${MAKESRCPATH}/../.. - -all: acpi_wakecode.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 acpi_wakecode.o - sh ${MAKESRCPATH}/genwakecode.sh > acpi_wakecode.h - -.include diff --git a/sys/i386/acpica/acpi_wakecode.S b/sys/i386/acpica/acpi_wakecode.S index 889a58a24c1..e23b138870f 100644 --- a/sys/i386/acpica/acpi_wakecode.S +++ b/sys/i386/acpica/acpi_wakecode.S @@ -27,8 +27,6 @@ * $FreeBSD$ */ -#define LOCORE - #include #include diff --git a/sys/i386/acpica/acpi_wakeup.c b/sys/i386/acpica/acpi_wakeup.c index 2397d801539..6a464470b49 100644 --- a/sys/i386/acpica/acpi_wakeup.c +++ b/sys/i386/acpica/acpi_wakeup.c @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include "acpi_wakecode.h" +#include "acpi_wakedata.h" /* Make sure the code is less than one page and leave room for the stack. */ CTASSERT(sizeof(wakecode) < PAGE_SIZE - 1024); diff --git a/sys/i386/acpica/genwakecode.sh b/sys/i386/acpica/genwakecode.sh deleted file mode 100644 index caffbf8642a..00000000000 --- a/sys/i386/acpica/genwakecode.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# $FreeBSD$ -# -file2c 'static char wakecode[] = {' '};' ${.TARGET} -.else -acpi_wakecode.h: acpi_wakecode.S assym.s - ${MAKE} -f ${.CURDIR}/../../../${MACHINE_CPUARCH}/acpica/Makefile \ - MAKESRCPATH=${.CURDIR}/../../../${MACHINE_CPUARCH}/acpica -.endif .include