summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authortakawata <takawata@FreeBSD.org>2000-08-31 15:34:54 +0000
committertakawata <takawata@FreeBSD.org>2000-08-31 15:34:54 +0000
commit8f6295e0c7ad66ba5a3462b84794e1cac156450b (patch)
tree41d331868ebf11ddadb32e037fbbc041aee2d506 /sys/amd64
parentebf8e6bdbff9143531a7d02f8395d7bfb23d5878 (diff)
downloadFreeBSD-src-8f6295e0c7ad66ba5a3462b84794e1cac156450b.zip
FreeBSD-src-8f6295e0c7ad66ba5a3462b84794e1cac156450b.tar.gz
Merge rest piece of ACPI driver.To activate acpi driver ,add
device acpi line. Merge finished. But still experimental phase.Need more hack! Obtained from:ACPI for FreeBSD project
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/bios.c25
-rw-r--r--sys/amd64/amd64/machdep.c17
2 files changed, 39 insertions, 3 deletions
diff --git a/sys/amd64/amd64/bios.c b/sys/amd64/amd64/bios.c
index fdcdbc6..18f4989 100644
--- a/sys/amd64/amd64/bios.c
+++ b/sys/amd64/amd64/bios.c
@@ -31,6 +31,7 @@
* Code for dealing with the BIOS in x86 PC systems.
*/
+#include "acpi.h"
#include "isa.h"
#include <sys/param.h>
@@ -49,6 +50,10 @@
#include <isa/pnpreg.h>
#include <isa/pnpvar.h>
+#if NACPI > 0
+#include <sys/acpi.h>
+#endif
+
#define BIOS_START 0xe0000
#define BIOS_SIZE 0x20000
@@ -143,11 +148,29 @@ bios32_init(void *junk)
printf("pnpbios: Bad PnP BIOS data checksum\n");
}
}
+#if NACPI > 0
+ /*
+ * ACPI BIOS
+ * acpi_rsdp is GLOBAL and holds RSD PTR signature
+ */
+ if ((sigaddr = bios_sigsearch(0, "RSD PTR ", 8, 16, 0)) != 0) {
+ /* get a virtual pointer to the structure */
+ acpi_rsdp = (struct ACPIrsdp *)(uintptr_t)BIOS_PADDRTOVADDR(sigaddr);
+ for (cv = (u_int8_t *)acpi_rsdp, ck = 0, i = 0; i < sizeof(struct ACPIrsdp); i++) {
+ ck += cv[i];
+ }
+
+ /* If checksum is NG, disable it */
+ if (ck != 0) {
+ printf("ACPI: Bad ACPI BIOS data checksum\n");
+ acpi_rsdp=NULL;/* 0xa0000<=RSD_PTR<0x100000*/
+ }
+ }
+#endif
if (bootverbose) {
/* look for other know signatures */
printf("Other BIOS signatures found:\n");
- printf("ACPI: %08x\n", bios_sigsearch(0, "RSD PTR ", 8, 16, 0));
}
}
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 5e0dcba..781ff87 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -37,7 +37,7 @@
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
* $FreeBSD$
*/
-
+#include "acpi.h"
#include "apm.h"
#include "npx.h"
#include "opt_atalk.h"
@@ -116,6 +116,10 @@
#include <sys/ptrace.h>
#include <machine/sigframe.h>
+#if NACPI > 0
+#include <sys/acpi.h>
+#endif
+
extern void init386 __P((int first));
extern void dblfault_handler __P((void));
@@ -1489,6 +1493,9 @@ getmemsize(int first)
smap = (void *)vm86_addpage(&vmc, 1, KERNBASE + (1 << PAGE_SHIFT));
vm86_getptr(&vmc, (vm_offset_t)smap, &vmf.vmf_es, &vmf.vmf_di);
+#if NACPI > 0
+ acpi_init_addr_range();
+#endif
physmap_idx = 0;
vmf.vmf_ebx = 0;
do {
@@ -1505,7 +1512,13 @@ getmemsize(int first)
(u_int32_t)smap->base,
*(u_int32_t *)((char *)&smap->length + 4),
(u_int32_t)smap->length);
-
+#if NACPI > 0
+ /* Save ACPI related memory Info */
+ if (smap->type == 0x03 || smap->type == 0x04) {
+ acpi_register_addr_range(smap->base,
+ smap->length, smap->type);
+ }
+#endif
if (smap->type != 0x01)
goto next_run;
OpenPOWER on IntegriCloud