summaryrefslogtreecommitdiffstats
path: root/sys/boot
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 /sys/boot
parent07ec417491720a77d28b1083886826f0141b171c (diff)
downloadFreeBSD-src-c06098a4065d7be63bd57c45889a91da9bc0f5e4.zip
FreeBSD-src-c06098a4065d7be63bd57c45889a91da9bc0f5e4.tar.gz
Catch up with ACPI-CA 20070320 import.
Diffstat (limited to 'sys/boot')
-rw-r--r--sys/boot/i386/libi386/biosacpi.c20
-rw-r--r--sys/boot/ia64/ski/acpi_stub.c46
2 files changed, 34 insertions, 32 deletions
diff --git a/sys/boot/i386/libi386/biosacpi.c b/sys/boot/i386/libi386/biosacpi.c
index ccdd0be..971e7c7 100644
--- a/sys/boot/i386/libi386/biosacpi.c
+++ b/sys/boot/i386/libi386/biosacpi.c
@@ -44,15 +44,15 @@ __FBSDID("$FreeBSD$");
* environment.
*/
-static RSDP_DESCRIPTOR *biosacpi_find_rsdp(void);
-static RSDP_DESCRIPTOR *biosacpi_search_rsdp(char *base, int length);
+static ACPI_TABLE_RSDP *biosacpi_find_rsdp(void);
+static ACPI_TABLE_RSDP *biosacpi_search_rsdp(char *base, int length);
#define RSDP_CHECKSUM_LENGTH 20
void
biosacpi_detect(void)
{
- RSDP_DESCRIPTOR *rsdp;
+ ACPI_TABLE_RSDP *rsdp;
char buf[24];
int revision;
@@ -63,6 +63,8 @@ biosacpi_detect(void)
return;
/* export values from the RSDP */
+ sprintf(buf, "%p", VTOP(rsdp));
+ setenv("hint.acpi.0.rsdp", buf, 1);
revision = rsdp->Revision;
if (revision == 0)
revision = 1;
@@ -88,10 +90,10 @@ biosacpi_detect(void)
/*
* Find the RSDP in low memory. See section 5.2.2 of the ACPI spec.
*/
-static RSDP_DESCRIPTOR *
+static ACPI_TABLE_RSDP *
biosacpi_find_rsdp(void)
{
- RSDP_DESCRIPTOR *rsdp;
+ ACPI_TABLE_RSDP *rsdp;
uint16_t *addr;
/* EBDA is the 1 KB addressed by the 16 bit pointer at 0x40E. */
@@ -106,19 +108,19 @@ biosacpi_find_rsdp(void)
return (NULL);
}
-static RSDP_DESCRIPTOR *
+static ACPI_TABLE_RSDP *
biosacpi_search_rsdp(char *base, int length)
{
- RSDP_DESCRIPTOR *rsdp;
+ ACPI_TABLE_RSDP *rsdp;
u_int8_t *cp, sum;
int ofs, idx;
/* search on 16-byte boundaries */
for (ofs = 0; ofs < length; ofs += 16) {
- rsdp = (RSDP_DESCRIPTOR *)PTOV(base + ofs);
+ rsdp = (ACPI_TABLE_RSDP *)PTOV(base + ofs);
/* compare signature, validate checksum */
- if (!strncmp(rsdp->Signature, RSDP_SIG, strlen(RSDP_SIG))) {
+ if (!strncmp(rsdp->Signature, ACPI_SIG_RSDP, strlen(ACPI_SIG_RSDP))) {
cp = (u_int8_t *)rsdp;
sum = 0;
for (idx = 0; idx < RSDP_CHECKSUM_LENGTH; idx++)
diff --git a/sys/boot/ia64/ski/acpi_stub.c b/sys/boot/ia64/ski/acpi_stub.c
index 9b51e2f..8e08e52 100644
--- a/sys/boot/ia64/ski/acpi_stub.c
+++ b/sys/boot/ia64/ski/acpi_stub.c
@@ -36,38 +36,38 @@ __FBSDID("$FreeBSD$");
typedef struct /* LOCAL SAPIC */
{
- APIC_HEADER Header;
- UINT8 ProcessorId; /* ACPI processor id */
- UINT8 LocalSapicId; /* Processor local SAPIC id */
- UINT8 LocalSapicEid; /* Processor local SAPIC eid */
- UINT8 Reserved[3];
- UINT32 ProcessorEnabled: 1;
- UINT32 FlagsReserved: 31;
+ ACPI_SUBTABLE_HEADER Header;
+ UINT8 ProcessorId; /* ACPI processor id */
+ UINT8 LocalSapicId; /* Processor local SAPIC id */
+ UINT8 LocalSapicEid; /* Processor local SAPIC eid */
+ UINT8 Reserved[3];
+ UINT32 ProcessorEnabled: 1;
+ UINT32 FlagsReserved: 31;
} LOCAL_SAPIC;
typedef struct /* IO SAPIC */
{
- APIC_HEADER Header;
- UINT8 IoSapicId; /* I/O SAPIC ID */
- UINT8 Reserved; /* reserved - must be zero */
- UINT32 Vector; /* interrupt base */
- UINT64 IoSapicAddress; /* SAPIC's physical address */
+ ACPI_SUBTABLE_HEADER Header;
+ UINT8 IoSapicId; /* I/O SAPIC ID */
+ UINT8 Reserved; /* reserved - must be zero */
+ UINT32 Vector; /* interrupt base */
+ UINT64 IoSapicAddress; /* SAPIC's physical address */
} IO_SAPIC;
/*
*/
struct {
- MULTIPLE_APIC_TABLE Header;
- MADT_LOCAL_SAPIC cpu0;
- MADT_LOCAL_SAPIC cpu1;
- MADT_LOCAL_SAPIC cpu2;
- MADT_LOCAL_SAPIC cpu3;
- MADT_IO_SAPIC sapic;
+ ACPI_TABLE_MADT MADT;
+ ACPI_MADT_LOCAL_SAPIC cpu0;
+ ACPI_MADT_LOCAL_SAPIC cpu1;
+ ACPI_MADT_LOCAL_SAPIC cpu2;
+ ACPI_MADT_LOCAL_SAPIC cpu3;
+ ACPI_MADT_IO_SAPIC sapic;
} apic = {
/* Header. */
{
- APIC_SIG, /* Signature. */
+ ACPI_SIG_MADT, /* Signature. */
sizeof(apic), /* Length of table. */
0, /* ACPI minor revision. */
0, /* Checksum. */
@@ -134,7 +134,7 @@ struct {
UINT64 apic_tbl;
} xsdt = {
{
- XSDT_SIG, /* Signature. */
+ ACPI_SIG_XSDT, /* Signature. */
sizeof(xsdt), /* Length of table. */
0, /* ACPI minor revision. */
0, /* XXX checksum. */
@@ -147,8 +147,8 @@ struct {
0UL /* XXX APIC table address. */
};
-RSDP_DESCRIPTOR acpi_root = {
- RSDP_SIG,
+ACPI_TABLE_RSDP acpi_root = {
+ ACPI_SIG_RSDP,
0, /* XXX checksum. */
"FBSD",
2, /* ACPI Rev 2.0. */
@@ -177,7 +177,7 @@ acpi_stub_init(void)
cksum(&acpi_root, 20, &acpi_root.Checksum);
cksum(&acpi_root, sizeof(acpi_root), &acpi_root.ExtendedChecksum);
- cksum(&apic, sizeof(apic), &apic.Header.Checksum);
+ cksum(&apic, sizeof(apic), &apic.MADT.Header.Checksum);
xsdt.apic_tbl = (UINT32)&apic;
cksum(&xsdt, sizeof(xsdt), &xsdt.Header.Checksum);
}
OpenPOWER on IntegriCloud