summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2010-11-12 20:55:14 +0000
committerjkim <jkim@FreeBSD.org>2010-11-12 20:55:14 +0000
commit72feb3913ec09b0f61b90759628f79e92b2ea450 (patch)
tree4f33c44dc55bbc3996ed2121f95ae8596cc707de
parent48df378ef02b15bdfd95a140fae980fd92745a0c (diff)
downloadFreeBSD-src-72feb3913ec09b0f61b90759628f79e92b2ea450.zip
FreeBSD-src-72feb3913ec09b0f61b90759628f79e92b2ea450.tar.gz
MFamd64: (based on) r209957
Move logic of building ACPI headers for acpi_wakeup.c into better places, remove intermediate makefile and shell script, and reduce diff between i386 and amd64.
-rw-r--r--sys/conf/files.i38625
-rw-r--r--sys/i386/acpica/Makefile30
-rw-r--r--sys/i386/acpica/acpi_wakecode.S2
-rw-r--r--sys/i386/acpica/acpi_wakeup.c1
-rw-r--r--sys/i386/acpica/genwakecode.sh11
-rw-r--r--sys/modules/acpi/acpi/Makefile20
6 files changed, 29 insertions, 60 deletions
diff --git a/sys/conf/files.i386 b/sys/conf/files.i386
index c955507..c6a3260 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 87061d6..0000000
--- 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 <bsd.prog.mk>
diff --git a/sys/i386/acpica/acpi_wakecode.S b/sys/i386/acpica/acpi_wakecode.S
index 889a58a..e23b138 100644
--- a/sys/i386/acpica/acpi_wakecode.S
+++ b/sys/i386/acpica/acpi_wakecode.S
@@ -27,8 +27,6 @@
* $FreeBSD$
*/
-#define LOCORE
-
#include <machine/asmacros.h>
#include <machine/specialreg.h>
diff --git a/sys/i386/acpica/acpi_wakeup.c b/sys/i386/acpica/acpi_wakeup.c
index 2397d80..6a46447 100644
--- a/sys/i386/acpica/acpi_wakeup.c
+++ b/sys/i386/acpica/acpi_wakeup.c
@@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$");
#include <dev/acpica/acpivar.h>
#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 caffbf8..0000000
--- a/sys/i386/acpica/genwakecode.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-# $FreeBSD$
-#
-file2c 'static char wakecode[] = {' '};' <acpi_wakecode.bin
-
-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/modules/acpi/acpi/Makefile b/sys/modules/acpi/acpi/Makefile
index ce1e572..9953e0c 100644
--- a/sys/modules/acpi/acpi/Makefile
+++ b/sys/modules/acpi/acpi/Makefile
@@ -96,23 +96,24 @@ opt_ddb.h: Makefile
.endif
# Machine-specific code such as sleep/wakeup
-SRCS+= acpi_apm.c acpi_machdep.c acpi_wakecode.h acpi_wakeup.c
+SRCS+= acpi_apm.c acpi_machdep.c acpi_wakecode.h acpi_wakedata.h acpi_wakeup.c
SRCS+= assym.s madt.c
-CLEANFILES+= acpi_wakecode.bin acpi_wakecode.h acpi_wakecode.o
+CLEANFILES+=acpi_wakecode.bin acpi_wakecode.h acpi_wakecode.o acpi_wakedata.h
SRCS+= opt_global.h
+ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS}
+NORMAL_S= ${CC} -c ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}
+NM?= nm
+
.if ${MACHINE_CPUARCH} == "amd64"
.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}
-NORMAL_S= ${CC} -c ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}
-NM?= nm
+SRCS+= acpi_switch.S
acpi_switch.o: acpi_switch.S
${NORMAL_S}
+.endif
acpi_wakecode.o: acpi_wakecode.S assym.s
${NORMAL_S}
acpi_wakecode.bin: acpi_wakecode.o
@@ -125,10 +126,5 @@ acpi_wakedata.h: acpi_wakecode.o
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_CPUARCH}/acpica/Makefile \
- MAKESRCPATH=${.CURDIR}/../../../${MACHINE_CPUARCH}/acpica
-.endif
.include <bsd.kmod.mk>
OpenPOWER on IntegriCloud