summaryrefslogtreecommitdiffstats
path: root/usr.sbin/acpi
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2009-06-05 18:50:45 +0000
committerjkim <jkim@FreeBSD.org>2009-06-05 18:50:45 +0000
commitd0e44fd5779eca7e16548a30d919afcbeb2ef881 (patch)
tree43df3e14d718167d26d41331ba1f8879b4e3a990 /usr.sbin/acpi
parent6d358bddff8eb82625370b62ff77b8fc34b088c6 (diff)
downloadFreeBSD-src-d0e44fd5779eca7e16548a30d919afcbeb2ef881.zip
FreeBSD-src-d0e44fd5779eca7e16548a30d919afcbeb2ef881.tar.gz
Import ACPICA 20090521.
Diffstat (limited to 'usr.sbin/acpi')
-rw-r--r--usr.sbin/acpi/Makefile.inc15
-rw-r--r--usr.sbin/acpi/acpiconf/acpiconf.c3
-rw-r--r--usr.sbin/acpi/acpidb/Makefile14
-rw-r--r--usr.sbin/acpi/acpidb/acpidb.c13
-rw-r--r--usr.sbin/acpi/acpidump/acpi.c32
-rw-r--r--usr.sbin/acpi/iasl/Makefile10
6 files changed, 64 insertions, 23 deletions
diff --git a/usr.sbin/acpi/Makefile.inc b/usr.sbin/acpi/Makefile.inc
index 3237afb..9d387bc 100644
--- a/usr.sbin/acpi/Makefile.inc
+++ b/usr.sbin/acpi/Makefile.inc
@@ -8,4 +8,17 @@ CFLAGS+= -I${.CURDIR}/../../../sys
.include "${.CURDIR}/../../Makefile.inc"
.endif
-.PATH: ${ACPICA_DIR} ${ACPICA_DIR}/compiler ${ACPICA_DIR}/common
+.PATH: ${ACPICA_DIR} \
+ ${ACPICA_DIR}/common \
+ ${ACPICA_DIR}/compiler \
+ ${ACPICA_DIR}/debugger \
+ ${ACPICA_DIR}/disassembler \
+ ${ACPICA_DIR}/dispatcher \
+ ${ACPICA_DIR}/events \
+ ${ACPICA_DIR}/executer \
+ ${ACPICA_DIR}/hardware \
+ ${ACPICA_DIR}/namespace \
+ ${ACPICA_DIR}/parser \
+ ${ACPICA_DIR}/resources \
+ ${ACPICA_DIR}/tables \
+ ${ACPICA_DIR}/utilities
diff --git a/usr.sbin/acpi/acpiconf/acpiconf.c b/usr.sbin/acpi/acpiconf/acpiconf.c
index 0797892..87f1c76 100644
--- a/usr.sbin/acpi/acpiconf/acpiconf.c
+++ b/usr.sbin/acpi/acpiconf/acpiconf.c
@@ -37,7 +37,8 @@
#include <unistd.h>
#include <dev/acpica/acpiio.h>
-#include <contrib/dev/acpica/acpi.h>
+
+#include <contrib/dev/acpica/include/acpi.h>
#define ACPIDEV "/dev/acpi"
diff --git a/usr.sbin/acpi/acpidb/Makefile b/usr.sbin/acpi/acpidb/Makefile
index b658077..1694867 100644
--- a/usr.sbin/acpi/acpidb/Makefile
+++ b/usr.sbin/acpi/acpidb/Makefile
@@ -17,7 +17,7 @@ SRCS+= evevent.c evgpe.c evgpeblk.c evmisc.c evregion.c \
evrgnini.c evsci.c evxface.c evxfevnt.c evxfregn.c
# hardware
-SRCS+= hwacpi.c hwgpe.c hwregs.c hwsleep.c
+SRCS+= hwacpi.c hwgpe.c hwregs.c hwsleep.c hwvalid.c hwxface.c
# interpreter/dispatcher
SRCS+= dsfield.c dsinit.c dsmethod.c dsmthdat.c dsobject.c \
@@ -37,8 +37,9 @@ SRCS+= psargs.c psloop.c psopcode.c psparse.c psscope.c \
# namespace
SRCS+= nsaccess.c nsalloc.c nsdump.c nseval.c nsinit.c \
- nsload.c nsnames.c nsobject.c nsparse.c nssearch.c \
- nsutils.c nswalk.c nsxfeval.c nsxfname.c nsxfobj.c
+ nsload.c nsnames.c nsobject.c nsparse.c nspredef.c \
+ nssearch.c nsutils.c nswalk.c nsxfeval.c nsxfname.c \
+ nsxfobj.c
# resources
SRCS+= rsaddr.c rscalc.c rscreate.c rsdump.c rsinfo.c \
@@ -51,14 +52,15 @@ SRCS+= tbfadt.c tbfind.c tbinstal.c tbutils.c tbxface.c \
# utilities
SRCS+= utalloc.c utcache.c utcopy.c utdebug.c utdelete.c \
- uteval.c utglobal.c utinit.c utmath.c utmisc.c \
+ uteval.c utglobal.c utinit.c utlock.c utmath.c utmisc.c \
utmutex.c utobject.c utresrc.c utstate.c uttrack.c \
utxface.c
MAN= acpidb.8
WARNS?= 2
-CFLAGS+= -DACPI_EXEC_APP
-CFLAGS+=-fno-strict-aliasing
+CFLAGS+= -DACPI_EXEC_APP -fno-strict-aliasing
+DPADD= ${LIBPTHREAD}
+LDADD= -lpthread
.include <bsd.prog.mk>
diff --git a/usr.sbin/acpi/acpidb/acpidb.c b/usr.sbin/acpi/acpidb/acpidb.c
index 6893e54..53d9db1 100644
--- a/usr.sbin/acpi/acpidb/acpidb.c
+++ b/usr.sbin/acpi/acpidb/acpidb.c
@@ -42,9 +42,8 @@
#include <stdlib.h>
#include <unistd.h>
-#include <contrib/dev/acpica/acpi.h>
-#include <contrib/dev/acpica/acnamesp.h>
-#include <contrib/dev/acpica/acdebug.h>
+#include <contrib/dev/acpica/include/acpi.h>
+#include <contrib/dev/acpica/tools/acpiexec/aecommon.h>
/*
* Dummy DSDT Table Header
@@ -90,7 +89,13 @@ static void aml_simulation_regdump(const char *dumpfile);
ACPI_STATUS
AeLocalGetRootPointer(void)
{
- return AE_ERROR;
+
+ return (AE_ERROR);
+}
+
+void
+AeTableOverride(ACPI_TABLE_HEADER *ExistingTable, ACPI_TABLE_HEADER **NewTable)
+{
}
static void
diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c
index fed0fb2..30ed43f 100644
--- a/usr.sbin/acpi/acpidump/acpi.c
+++ b/usr.sbin/acpi/acpidump/acpi.c
@@ -34,7 +34,9 @@
#include <assert.h>
#include <err.h>
#include <fcntl.h>
+#include <paths.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -803,11 +805,26 @@ dsdt_save_file(char *outfile, struct ACPIsdt *rsdt, struct ACPIsdt *dsdp)
void
aml_disassemble(struct ACPIsdt *rsdt, struct ACPIsdt *dsdp)
{
- char tmpstr[32], buf[256];
+ char buf[PATH_MAX], tmpstr[PATH_MAX];
+ const char *tmpdir;
+ char *tmpext;
FILE *fp;
- int fd, len;
-
- strcpy(tmpstr, "/tmp/acpidump.XXXXXX");
+ size_t len;
+ int fd;
+
+ tmpdir = getenv("TMPDIR");
+ if (tmpdir == NULL)
+ tmpdir = _PATH_TMP;
+ strncpy(tmpstr, tmpdir, sizeof(tmpstr));
+ strncat(tmpstr, "/acpidump.", sizeof(tmpstr) - strlen(tmpdir));
+ if (realpath(tmpstr, buf) == NULL) {
+ perror("realpath tmp file");
+ return;
+ }
+ strncpy(tmpstr, buf, sizeof(tmpstr));
+ len = strlen(buf);
+ tmpext = tmpstr + len;
+ strncpy(tmpext, "XXXXXX", sizeof(tmpstr) - len);
fd = mkstemp(tmpstr);
if (fd < 0) {
perror("iasl tmp file");
@@ -821,7 +838,7 @@ aml_disassemble(struct ACPIsdt *rsdt, struct ACPIsdt *dsdp)
close(STDOUT_FILENO);
if (vflag == 0)
close(STDERR_FILENO);
- execl("/usr/sbin/iasl", "iasl", "-d", tmpstr, (char *) 0);
+ execl("/usr/sbin/iasl", "iasl", "-d", tmpstr, NULL);
err(1, "exec");
}
@@ -829,8 +846,9 @@ aml_disassemble(struct ACPIsdt *rsdt, struct ACPIsdt *dsdp)
unlink(tmpstr);
/* Dump iasl's output to stdout */
- fp = fopen("acpidump.dsl", "r");
- unlink("acpidump.dsl");
+ strncpy(tmpext, "dsl", sizeof(tmpstr) - len);
+ fp = fopen(tmpstr, "r");
+ unlink(tmpstr);
if (fp == NULL) {
perror("iasl tmp file (read)");
return;
diff --git a/usr.sbin/acpi/iasl/Makefile b/usr.sbin/acpi/iasl/Makefile
index aed6631..551bfc6 100644
--- a/usr.sbin/acpi/iasl/Makefile
+++ b/usr.sbin/acpi/iasl/Makefile
@@ -13,8 +13,8 @@ SRCS+= aslanalyze.c aslcodegen.c aslcompile.c aslcompiler.y.h \
aslfiles.c aslfold.c asllength.c asllisting.c \
aslload.c asllookup.c aslmain.c aslmap.c aslopcodes.c \
asloperands.c aslopt.c aslresource.c aslrestype1.c \
- aslrestype2.c aslstubs.c asltransform.c asltree.c \
- aslutils.c
+ aslrestype2.c aslstartup.c aslstubs.c asltransform.c \
+ asltree.c aslutils.c
# debugger
SRCS+= dbfileio.c
@@ -46,8 +46,8 @@ SRCS+= tbfadt.c tbinstal.c tbutils.c tbxface.c
# utilities
SRCS+= utalloc.c utcache.c utcopy.c utdebug.c utdelete.c \
- utglobal.c utmath.c utmisc.c utmutex.c utobject.c \
- utresrc.c utstate.c
+ utglobal.c utinit.c utlock.c utmath.c utmisc.c \
+ utmutex.c utobject.c utresrc.c utstate.c utxface.c
MAN= iasl.8
@@ -55,6 +55,8 @@ CFLAGS+= -DACPI_ASL_COMPILER -I.
CFLAGS+= -D_USE_BERKELEY_YACC
LFLAGS= -i -PAslCompiler
YFLAGS= -d -pAslCompiler
+DPADD= ${LIBPTHREAD}
+LDADD= -lpthread
CLEANFILES= aslcompiler.y.h aslcompilerlex.l aslcompilerparse.y
OpenPOWER on IntegriCloud