1 # $FreeBSD$
2
3 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64"
4 .error "ACPI can only be compiled into the kernel on the amd64 and ia64 platforms"
5 .endif
6
7 .if ${MACHINE} != "i386"
8 .error "The ACPI module is only for i386"
9 .endif
10
11 .PATH: ${.CURDIR}/../../../contrib/dev/acpica \
12 ${.CURDIR}/../../../pci \
13 ${.CURDIR}/../../../dev/acpica \
14 ${.CURDIR}/../../../dev/acpica/Osd \
15 ${.CURDIR}/../../../${MACHINE_ARCH}/acpica
16
17 KMOD= acpi
18 WARNS?= 2
19
20 # ACPI CA sources
21 CFLAGS+= -I${.CURDIR}/../../../contrib/dev/acpica
22 SRCS+= dsfield.c dsinit.c dsmethod.c dsmthdat.c
23 SRCS+= dsobject.c dsopcode.c dsutils.c dswexec.c dswload.c
24 SRCS+= dswscope.c dswstate.c evevent.c evgpe.c evgpeblk.c
25 SRCS+= evmisc.c evregion.c evrgnini.c evsci.c evxface.c
26 SRCS+= evxfevnt.c evxfregn.c exconfig.c exconvrt.c excreate.c
27 SRCS+= exdump.c exfield.c exfldio.c exmisc.c exmutex.c
28 SRCS+= exnames.c exoparg1.c exoparg2.c exoparg3.c exoparg6.c
29 SRCS+= exprep.c exregion.c exresnte.c exresolv.c exresop.c
30 SRCS+= exstore.c exstoren.c exstorob.c exsystem.c exutils.c
31 SRCS+= hwacpi.c hwgpe.c hwregs.c hwsleep.c hwtimer.c
32 SRCS+= nsaccess.c nsalloc.c nsdump.c nseval.c nsinit.c
33 SRCS+= nsload.c nsnames.c nsobject.c nsparse.c nssearch.c
34 SRCS+= nsutils.c nswalk.c nsxfeval.c nsxfname.c nsxfobj.c
35 SRCS+= psargs.c psopcode.c psparse.c psscope.c
36 SRCS+= pstree.c psutils.c pswalk.c psxface.c
37 SRCS+= rsaddr.c rscalc.c rscreate.c rsdump.c rsio.c
38 SRCS+= rsirq.c rslist.c rsmemory.c rsmisc.c rsutils.c
39 SRCS+= rsxface.c tbconvrt.c tbget.c tbgetall.c tbinstal.c
40 SRCS+= tbrsdt.c tbutils.c tbxface.c tbxfroot.c utalloc.c
41 SRCS+= utclib.c utcopy.c utdebug.c utdelete.c uteval.c
42 SRCS+= utglobal.c utinit.c utmath.c utmisc.c utobject.c
43 SRCS+= utxface.c
44
45 # OSPM layer and core hardware drivers
46 SRCS+= acpi.c acpi_button.c acpi_isab.c
47 SRCS+= acpi_package.c acpi_pci.c acpi_pcib.c acpi_pcib_acpi.c
48 SRCS+= acpi_pcib_pci.c acpi_powerres.c acpi_quirk.c acpi_resource.c
49 SRCS+= acpi_timer.c acpi_pci_link.c acpi_thermal.c
50
51 # ACPI hardware drivers, mostly used for mobile systems.
52 SRCS+= acpi_acad.c acpi_battery.c acpi_cmbat.c acpi_cpu.c
53 SRCS+= acpi_ec.c acpi_hpet.c acpi_lid.c acpi_perf.c acpi_smbat.c
54 SRCS+= acpi_throttle.c
55
56 # OSD layer
57 SRCS+= OsdDebug.c
58 SRCS+= OsdHardware.c OsdInterrupt.c OsdMemory.c OsdSchedule.c
59 SRCS+= OsdStream.c OsdSynch.c OsdTable.c OsdEnvironment.c
60 SRCS+= opt_acpi.h opt_bus.h opt_ddb.h
61 SRCS+= acpi_if.h acpi_quirks.h bus_if.h cpufreq_if.h device_if.h
62 SRCS+= isa_if.h pci_if.h pcib_if.h
63
64 # XXX ACPI should not depend on the following headers but this is currently
65 # needed for the build of assym.s.
66 # This obviously needs a better and more structural fix.
67 SRCS+= opt_kstack_pages.h opt_nfs.h opt_apic.h opt_compat.h
68
69 # Debugging support
70 DBSRC= dbcmds.c dbdisply.c dbexec.c dbfileio.c dbhistry.c
71 DBSRC+= dbinput.c dbstats.c dbutils.c dbxface.c
72 DBSRC+= dmbuffer.c dmnames.c dmopcode.c dmobject.c dmresrc.c dmresrcl.c
73 DBSRC+= dmresrcs.c dmutils.c dmwalk.c
74
75 .if !defined(KERNBUILDDIR)
76 .if ACPI_MAX_THREADS
77 CFLAGS+=-DACPI_MAX_THREADS=${ACPI_MAX_THREADS}
78 .endif
79 .if ACPI_NO_SEMAPHORES
80 CFLAGS+=-DACPI_NO_SEMAPHORES
81 .endif
82 .if ACPI_DEBUG
83 CFLAGS+=-DACPI_DEBUG
84 SRCS+= ${DBSRC}
85 opt_ddb.h: Makefile
86 echo "#define DDB 1" > ${.TARGET}
87 .else
88 opt_ddb.h: Makefile
89 echo -n > ${.TARGET}
90 .endif
91 .endif
92
93 # Machine-specific code such as sleep/wakeup
94 SRCS+= acpi_machdep.c acpi_wakecode.h acpi_wakeup.c
95 .if ${MACHINE} == "i386"
96 SRCS+= madt.c assym.s
97 .endif
98 CLEANFILES+= acpi_wakecode.h acpi_wakecode.o acpi_wakecode.bin ${DBSRC:.c=.o}
99
100 acpi_wakecode.h: acpi_wakecode.S assym.s
101 ${MAKE} -f ${.CURDIR}/../../../${MACHINE_ARCH}/acpica/Makefile \
102 MAKESRCPATH=${.CURDIR}/../../../${MACHINE_ARCH}/acpica
103
104 .include <bsd.kmod.mk>
Cache object: 1106ebca4a4e1acf8feca874d43df2f3
|