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
This commit is contained in:
parent
2e83f63844
commit
b1f12b6157
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=65292
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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:
|
||||
#
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
#
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user