diff options
author | jkim <jkim@FreeBSD.org> | 2009-06-05 18:44:36 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2009-06-05 18:44:36 +0000 |
commit | 6d358bddff8eb82625370b62ff77b8fc34b088c6 (patch) | |
tree | d775a86a0ebbf412e4960fa787e9a405073ca489 /sys/dev/acpica/Osd | |
parent | 40089f58a4f91db8bce335b75fbf69551f76b60e (diff) | |
download | FreeBSD-src-6d358bddff8eb82625370b62ff77b8fc34b088c6.zip FreeBSD-src-6d358bddff8eb82625370b62ff77b8fc34b088c6.tar.gz |
Import ACPICA 20090521.
Diffstat (limited to 'sys/dev/acpica/Osd')
-rw-r--r-- | sys/dev/acpica/Osd/OsdDebug.c | 6 | ||||
-rw-r--r-- | sys/dev/acpica/Osd/OsdHardware.c | 78 | ||||
-rw-r--r-- | sys/dev/acpica/Osd/OsdInterrupt.c | 4 | ||||
-rw-r--r-- | sys/dev/acpica/Osd/OsdMemory.c | 15 | ||||
-rw-r--r-- | sys/dev/acpica/Osd/OsdSchedule.c | 4 | ||||
-rw-r--r-- | sys/dev/acpica/Osd/OsdStream.c | 2 | ||||
-rw-r--r-- | sys/dev/acpica/Osd/OsdSynch.c | 5 | ||||
-rw-r--r-- | sys/dev/acpica/Osd/OsdTable.c | 25 |
8 files changed, 36 insertions, 103 deletions
diff --git a/sys/dev/acpica/Osd/OsdDebug.c b/sys/dev/acpica/Osd/OsdDebug.c index 27b94a0..8425357 100644 --- a/sys/dev/acpica/Osd/OsdDebug.c +++ b/sys/dev/acpica/Osd/OsdDebug.c @@ -41,8 +41,10 @@ __FBSDID("$FreeBSD$"); #include <ddb/ddb.h> #include <ddb/db_output.h> -#include <contrib/dev/acpica/acpi.h> -#include <contrib/dev/acpica/acdebug.h> +#include <contrib/dev/acpica/include/acpi.h> +#include <contrib/dev/acpica/include/accommon.h> +#include <contrib/dev/acpica/include/acdebug.h> + #include <dev/acpica/acpivar.h> UINT32 diff --git a/sys/dev/acpica/Osd/OsdHardware.c b/sys/dev/acpica/Osd/OsdHardware.c index 6e3beea..cf3cdd7 100644 --- a/sys/dev/acpica/Osd/OsdHardware.c +++ b/sys/dev/acpica/Osd/OsdHardware.c @@ -32,7 +32,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include <contrib/dev/acpica/acpi.h> +#include <contrib/dev/acpica/include/acpi.h> #include <sys/bus.h> #include <sys/kernel.h> @@ -65,75 +65,9 @@ __FBSDID("$FreeBSD$"); #define ACPI_BUS_HANDLE 0 #endif -/* - * Some BIOS vendors use AML to read/write directly to IO space. This - * can cause a problem if such accesses interfere with the OS's access to - * the same ports. Windows XP and newer systems block accesses to certain - * IO ports. We print a message or block accesses based on a tunable. - */ -static int illegal_bios_ports[] = { - 0x000, 0x00f, /* DMA controller 1 */ - 0x020, 0x021, /* PIC */ - 0x040, 0x043, /* Timer 1 */ - 0x048, 0x04b, /* Timer 2 failsafe */ - 0x070, 0x071, /* CMOS and RTC */ - 0x074, 0x076, /* Extended CMOS */ - 0x081, 0x083, /* DMA1 page registers */ - 0x087, 0x087, /* DMA1 ch0 low page */ - 0x089, 0x08b, /* DMA2 ch2 (0x89), ch3 low page (0x8a, 0x8b) */ - 0x08f, 0x091, /* DMA2 low page refresh (0x8f) */ - /* Arb ctrl port, card select feedback (0x90, 0x91) */ - 0x093, 0x094, /* System board setup */ - 0x096, 0x097, /* POS channel select */ - 0x0a0, 0x0a1, /* PIC (cascaded) */ - 0x0c0, 0x0df, /* ISA DMA */ - 0x4d0, 0x4d1, /* PIC ELCR (edge/level control) */ - 0xcf8, 0xcff, /* PCI config space. Microsoft adds 0xd00 also but - that seems incorrect. */ - -1, -1 -}; - -/* Block accesses to bad IO port addresses or just print a warning. */ -static int block_bad_io; -TUNABLE_INT("debug.acpi.block_bad_io", &block_bad_io); - -/* - * Look up bad ports in our table. Returns 0 if ok, 1 if marked bad but - * access is still allowed, or -1 to deny access. - */ -static int -acpi_os_check_port(UINT32 addr, UINT32 width) -{ - int error, *port; - - error = 0; - for (port = illegal_bios_ports; *port != -1; port += 2) { - if ((addr >= port[0] && addr <= port[1]) || - (addr < port[0] && addr + (width / 8) > port[0])) { - if (block_bad_io) - error = -1; - else - error = 1; - break; - } - } - - return (error); -} - ACPI_STATUS AcpiOsReadPort(ACPI_IO_ADDRESS InPort, UINT32 *Value, UINT32 Width) { - int error; - - error = acpi_os_check_port(InPort, Width); - if (error != 0) { - if (bootverbose) - printf("acpi: bad read from port 0x%03x (%d)\n", - (int)InPort, Width); - if (error == -1) - return (AE_BAD_PARAMETER); - } switch (Width) { case 8: @@ -159,16 +93,6 @@ AcpiOsReadPort(ACPI_IO_ADDRESS InPort, UINT32 *Value, UINT32 Width) ACPI_STATUS AcpiOsWritePort(ACPI_IO_ADDRESS OutPort, UINT32 Value, UINT32 Width) { - int error; - - error = acpi_os_check_port(OutPort, Width); - if (error != 0) { - if (bootverbose) - printf("acpi: bad write to port 0x%03x (%d), val %#x\n", - (int)OutPort, Width, Value); - if (error == -1) - return (AE_BAD_PARAMETER); - } switch (Width) { case 8: diff --git a/sys/dev/acpica/Osd/OsdInterrupt.c b/sys/dev/acpica/Osd/OsdInterrupt.c index c973124..158a2b9 100644 --- a/sys/dev/acpica/Osd/OsdInterrupt.c +++ b/sys/dev/acpica/Osd/OsdInterrupt.c @@ -39,7 +39,9 @@ __FBSDID("$FreeBSD$"); #include <machine/resource.h> #include <sys/rman.h> -#include <contrib/dev/acpica/acpi.h> +#include <contrib/dev/acpica/include/acpi.h> +#include <contrib/dev/acpica/include/accommon.h> + #include <dev/acpica/acpivar.h> #define _COMPONENT ACPI_OS_SERVICES diff --git a/sys/dev/acpica/Osd/OsdMemory.c b/sys/dev/acpica/Osd/OsdMemory.c index 3804bb6..8ed7a90 100644 --- a/sys/dev/acpica/Osd/OsdMemory.c +++ b/sys/dev/acpica/Osd/OsdMemory.c @@ -33,7 +33,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include <contrib/dev/acpica/acpi.h> +#include <contrib/dev/acpica/include/acpi.h> #include <sys/kernel.h> #include <sys/malloc.h> @@ -55,7 +55,7 @@ AcpiOsFree(void *Memory) } void * -AcpiOsMapMemory(ACPI_PHYSICAL_ADDRESS PhysicalAddress, ACPI_NATIVE_UINT Length) +AcpiOsMapMemory(ACPI_PHYSICAL_ADDRESS PhysicalAddress, ACPI_SIZE Length) { return (pmap_mapbios((vm_offset_t)PhysicalAddress, Length)); } @@ -80,17 +80,6 @@ AcpiOsValidateInterface (char *Interface) return (AE_SUPPORT); } -/* - * There is no clean way to do this. We make the charitable assumption - * that callers will not pass garbage to us. - */ -ACPI_STATUS -AcpiOsValidateAddress (UINT8 SpaceId, ACPI_PHYSICAL_ADDRESS Address, - ACPI_SIZE Length) -{ - return (AE_OK); -} - BOOLEAN AcpiOsReadable (void *Pointer, ACPI_SIZE Length) { diff --git a/sys/dev/acpica/Osd/OsdSchedule.c b/sys/dev/acpica/Osd/OsdSchedule.c index 795de93..fa91ed8 100644 --- a/sys/dev/acpica/Osd/OsdSchedule.c +++ b/sys/dev/acpica/Osd/OsdSchedule.c @@ -43,7 +43,9 @@ __FBSDID("$FreeBSD$"); #include <sys/proc.h> #include <sys/taskqueue.h> -#include <contrib/dev/acpica/acpi.h> +#include <contrib/dev/acpica/include/acpi.h> +#include <contrib/dev/acpica/include/accommon.h> + #include <dev/acpica/acpivar.h> #define _COMPONENT ACPI_OS_SERVICES diff --git a/sys/dev/acpica/Osd/OsdStream.c b/sys/dev/acpica/Osd/OsdStream.c index 8d1291a..81181db 100644 --- a/sys/dev/acpica/Osd/OsdStream.c +++ b/sys/dev/acpica/Osd/OsdStream.c @@ -32,7 +32,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include <contrib/dev/acpica/acpi.h> +#include <contrib/dev/acpica/include/acpi.h> void AcpiOsPrintf(const char *Format, ...) diff --git a/sys/dev/acpica/Osd/OsdSynch.c b/sys/dev/acpica/Osd/OsdSynch.c index b15b1ea..68fdcaa 100644 --- a/sys/dev/acpica/Osd/OsdSynch.c +++ b/sys/dev/acpica/Osd/OsdSynch.c @@ -32,7 +32,8 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include <contrib/dev/acpica/acpi.h> +#include <contrib/dev/acpica/include/acpi.h> +#include <contrib/dev/acpica/include/accommon.h> #include "opt_acpi.h" #include <sys/kernel.h> @@ -367,7 +368,7 @@ AcpiOsDeleteLock (ACPI_SPINLOCK Handle) * (and thus can't block) but since we have ithreads, we don't worry * about potentially blocking. */ -ACPI_NATIVE_UINT +ACPI_CPU_FLAGS AcpiOsAcquireLock (ACPI_SPINLOCK Handle) { struct acpi_spinlock *h = (struct acpi_spinlock *)Handle; diff --git a/sys/dev/acpica/Osd/OsdTable.c b/sys/dev/acpica/Osd/OsdTable.c index d9b29eb..55f674d 100644 --- a/sys/dev/acpica/Osd/OsdTable.c +++ b/sys/dev/acpica/Osd/OsdTable.c @@ -36,8 +36,8 @@ __FBSDID("$FreeBSD$"); #include <sys/kernel.h> #include <sys/linker.h> -#include <contrib/dev/acpica/acpi.h> -#include <contrib/dev/acpica/actables.h> +#include <contrib/dev/acpica/include/acpi.h> +#include <contrib/dev/acpica/include/actables.h> #undef _COMPONENT #define _COMPONENT ACPI_TABLES @@ -67,17 +67,30 @@ ACPI_STATUS AcpiOsTableOverride(ACPI_TABLE_HEADER *ExistingTable, ACPI_TABLE_HEADER **NewTable) { - caddr_t acpi_dsdt, p; + char modname[] = "acpi_dsdt"; + caddr_t acpi_table, p, s; if (ExistingTable == NULL || NewTable == NULL) return (AE_BAD_PARAMETER); +#ifdef notyet + for (int i = 0; i < ACPI_NAME_SIZE; i++) + modname[i + 5] = tolower(ExistingTable->Signature[i]); +#else /* If we're not overriding the DSDT, just return. */ - if ((acpi_dsdt = preload_search_by_type("acpi_dsdt")) == NULL || - (p = preload_search_info(acpi_dsdt, MODINFO_ADDR)) == NULL) { + if (strncmp(ExistingTable->Signature, ACPI_SIG_DSDT, ACPI_NAME_SIZE) != 0) { *NewTable = NULL; - } else + return (AE_OK); + } +#endif + + if ((acpi_table = preload_search_by_type(modname)) != NULL && + (p = preload_search_info(acpi_table, MODINFO_ADDR)) != NULL && + (s = preload_search_info(acpi_table, MODINFO_SIZE)) != NULL && + *(size_t *)s != 0) *NewTable = *(ACPI_TABLE_HEADER **)p; + else + *NewTable = NULL; return (AE_OK); } |