summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2007-03-22 18:16:43 +0000
committerjkim <jkim@FreeBSD.org>2007-03-22 18:16:43 +0000
commitc06098a4065d7be63bd57c45889a91da9bc0f5e4 (patch)
treecdaa579af45ece33bafe9e4fe4c9aef8bd85ed29 /usr.sbin
parent07ec417491720a77d28b1083886826f0141b171c (diff)
downloadFreeBSD-src-c06098a4065d7be63bd57c45889a91da9bc0f5e4.zip
FreeBSD-src-c06098a4065d7be63bd57c45889a91da9bc0f5e4.tar.gz
Catch up with ACPI-CA 20070320 import.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/acpi/acpidb/Makefile13
-rw-r--r--usr.sbin/acpi/acpidb/acpidb.c34
-rw-r--r--usr.sbin/acpi/acpidump/acpi_user.c24
-rw-r--r--usr.sbin/acpi/iasl/Makefile8
4 files changed, 39 insertions, 40 deletions
diff --git a/usr.sbin/acpi/acpidb/Makefile b/usr.sbin/acpi/acpidb/Makefile
index 7ad2970..00e781e 100644
--- a/usr.sbin/acpi/acpidb/Makefile
+++ b/usr.sbin/acpi/acpidb/Makefile
@@ -46,21 +46,18 @@ SRCS+= rsaddr.c rscalc.c rscreate.c rsdump.c rsinfo.c \
rsutils.c rsxface.c
# tables
-SRCS+= tbconvrt.c tbget.c tbgetall.c tbinstal.c tbrsdt.c \
- tbutils.c tbxface.c tbxfroot.c
-
-# tools/acpiexec
-SRCS+= aeexec.c
+SRCS+= tbfadt.c tbfind.c tbinstal.c tbutils.c tbxface.c \
+ tbxfroot.c
# utilities
SRCS+= utalloc.c utcache.c utcopy.c utdebug.c utdelete.c \
uteval.c utglobal.c utinit.c utmath.c utmisc.c \
- utmutex.c utobject.c utstate.c utxface.c
+ utmutex.c utobject.c utresrc.c utstate.c uttrack.c \
+ utxface.c
MAN= acpidb.8
WARNS?= 2
-CFLAGS+= -DACPI_APPLICATION -DACPI_DEBUG_OUTPUT -DACPI_DEBUGGER \
- -DACPI_DISASSEMBLER
+CFLAGS+= -DACPI_EXEC_APP
.include <bsd.prog.mk>
diff --git a/usr.sbin/acpi/acpidb/acpidb.c b/usr.sbin/acpi/acpidb/acpidb.c
index 5c9d528..6893e54 100644
--- a/usr.sbin/acpi/acpidb/acpidb.c
+++ b/usr.sbin/acpi/acpidb/acpidb.c
@@ -30,6 +30,7 @@
#include <sys/queue.h>
#include <sys/mman.h>
#include <sys/stat.h>
+#include <sys/stdint.h>
#include <sys/types.h>
#include <assert.h>
@@ -85,6 +86,13 @@ static ACPI_INTEGER aml_simulate_prompt(char *msg, ACPI_INTEGER def_val);
static void aml_simulation_regload(const char *dumpfile);
static void aml_simulation_regdump(const char *dumpfile);
+/* Stubs to simplify linkage to the ACPI CA core subsystem. */
+ACPI_STATUS
+AeLocalGetRootPointer(void)
+{
+ return AE_ERROR;
+}
+
static void
aml_simulation_init(void)
{
@@ -239,7 +247,7 @@ aml_simulation_regdump(const char *dumpfile)
while (!TAILQ_EMPTY(&RegionContentList)) {
rc = TAILQ_FIRST(&RegionContentList);
fprintf(fp, "%d 0x%jx 0x%x\n",
- rc->regtype, rc->addr, rc->value);
+ rc->regtype, (uintmax_t)rc->addr, rc->value);
TAILQ_REMOVE(&RegionContentList, rc, links);
free(rc);
}
@@ -283,7 +291,8 @@ aml_vm_space_handler(
*Value = value;
if (Prompt) {
sprintf(msg, "[read (%s, %2d, 0x%jx)]",
- space_names[SpaceID], BitWidth, Address);
+ space_names[SpaceID], BitWidth,
+ (uintmax_t)Address);
*Value = aml_simulate_prompt(msg, value);
if (*Value != value) {
return(aml_vm_space_handler(SpaceID,
@@ -297,7 +306,8 @@ aml_vm_space_handler(
value = *Value;
if (Prompt) {
sprintf(msg, "[write(%s, %2d, 0x%jx)]",
- space_names[SpaceID], BitWidth, Address);
+ space_names[SpaceID], BitWidth,
+ (uintmax_t)Address);
value = aml_simulate_prompt(msg, *Value);
}
*Value = value;
@@ -339,16 +349,14 @@ DECLARE_VM_SPACE_HANDLER(pci_bar_target,ACPI_ADR_SPACE_PCI_BAR_TARGET);
* Load DSDT data file and invoke debugger
*/
-static UINT32 DummyGlobalLock;
-
static int
load_dsdt(const char *dsdtfile)
{
char filetmp[PATH_MAX];
u_int8_t *code;
- struct stat sb;
- int fd, fd2;
- int error;
+ struct stat sb;
+ int fd, fd2;
+ int error;
fd = open(dsdtfile, O_RDONLY, 0);
if (fd == -1) {
@@ -441,17 +449,7 @@ load_dsdt(const char *dsdtfile)
return (-1);
}
- AcpiGbl_FACS = malloc(sizeof (ACPI_COMMON_FACS));
- if (AcpiGbl_FACS == NULL) {
- fprintf(stderr, "could not allocate memory for FACS\n");
- return (-1);
- }
- DummyGlobalLock = 0;
- AcpiGbl_CommonFACS.GlobalLock = &DummyGlobalLock;
- AcpiGbl_GlobalLockPresent = TRUE;
-
AcpiDbGetTableFromFile(filetmp, NULL);
- AcpiUtSetIntegerWidth (AcpiGbl_DSDT->Revision);
AcpiDbInitialize();
AcpiGbl_DebuggerConfiguration = 0;
diff --git a/usr.sbin/acpi/acpidump/acpi_user.c b/usr.sbin/acpi/acpidump/acpi_user.c
index 550420c..617470c 100644
--- a/usr.sbin/acpi/acpidump/acpi_user.c
+++ b/usr.sbin/acpi/acpidump/acpi_user.c
@@ -35,12 +35,14 @@
#include <err.h>
#include <fcntl.h>
+#include <kenv.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "acpidump.h"
+static char hint_acpi_0_rsdp[] = "hint.acpi.0.rsdp";
static char machdep_acpi_root[] = "machdep.acpi_root";
static int acpi_mem_fd = -1;
@@ -124,7 +126,7 @@ acpi_get_rsdp(u_long addr)
static struct ACPIrsdp *
acpi_scan_rsd_ptr(void)
{
-#if defined(__i386__)
+#if defined(__amd64__) || defined(__i386__)
struct ACPIrsdp *rsdp;
u_long addr, end;
@@ -147,7 +149,7 @@ acpi_scan_rsd_ptr(void)
for (; addr < end; addr += 16)
if ((rsdp = acpi_get_rsdp(addr)) != NULL)
return (rsdp);
-#endif /* __i386__ */
+#endif /* __amd64__ || __i386__ */
return (NULL);
}
@@ -158,20 +160,22 @@ struct ACPIrsdp *
acpi_find_rsd_ptr(void)
{
struct ACPIrsdp *rsdp;
+ char buf[20];
u_long addr;
size_t len;
acpi_user_init();
- /* Attempt to use sysctl to find RSD PTR record. */
- len = sizeof(addr);
- if (sysctlbyname(machdep_acpi_root, &addr, &len, NULL, 0) == 0) {
- if ((rsdp = acpi_get_rsdp(addr)) != NULL)
- return (rsdp);
- else
- warnx("sysctl %s does not point to RSDP",
- machdep_acpi_root);
+ /* Attempt to use kenv or sysctl to find RSD PTR record. */
+ if (kenv(KENV_GET, hint_acpi_0_rsdp, buf, 20) == 0)
+ addr = strtoul(buf, NULL, 0);
+ if (addr == 0) {
+ len = sizeof(addr);
+ if (sysctlbyname(machdep_acpi_root, &addr, &len, NULL, 0) != 0)
+ addr = 0;
}
+ if (addr != 0 && (rsdp = acpi_get_rsdp(addr)) != NULL)
+ return (rsdp);
return (acpi_scan_rsd_ptr());
}
diff --git a/usr.sbin/acpi/iasl/Makefile b/usr.sbin/acpi/iasl/Makefile
index 9b341c2..aed6631 100644
--- a/usr.sbin/acpi/iasl/Makefile
+++ b/usr.sbin/acpi/iasl/Makefile
@@ -1,11 +1,11 @@
# $FreeBSD$
PROG= iasl
-SRCS= adisasm.c
+SRCS= adfile.c adisasm.c adwalk.c
SRCS+= osunixxf.c
# common
-SRCS+= getopt.c
+SRCS+= dmrestag.c dmtable.c dmtbdump.c dmtbinfo.c getopt.c
# compiler
SRCS+= aslanalyze.c aslcodegen.c aslcompile.c aslcompiler.y.h \
@@ -42,12 +42,12 @@ SRCS+= nsaccess.c nsalloc.c nsdump.c nsnames.c nsobject.c \
nsparse.c nssearch.c nsutils.c nswalk.c nsxfobj.c
# tables
-SRCS+= tbinstal.c tbutils.c
+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 \
- utstate.c
+ utresrc.c utstate.c
MAN= iasl.8
OpenPOWER on IntegriCloud