summaryrefslogtreecommitdiffstats
path: root/sys
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
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')
-rw-r--r--sys/amd64/amd64/bios.c25
-rw-r--r--sys/amd64/amd64/machdep.c17
-rw-r--r--sys/conf/NOTES7
-rw-r--r--sys/conf/files11
-rw-r--r--sys/conf/files.i3861
-rw-r--r--sys/conf/options6
-rw-r--r--sys/i386/conf/NOTES7
-rw-r--r--sys/i386/i386/bios.c25
-rw-r--r--sys/i386/i386/machdep.c17
9 files changed, 110 insertions, 6 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;
diff --git a/sys/conf/NOTES b/sys/conf/NOTES
index c2c3678..b89221f 100644
--- a/sys/conf/NOTES
+++ b/sys/conf/NOTES
@@ -1193,6 +1193,13 @@ hint.npx.0.irq="13"
# Flag 0x08 automatically disables the i586 optimized routines.
#
+# ACPI Experimental Driver
+device acpi
+options ACPI_DEBUG
+options AML_DEBUG
+options ACPI_NO_ENABLE_ON_BOOT
+options ACPI_NO_OSDFUNC_INLINE
+
#
# Optional devices:
#
diff --git a/sys/conf/files b/sys/conf/files
index 4ac48a6..33817e7 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -71,6 +71,17 @@ ddb/db_trap.c optional ddb
ddb/db_variables.c optional ddb
ddb/db_watch.c optional ddb
ddb/db_write_cmd.c optional ddb
+dev/acpi/acpi.c count acpi
+dev/acpi/acpi_powerres.c optional acpi
+dev/acpi/aml/aml_amlmem.c optional acpi
+dev/acpi/aml/aml_common.c optional acpi
+dev/acpi/aml/aml_evalobj.c optional acpi
+dev/acpi/aml/aml_memman.c optional acpi
+dev/acpi/aml/aml_name.c optional acpi
+dev/acpi/aml/aml_obj.c optional acpi
+dev/acpi/aml/aml_parse.c optional acpi
+dev/acpi/aml/aml_store.c optional acpi
+dev/acpi/aml/aml_region.c optional acpi
dev/advansys/adv_eisa.c optional adv eisa
dev/advansys/adv_pci.c optional adv pci
dev/advansys/advansys.c optional adv
diff --git a/sys/conf/files.i386 b/sys/conf/files.i386
index c904e86..99c6096 100644
--- a/sys/conf/files.i386
+++ b/sys/conf/files.i386
@@ -144,6 +144,7 @@ gnu/i386/isa/sound/awe_wave.c optional awe
i386/apm/apm.c count apm
i386/i386/atomic.c standard \
compile-with "${CC} -c ${CFLAGS} ${DEFINED_PROF:S/^$/-fomit-frame-pointer/} ${.IMPSRC}"
+i386/i386/acpi_machdep.c optional acpi
i386/i386/autoconf.c standard
i386/i386/bios.c standard
i386/i386/bioscall.s standard
diff --git a/sys/conf/options b/sys/conf/options
index a181a80..d4ce246 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -449,3 +449,9 @@ FDC_DEBUG opt_fdc.h
PCFCLOCK_VERBOSE opt_pcfclock.h
PCFCLOCK_MAX_RETRIES opt_pcfclock.h
TDFX_LINUX opt_tdfx.h
+
+# options for ACPI support
+ACPI_DEBUG opt_acpi.h
+AML_DEBUG opt_acpi.h
+ACPI_NO_ENABLE_ON_BOOT opt_acpi.h
+ACPI_NO_OSDFUNC_INLINE opt_acpi.h
diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES
index c2c3678..b89221f 100644
--- a/sys/i386/conf/NOTES
+++ b/sys/i386/conf/NOTES
@@ -1193,6 +1193,13 @@ hint.npx.0.irq="13"
# Flag 0x08 automatically disables the i586 optimized routines.
#
+# ACPI Experimental Driver
+device acpi
+options ACPI_DEBUG
+options AML_DEBUG
+options ACPI_NO_ENABLE_ON_BOOT
+options ACPI_NO_OSDFUNC_INLINE
+
#
# Optional devices:
#
diff --git a/sys/i386/i386/bios.c b/sys/i386/i386/bios.c
index fdcdbc6..18f4989 100644
--- a/sys/i386/i386/bios.c
+++ b/sys/i386/i386/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/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index 5e0dcba..781ff87 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/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