diff -ur /home/ctm/src/sys/i386/conf/LINT ./conf/LINT --- /home/ctm/src/sys/i386/conf/LINT Thu Sep 23 22:34:10 1999 +++ ./conf/LINT Thu Sep 23 23:33:26 1999 @@ -996,6 +996,9 @@ # Flag 0x08 automatically disables the i586 optimized routines. # +#ACPI Experimental Driver +controller acpi0 +options ACPI_DEBUG # # Optional ISA and EISA devices: # diff -ur /home/ctm/src/sys/i386/conf/files.i386 ./conf/files.i386 --- /home/ctm/src/sys/i386/conf/files.i386 Thu Sep 23 22:34:10 1999 +++ ./conf/files.i386 Thu Sep 23 23:12:21 1999 @@ -161,6 +161,7 @@ i386/i386/userconfig.c optional userconfig i386/i386/vm86.c standard i386/i386/vm_machdep.c standard +i386/i386/acpi.c optional acpi i386/ibcs2/ibcs2_errno.c optional ibcs2 i386/ibcs2/ibcs2_fcntl.c optional ibcs2 i386/ibcs2/ibcs2_ioctl.c optional ibcs2 Only in ./conf: files.i386~ diff -ur /home/ctm/src/sys/i386/conf/options.i386 ./conf/options.i386 --- /home/ctm/src/sys/i386/conf/options.i386 Fri Sep 3 03:15:44 1999 +++ ./conf/options.i386 Thu Sep 23 23:32:24 1999 @@ -191,5 +191,9 @@ NDGBPORTS opt_dgb.h # ------------------------------- +# ACPI Debug options +# ------------------------------- +ACPI_DEBUG opt_acpi.h +# ------------------------------- # EOF # ------------------------------- diff -ur /home/ctm/src/sys/i386/i386/bios.c ./i386/bios.c --- /home/ctm/src/sys/i386/i386/bios.c Thu Sep 23 11:02:55 1999 +++ ./i386/bios.c Thu Sep 23 23:25:32 1999 @@ -30,7 +30,7 @@ /* * Code for dealing with the BIOS in x86 PC systems. */ - +#include "acpi.h" #include #include #include @@ -45,7 +45,9 @@ #include #include #include - +#if NACPI > 0 +#include +#endif #define BIOS_START 0xe0000 #define BIOS_SIZE 0x20000 @@ -134,11 +136,29 @@ 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 -ur /home/ctm/src/sys/i386/i386/machdep.c ./i386/machdep.c --- /home/ctm/src/sys/i386/i386/machdep.c Thu Sep 9 08:17:07 1999 +++ ./i386/machdep.c Thu Sep 23 23:06:00 1999 @@ -37,7 +37,7 @@ * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 * $FreeBSD: src/sys/i386/i386/machdep.c,v 1.361 1999/09/07 20:02:24 luoqi Exp $ */ - +#include "acpi.h" #include "apm.h" #include "ether.h" #include "npx.h" @@ -128,6 +128,10 @@ #include #include +#if NACPI > 0 +#include +#endif + extern void init386 __P((int first)); extern void dblfault_handler __P((void)); @@ -1272,7 +1276,13 @@ (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;