From 2341453070341cc8dea5ec012c208c3b98481699 Mon Sep 17 00:00:00 2001 From: jmcmullan Date: Fri, 6 Dec 2013 21:24:42 +0000 Subject: [PATCH] acpi.resource: Remove obsoleted acpi.resource This has been replaced with the acpica.library, based off of the Intel ACPICA sources. Signed-off-by: Jason S. McMullan git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@48535 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- arch/all-pc/acpi/acpi.conf | 19 -- arch/all-pc/acpi/acpi_init.c | 360 --------------------- arch/all-pc/acpi/acpi_intern.h | 18 -- arch/all-pc/acpi/acpi_tables.c | 27 -- arch/all-pc/acpi/findsdt.c | 73 ----- arch/all-pc/acpi/gas_io.h | 4 - arch/all-pc/acpi/mmakefile.src | 11 - arch/all-pc/acpi/oemblacklist.c | 109 ------- arch/all-pc/acpi/readreg.c | 137 -------- arch/all-pc/acpi/scanentries.c | 109 ------- arch/all-pc/acpi/scansdt.c | 77 ----- arch/all-pc/acpi/writereg.c | 108 ------- compiler/include/resources/acpi.h | 521 ------------------------------ rom/exec/exec_init.c | 2 +- rom/mmakefile.src | 2 +- test/cplusplus/headertest.cpp | 2 - workbench/locale/help/English/options.txt | 4 +- 17 files changed, 4 insertions(+), 1579 deletions(-) delete mode 100644 arch/all-pc/acpi/acpi.conf delete mode 100644 arch/all-pc/acpi/acpi_init.c delete mode 100644 arch/all-pc/acpi/acpi_intern.h delete mode 100644 arch/all-pc/acpi/acpi_tables.c delete mode 100644 arch/all-pc/acpi/findsdt.c delete mode 100644 arch/all-pc/acpi/gas_io.h delete mode 100644 arch/all-pc/acpi/mmakefile.src delete mode 100644 arch/all-pc/acpi/oemblacklist.c delete mode 100644 arch/all-pc/acpi/readreg.c delete mode 100644 arch/all-pc/acpi/scanentries.c delete mode 100644 arch/all-pc/acpi/scansdt.c delete mode 100644 arch/all-pc/acpi/writereg.c delete mode 100644 compiler/include/resources/acpi.h diff --git a/arch/all-pc/acpi/acpi.conf b/arch/all-pc/acpi/acpi.conf deleted file mode 100644 index 362b688796..0000000000 --- a/arch/all-pc/acpi/acpi.conf +++ /dev/null @@ -1,19 +0,0 @@ -##begin config -version 1.0 -residentpri 125 -libbase ACPIBase -libbasetypeextern struct ACPIBase -options nostubs -##end config - -##begin cdefprivate -#include -##end cdefprivate - -##begin functionlist -APTR ACPI_FindSDT(ULONG id) (D0) -ULONG ACPI_ScanEntries(struct ACPI_TABLE_DEF_HEADER *table, WORD type, const struct Hook *hook, APTR userData) (A0, D0, A1, A2) -IPTR ACPI_ReadReg(struct GENERIC_ACPI_ADDR *addr) (A0) -void ACPI_WriteReg(struct GENERIC_ACPI_ADDR *addr, IPTR value) (A0, D0) -ULONG ACPI_ScanSDT(ULONG id, const struct Hook *hook, APTR userData) (D0, A0, A1) -##end functionlist diff --git a/arch/all-pc/acpi/acpi_init.c b/arch/all-pc/acpi/acpi_init.c deleted file mode 100644 index 7e98a4ab08..0000000000 --- a/arch/all-pc/acpi/acpi_init.c +++ /dev/null @@ -1,360 +0,0 @@ -/* - Copyright © 1995-2012, The AROS Development Team. All rights reserved. - $Id$ -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "acpi_intern.h" - -static void *core_ACPIRootSystemDescriptionPointerScan(IPTR scan_start, IPTR scan_length) -{ - unsigned long scan_offset; - unsigned char *scan_ptr; - - /* Scan for the Root System Description Pointer signature - on 16-byte boundaries of the physical memory region */ - for (scan_offset = 0; scan_offset < scan_length; scan_offset += 16) - { - scan_ptr = (unsigned char *)scan_start + scan_offset; - - if (!memcmp(scan_ptr, "RSD PTR ", 8)) - { - /* We have the signature, let's check the checksum*/ - struct ACPI_TABLE_TYPE_RSDP *rsdp = (struct ACPI_TABLE_TYPE_RSDP *)scan_ptr; - - if (!acpi_CheckSum(scan_ptr, (rsdp->revision < 2) ? 20 : rsdp->length)) - { - /* RSDP located, return its address */ - return scan_ptr; - } - D(bug("[ACPI] Wrong RDSP checksum at 0x%p\n", scan_ptr)); - } - } - - return NULL; -} - -static const uuid_t acpi_20_guid = ACPI_20_TABLE_GUID; -static const uuid_t acpi_10_guid = ACPI_TABLE_GUID; - -/* Attempt to locate the ACPI Root System Description Pointer */ -static void *core_ACPIRootSystemDescriptionPointerLocate(struct EFIBase *EFIBase) -{ - struct ACPI_TABLE_TYPE_RSDP *RSDP_PhysAddr; - - D(bug("[ACPI] efi.resource 0x%p\n", EFIBase)); - if (EFIBase) - { - /* If we have EFI firmware, the best way to obtain RSDP is to ask it. */ - RSDP_PhysAddr = EFI_FindConfigTable(&acpi_20_guid); - if (RSDP_PhysAddr) - { - D(bug("[ACPI] Got RSDP 2.0 from EFI @ 0x%p\n", RSDP_PhysAddr)); - - if (!memcmp(RSDP_PhysAddr, "RSD PTR ", 8) && !acpi_CheckSum(RSDP_PhysAddr, RSDP_PhysAddr->length)) - return RSDP_PhysAddr; - - D(bug("[ACPI] Broken RSDP\n")); - } - - RSDP_PhysAddr = EFI_FindConfigTable(&acpi_10_guid); - if (RSDP_PhysAddr) - { - D(bug("[ACPI] Got RSDP 1.0 from EFI @ 0x%p\n", RSDP_PhysAddr)); - - if (!memcmp(RSDP_PhysAddr, "RSD PTR ", 8) && !acpi_CheckSum(RSDP_PhysAddr, 20)) - return RSDP_PhysAddr; - - D(bug("[ACPI] Broken RSDP\n")); - } - - /* - * If there's no RSDP in EFI tables, we'll search for it, just in case. - * However, to tell the truth, we are unlikely to find it. For example - * on MacMini RSDP is located neither in EBDA nor in ROM space. - * Specification Rev 4.0a explicitly says that on UEFI systems RSDP - * pointer should be obtained from within EFI system table. - */ - } - - /* - * Search the first Kilobyte of the Extended BIOS Data Area. - * On x86-64 zero page is protected, on i386 it will someday be too. - * This code relies on the fact that InitCode(RTF_SINGLETASK) is called with - * supervisor privileges. With them you can at least read these locations. - */ - RSDP_PhysAddr = core_ACPIRootSystemDescriptionPointerScan(0x00000000, 0x00000400); - - if (RSDP_PhysAddr != NULL) - { - D(bug("[ACPI] RSDP found in EBDA @ %p\n", RSDP_PhysAddr)); - return RSDP_PhysAddr; - } - - /* Search in BIOS ROM address space */ - if ((RSDP_PhysAddr = core_ACPIRootSystemDescriptionPointerScan(0x000E0000, 0x00020000)) != NULL) - { - D(bug("[ACPI] RSDP found in BIOS ROM space @ %p\n", RSDP_PhysAddr)); - return RSDP_PhysAddr; - } - - return NULL; -} - -/**********************************************************/ -static int acpi_ParseSDT(struct ACPIBase *ACPIBase) -{ - struct ACPI_TABLE_TYPE_RSDP *RSDP = ACPIBase->ACPIB_RSDP_Addr; - struct ACPI_TABLE_TYPE_RSDT *RSDT = (APTR)(IPTR)RSDP->rsdt_address; - struct ACPI_TABLE_TYPE_XSDT *XSDT = (RSDP->revision >= 2) ? (APTR)(IPTR)RSDP->xsdt_address : NULL; - unsigned int i; - - D(bug("[ACPI] acpi_ParseSDT: ACPI v2 XSDT @ %p, ACPI v1 RSDT @ %p\n", XSDT, RSDT)); - - if (!acpi_CheckTable(&XSDT->header, ACPI_MAKE_ID('X', 'S', 'D', 'T'))) - { - ACPIBase->ACPIB_SDT_Addr = &XSDT->header; - - ACPIBase->ACPIB_SDT_Count = (XSDT->header.length - sizeof(struct ACPI_TABLE_DEF_HEADER)) >> 3; - D(bug("[ACPI] acpi_ParseSDT: XSDT size: %u entries\n", ACPIBase->ACPIB_SDT_Count)); - - if (ACPIBase->ACPIB_SDT_Count == 0) - { - /* ???? */ - return 1; - } - - /* Plus 1 in order to reserve one pointer for DSDT */ - ACPIBase->ACPIB_SDT_Entry = AllocMem((ACPIBase->ACPIB_SDT_Count + 1) * sizeof(APTR), MEMF_ANY); - if (!ACPIBase->ACPIB_SDT_Entry) - { - D(bug("[ACPI] Failed to allocate memory for XSDT entries!\n")); - return 0; - } - - D(bug("[ACPI] acpi_ParseSDT: Copying Tables Start\n")); - for (i = 0; i < ACPIBase->ACPIB_SDT_Count; i++) - { - ACPIBase->ACPIB_SDT_Entry[i] = (APTR)(IPTR)XSDT->entry[i]; - D(bug("[ACPI] acpi_ParseSDT: Table %u Entry @ %p\n", i, ACPIBase->ACPIB_SDT_Entry[i])); - } - - D(bug("[ACPI] acpi_ParseSDT: Copying Tables done!\n")); - return 1; - } - - D(bug("[ACPI] Broken (or no) XSDT, trying RSDT...\n")); - - /* If there is no (or damager) XSDT, then check RSDT */ - if (!acpi_CheckTable(&RSDT->header, ACPI_MAKE_ID('R', 'S', 'D', 'T'))) - { - ACPIBase->ACPIB_SDT_Addr = &RSDT->header; - - ACPIBase->ACPIB_SDT_Count = (RSDT->header.length - sizeof(struct ACPI_TABLE_DEF_HEADER)) >> 2; - D(bug("[ACPI] acpi_ParseSDT: RSDT size: %u entries\n", ACPIBase->ACPIB_SDT_Count)); - - if (ACPIBase->ACPIB_SDT_Count == 0) - { - /* ???? */ - return 1; - } - - /* Plus 1 in order to reserve one pointer for DSDT */ - ACPIBase->ACPIB_SDT_Entry = AllocMem((ACPIBase->ACPIB_SDT_Count + 1) * sizeof(APTR), MEMF_ANY); - if (!ACPIBase->ACPIB_SDT_Entry) - { - D(bug("[ACPI] Failed to allocate memory for RSDT entries!\n")); - return 0; - } - - D(bug("[ACPI] acpi_ParseSDT: Copying Tables Start\n")); - for (i = 0; i < ACPIBase->ACPIB_SDT_Count; i++) - { - ACPIBase->ACPIB_SDT_Entry[i] = (APTR)(IPTR)RSDT->entry[i]; - D(bug("[ACPI] acpi_ParseSDT: Table %u Entry @ %p\n", i, ACPIBase->ACPIB_SDT_Entry[i])); - } - - D(bug("[ACPI] acpi_ParseSDT: Copying Tables done!\n")); - return 1; - } - - D(bug("[ACPI] Broken (or no) RSDT\n")); - - return 0; -} - -static int acpi_CheckSDT(struct ACPIBase *ACPIBase) -{ - struct ACPI_TABLE_TYPE_FADT *FADT = NULL; - struct ACPI_TABLE_DEF_HEADER *header; - unsigned int c = 0; - unsigned int i; - - D(bug("[ACPI] Checking SDT Tables..\n")); - - for (i = 0; i < ACPIBase->ACPIB_SDT_Count; i++) - { - header = ACPIBase->ACPIB_SDT_Entry[i]; - - if (header == NULL) - { - D(bug("[ACPI] NULL pointer for table %u\n", i)); - continue; - } - - D(bug("[ACPI] Table %d Header @ %p, sig='%4.4s'\n", i, header, &header->signature)); - - if (acpi_CheckSum(header, header->length)) - { - D(bug("[ACPI] WARNING - SDT %d Checksum invalid\n", i)); - /* Throw away broken table */ - continue; - } - - /* Pack our array, to simplify access to it */ - ACPIBase->ACPIB_SDT_Entry[c++] = header; - - if (header->signature == ACPI_MAKE_ID('F', 'A', 'C', 'P')) - FADT = (struct ACPI_TABLE_TYPE_FADT *)header; - } - - D(bug("[ACPI] Tables checked, %u of %u good\n", ACPIBase->ACPIB_SDT_Count, c)); - - if (FADT) - { - /* Map the DSDT header via the pointer in the FADT */ - header = (APTR)(IPTR)FADT->dsdt_addr; - D(bug("[ACPI] Got DSDT at 0x%p\n", header)); - - if (!acpi_CheckTable(header, ACPI_MAKE_ID('D', 'S', 'D', 'T'))) - { - D(bug("[ACPI] DSDT checked, good\n")); - /* We have reserved this pointer above, when allocated SDT array */ - ACPIBase->ACPIB_SDT_Entry[c++] = header; - } - } - - /* Fix up tables count */ - ACPIBase->ACPIB_SDT_Count = c; - return c; -} - -AROS_INTH1(static ResetHandler, struct ACPIBase *, ACPIBase) -{ - AROS_INTFUNC_INIT - - UBYTE action = ACPIBase->ACPIB_ResetHandler.is_Node.ln_Type; - struct ACPI_TABLE_TYPE_FADT *fadt = - ACPI_FindSDT(ACPI_MAKE_ID('F','A','C','P')); - - D(bug("[ACPI.ShutdownA] FADT 0x%p\n", fadt)); - - switch (action) - { - case SD_ACTION_COLDREBOOT: - - /* Use reset register */ - D(bug("[ACPI.ShutdownA] Reset register 0x%p, value 0x%02X\n", - (IPTR)fadt->reset_reg.address, fadt->reset_value)); - ACPI_WriteReg(&fadt->reset_reg, fadt->reset_value); - - /* We really should not return from that */ - break; - } - - return FALSE; - - AROS_INTFUNC_EXIT -} - -static int acpi_Init(struct ACPIBase *ACPIBase) -{ - APTR KernelBase; - struct EFIBase *EFIBase; - - /* - * We are part of package. To make user's life simpler, we allow to disable ourselves - * without repacking. - */ - KernelBase = OpenResource("kernel.resource"); - if (KernelBase) - { - struct TagItem *cmdline = LibFindTagItem(KRN_CmdLine, KrnGetBootInfo()); - - if (cmdline) - { - if (strcasestr((char *)cmdline->ti_Data, "noacpi")) - { - D(bug("[ACPI] Disabled from command line\n")); - return FALSE; - } - } - } - - EFIBase = OpenResource("efi.resource"); - - ACPIBase->ACPIB_RSDP_Addr = core_ACPIRootSystemDescriptionPointerLocate(EFIBase); - if (!ACPIBase->ACPIB_RSDP_Addr) - { - D(bug("[ACPI] No RSDP found, giving up...\n")); - return FALSE; - } - - /* - * Cache OEM and revision for simpler access. - * Using memcpy() here allows the compiler to optimize 6 bytes copy. - */ - memcpy(ACPIBase->ACPI_OEM_ID, ACPIBase->ACPIB_RSDP_Addr->oem_id, sizeof(ACPIBase->ACPI_OEM_ID)); - ACPIBase->ACPI_Revision = ACPIBase->ACPIB_RSDP_Addr->revision; - - /* Parse SDT, canonicalize addresses of tables pointed to by it */ - if (!acpi_ParseSDT(ACPIBase)) - { - D(bug("[ACPI] No valid System Description Table (SDT) specified in RSDP!\n")); - return FALSE; - } - - /* Validate SDT tables */ - if (!acpi_CheckSDT(ACPIBase)) - { - D(bug("[ACPI] None of SDT entries are valid\n")); - return FALSE; - } - -#ifdef ENABLE_BLACKLIST - /* - * Blacklist mainly affects DSDT. Other tables still contain useful information. - * Currently blacklist is disabled because we do not interpret ASL at all. - * Perhaps it should go back in some other place, but not here. - */ - if (acpi_IsBlacklisted(ACPIBase)) - { - D(bug("[ACPI] Blacklisted\n")); - return FALSE; - } -#endif - - /* Install ACPI reset handler. It has a lower priority than the EFI - * reset handler (for example), so will only be used if better - * mechanisms fail */ - ACPIBase->ACPIB_ResetHandler.is_Node.ln_Pri = -60; - ACPIBase->ACPIB_ResetHandler.is_Code = (VOID_FUNC)ResetHandler; - ACPIBase->ACPIB_ResetHandler.is_Data = ACPIBase; - AddResetCallback(&ACPIBase->ACPIB_ResetHandler); - - return TRUE; -} - -ADD2INITLIB(acpi_Init, 0); diff --git a/arch/all-pc/acpi/acpi_intern.h b/arch/all-pc/acpi/acpi_intern.h deleted file mode 100644 index 4a797959a3..0000000000 --- a/arch/all-pc/acpi/acpi_intern.h +++ /dev/null @@ -1,18 +0,0 @@ -unsigned char acpi_CheckTable(struct ACPI_TABLE_DEF_HEADER *header, ULONG id); -int acpi_IsBlacklisted(struct ACPIBase *ACPIBase); - -AROS_LD1(ULONG, ShutdownA, - AROS_LHA(ULONG, action, D0), - struct ExecBase *, SysBase, 173, Acpi); - -/* Result of this must be zero */ -static inline unsigned char acpi_CheckSum(void *addr, unsigned int size) -{ - unsigned char *j = addr; - unsigned char *k = j + size; - unsigned char sum = 0; - - for (; j < k; sum += *(j++)); - - return sum; -} diff --git a/arch/all-pc/acpi/acpi_tables.c b/arch/all-pc/acpi/acpi_tables.c deleted file mode 100644 index 6d1360ce36..0000000000 --- a/arch/all-pc/acpi/acpi_tables.c +++ /dev/null @@ -1,27 +0,0 @@ -#include -#include -#include - -#include "acpi_intern.h" - -/************************************************************************************************ - ACPI RELATED FUNCTIONS - ************************************************************************************************/ - -unsigned char acpi_CheckTable(struct ACPI_TABLE_DEF_HEADER *header, ULONG id) -{ - /* First of all, pointer can't be NULL */ - if (!header) - { - D(bug("[ACPI] ERROR - NULL pointer for '%4.4s'\n", &id)); - return 1; - } - - if (header->signature != id) - { - D(bug("[ACPI] ERROR - bad signature [table @ %p, wanted '%4.4s', have '%4.4s']\n", header, &id, &header->signature)); - return 1; - } - - return acpi_CheckSum(header, header->length); -} diff --git a/arch/all-pc/acpi/findsdt.c b/arch/all-pc/acpi/findsdt.c deleted file mode 100644 index f08f980baf..0000000000 --- a/arch/all-pc/acpi/findsdt.c +++ /dev/null @@ -1,73 +0,0 @@ -#include -#include - -/***************************************************************************** - - NAME */ -#include - - AROS_LH1(APTR, ACPI_FindSDT, - -/* SYNOPSIS */ - AROS_LHA(ULONG, id, D0), - -/* LOCATION */ - struct ACPIBase *, ACPIBase, 1, Acpi) - -/* FUNCTION - Locate a system description table with a given 4-character ID - - INPUTS - id - a table ID (use ACPI_MAKE_ID() macro to get it) - - RESULT - A pointer to a table or NULL if can't be found - - NOTES - Some systems may include duplicating tables, often it's MADT. - In this case a table with the latest revision number will - be returned. - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - struct ACPI_TABLE_DEF_HEADER *found = NULL; - struct ACPI_TABLE_DEF_HEADER *header; - unsigned int i; - - D(bug("[ACPI] acpi_LocateSDT('%4.4s')\n", &id)); - - /* Locate the table. */ - for (i = 0; i < ACPIBase->ACPIB_SDT_Count; i++) - { - header = ACPIBase->ACPIB_SDT_Entry[i]; - - if (header->signature == id) - { - D(bug("[ACPI] acpi_LocateSDT: Table %4.4s pointer 0x%p rev %u\n", &header->signature, header, header->revision)); - - /* - * Some firmwares have a strange thing - they contain multiple tables with the same signature - * and different revisions. A common example is MADT table. - * Here we select a table with the latest revision. ACPI specs don't say anything clear - * about this. - * Such behavior is exposed for example by MacMini EFI. - */ - if ((found == NULL) || (header->revision > found->revision)) - found = header; - } - } - - return found; - - AROS_LIBFUNC_EXIT -} diff --git a/arch/all-pc/acpi/gas_io.h b/arch/all-pc/acpi/gas_io.h deleted file mode 100644 index e6ff3455f7..0000000000 --- a/arch/all-pc/acpi/gas_io.h +++ /dev/null @@ -1,4 +0,0 @@ -extern const unsigned char FullSize[]; - -unsigned char GetSize(struct GENERIC_ACPI_ADDR *reg); -IPTR ReadRegInt(struct GENERIC_ACPI_ADDR *reg, unsigned char size); diff --git a/arch/all-pc/acpi/mmakefile.src b/arch/all-pc/acpi/mmakefile.src deleted file mode 100644 index 24046eae0f..0000000000 --- a/arch/all-pc/acpi/mmakefile.src +++ /dev/null @@ -1,11 +0,0 @@ -# $Id$ -include $(TOP)/config/make.cfg - -FILES := acpi_init acpi_tables oemblacklist -FUNCS := findsdt scanentries readreg writereg scansdt - -%build_module mmake=kernel-pc-acpi \ - modname=acpi modtype=resource \ - files="$(FILES) $(FUNCS)" - -%common diff --git a/arch/all-pc/acpi/oemblacklist.c b/arch/all-pc/acpi/oemblacklist.c deleted file mode 100644 index 554d310650..0000000000 --- a/arch/all-pc/acpi/oemblacklist.c +++ /dev/null @@ -1,109 +0,0 @@ -#include -#include -#include - -#include - -#include "acpi_intern.h" - -#ifdef ENABLE_BLACKLIST - -/* - Everything that doesnt work MUST be put on the OEMBlacklist!!! - If the problem is critical - mark it as such -*/ - -enum acpi_oemblacklist_revisionmatch -{ - all_versions, - less_than_or_equal, - equal, - greater_than_or_equal, -}; - -struct acpi_oemblacklist_entry -{ - char oem_id[7]; - char oem_table_id[9]; - unsigned int oem_revision; - unsigned int acpi_tableid; - enum acpi_oemblacklist_revisionmatch oem_revision_match; - char *blacklist_reason; - unsigned int blacklist_critical; -}; - -static const struct acpi_oemblacklist_entry _ACPI_OEMBlacklist[] = -{ -/* ASUS K7M */ - {"ASUS ", "K7M ", 0x00001000, ACPI_MAKE_ID('D', 'S', 'D', 'T'), less_than_or_equal, "Field beyond end of region", 0}, -/* ASUS P2B-S */ - {"ASUS\0\0", "P2B-S ", 0x00000000, ACPI_MAKE_ID('D', 'S', 'D', 'T'), all_versions, "Bogus PCI routing", 1}, -/* Seattle 2 - old BIOS rev. */ - {"INTEL ", "440BX ", 0x00001000, ACPI_MAKE_ID('D', 'S', 'D', 'T'), less_than_or_equal, "Field beyond end of region", 0}, -/* Intel 810 Motherboard */ - {"MNTRAL", "MO81010A", 0x00000012, ACPI_MAKE_ID('D', 'S', 'D', 'T'), less_than_or_equal, "Field beyond end of region", 0}, -/* Compaq Presario 711FR */ - {"COMAPQ", "EAGLES", 0x06040000, ACPI_MAKE_ID('D', 'S', 'D', 'T'), less_than_or_equal, "SCI issues (C2 disabled)", 0}, -/* Compaq Presario 1700 */ - {"PTLTD ", " DSDT ", 0x06040000, ACPI_MAKE_ID('D', 'S', 'D', 'T'), less_than_or_equal, "Multiple problems", 1}, -/* Sony FX120, FX140, FX150? */ - {"SONY ", "U0 ", 0x20010313, ACPI_MAKE_ID('D', 'S', 'D', 'T'), less_than_or_equal, "ACPI driver problem", 1}, -/* Compaq Presario 800, Insyde BIOS */ - {"INT440", "SYSFexxx", 0x00001001, ACPI_MAKE_ID('D', 'S', 'D', 'T'), less_than_or_equal, "Does not use _REG to protect EC OpRegions", 1}, -/* IBM 600E - _ADR should return 7, but it returns 1 */ - {"IBM ", "TP600E ", 0x00000105, ACPI_MAKE_ID('D', 'S', 'D', 'T'), less_than_or_equal, "Incorrect _ADR", 1}, -/* Portege 7020, BIOS 8.10 */ - {"TOSHIB", "7020CT ", 0x19991112, ACPI_MAKE_ID('D', 'S', 'D', 'T'), all_versions, "Implicit Return", 0}, -/* Portege 4030 */ - {"TOSHIB", "4030 ", 0x19991112, ACPI_MAKE_ID('D', 'S', 'D', 'T'), all_versions, "Implicit Return", 0}, -/* Portege 310/320, BIOS 7.1 */ - {"TOSHIB", "310 ", 0x19990511, ACPI_MAKE_ID('D', 'S', 'D', 'T'), all_versions, "Implicit Return", 0}, - {"\0"} -}; - -/**********************************************************/ -int acpi_IsBlacklisted(struct ACPIBase *ACPIBase) -{ - int i = 0; - struct ACPI_TABLE_DEF_HEADER *table_header; - - D(bug("[ACPI] core_ACPIIsBlacklisted()\n")); - - for (i = 0; _ACPI_OEMBlacklist[i].oem_id[0] != '\0'; i++) - { - table_header = ACPI_FindSDT(_ACPI_OEMBlacklist[i].acpi_tableid); - - if (!table_header) - continue; - - if (strncmp(_ACPI_OEMBlacklist[i].oem_id, table_header->oem_id, 6)) - continue; - - if (strncmp(_ACPI_OEMBlacklist[i].oem_table_id, table_header->oem_table_id, 8)) - i++; - continue; - - if (table_header != NULL) - { - if ((_ACPI_OEMBlacklist[i].oem_revision_match == all_versions) || - ((_ACPI_OEMBlacklist[i].oem_revision_match == less_than_or_equal) && - (table_header->oem_revision <= _ACPI_OEMBlacklist[i].oem_revision)) || - ((_ACPI_OEMBlacklist[i].oem_revision_match == greater_than_or_equal) && - (table_header->oem_revision >= _ACPI_OEMBlacklist[i].oem_revision)) || - ((_ACPI_OEMBlacklist[i].oem_revision_match == equal) && - (table_header->oem_revision == _ACPI_OEMBlacklist[i].oem_revision))) - { - bug("[ACPI] core_ACPIIsBlacklisted: ERROR - Vendor \"%6.6s\" System \"%8.8s\" Revision 0x%x has a known ACPI BIOS problem.\n", - _ACPI_OEMBlacklist[i].oem_id, _ACPI_OEMBlacklist[i].oem_table_id, _ACPI_OEMBlacklist[i].oem_revision); - bug("[ACPI] core_ACPIIsBlacklisted: ERROR - Reason: %s. This is a %s error\n", - _ACPI_OEMBlacklist[i].blacklist_reason, ( _ACPI_OEMBlacklist[i].blacklist_critical ? "non-recoverable" : "recoverable" )); - - return _ACPI_OEMBlacklist[i].blacklist_critical; - } - } - } - - return 0; -} - -#endif diff --git a/arch/all-pc/acpi/readreg.c b/arch/all-pc/acpi/readreg.c deleted file mode 100644 index 680eb9166c..0000000000 --- a/arch/all-pc/acpi/readreg.c +++ /dev/null @@ -1,137 +0,0 @@ -#include -#include - -#include "gas_io.h" - -/***************************************************************************** - - NAME */ -#include - - AROS_LH1I(IPTR, ACPI_ReadReg, - -/* SYNOPSIS */ - AROS_LHA(struct GENERIC_ACPI_ADDR *, reg, A0), - -/* LOCATION */ - struct ACPIBase *, ACPIBase, 3, Acpi) - -/* FUNCTION - Read a value from the register specified by GAS - - INPUTS - reg - a pointer to a generic address structure - - RESULT - A value read from the register - - NOTES - Only memory and I/O spaces are supported. - 64-bit registers are supported only in memory space and only on 64-bit platforms. - The given GAS must address a complete register, not a data structure. - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - unsigned char size = GetSize(reg); - IPTR val = ReadRegInt(reg, size); - - if (reg->register_bit_width != FullSize[reg->size]) - { - /* - * Partial bit field. - * Mask out the needed bits and shift to the right. - */ - unsigned long mask = (1 << reg->register_bit_width) - 1; - - val = (val >> reg->register_bit_offset) & mask; - } - - return val; - - AROS_LIBFUNC_EXIT -} - -const unsigned char FullSize[] = {0, 8, 16, 32, 64}; - -unsigned char GetSize(struct GENERIC_ACPI_ADDR *reg) -{ - unsigned char size = reg->size; - - if (size == ACPI_SIZE_UNDEFINED) - { - /* Need to compute register size */ - unsigned char bits = reg->register_bit_offset + reg->register_bit_width; - - if (bits <= 8) - size = ACPI_SIZE_BYTE; - else if (bits <= 16) - size = ACPI_SIZE_WORD; - else if (bits <= 32) - size = ACPI_SIZE_DWORD; - else - size = ACPI_SIZE_QUAD; - } - return size; -} - -IPTR ReadRegInt(struct GENERIC_ACPI_ADDR *reg, unsigned char size) -{ - IPTR val = 0; - - switch (reg->address_space_id) - { - case ACPI_SPACE_MEM: - switch (size) - { - case ACPI_SIZE_BYTE: - val = *((UBYTE *)(IPTR)reg->address); - break; - - case ACPI_SIZE_WORD: - val = *((UWORD *)(IPTR)reg->address); - break; - - case ACPI_SIZE_DWORD: - val = *((ULONG *)(IPTR)reg->address); - break; - -#if __WORDSIZE == 64 - case ACPI_SIZE_QUAD: - val = *((UQUAD *)(IPTR)reg->address); - break; -#endif - } - break; - - case ACPI_SPACE_IO: - switch (size) - { - case ACPI_SIZE_BYTE: - val = inb(reg->address); - break; - - case ACPI_SIZE_WORD: - val = inw(reg->address); - break; - - case ACPI_SIZE_DWORD: - val = inl(reg->address); - break; - - /* ACPI_SIZE_QUAD - not supported ? */ - } - break; - } - - return val; -} diff --git a/arch/all-pc/acpi/scanentries.c b/arch/all-pc/acpi/scanentries.c deleted file mode 100644 index 51971b8f44..0000000000 --- a/arch/all-pc/acpi/scanentries.c +++ /dev/null @@ -1,109 +0,0 @@ -#include -#include - -struct HeaderData -{ - unsigned int id; - unsigned int len; -}; - -static const struct HeaderData headers[] = -{ - {ACPI_MAKE_ID('A','P','I','C'), sizeof(struct ACPI_TABLE_TYPE_MADT)}, - {0, 0} -}; - -/***************************************************************************** - - NAME */ -#include - - AROS_LH4(ULONG, ACPI_ScanEntries, - -/* SYNOPSIS */ - AROS_LHA(struct ACPI_TABLE_DEF_HEADER *, table, A0), - AROS_LHA(WORD, type, D0), - AROS_LHA(const struct Hook *, hook, A1), - AROS_LHA(APTR, userdata, A2), - -/* LOCATION */ - struct ACPIBase *, ACPIBase, 2, Acpi) - -/* FUNCTION - Scan entries with the given type in the given table. - The supplied hook will be called for each entry - - INPUTS - table - a pointer to a table to scan - type - type of entries needed, or ACPI_ENTRY_TYPE_ALL to - enumerate all entries - hook - a hook to call. The hook will be called with 'object' - argument set to entry pointer, and 'paramPacket' set to - 'userdata' argument. You can pass a NULL here in order just - to count the number of entries. - userdata - a user-supplied data to pass to the hook. - - RESULT - Total number of processed entries. The entry is considered processed if - either supplied hook returns nonzero value, or there's no hook supplied. - - NOTES - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - struct ACPI_TABLE_DEF_ENTRY_HEADER *entry = NULL; - ULONG count = 0; - const struct HeaderData *hdr; - unsigned long end; - - for (hdr = headers; hdr->id; hdr++) - { - if (hdr->id == table->signature) - { - /* First entry follows table header */ - entry = (APTR)table + hdr->len; - break; - } - } - - if (!entry) - { - /* The given table doesn't have array of entries inside */ - return 0; - } - - /* Get end of the table */ - end = (unsigned long)table + table->length; - - /* Parse all entries looking for a match. */ - while (((unsigned long)entry) < end) - { - if ((type == ACPI_ENTRY_TYPE_ALL) || (type == entry->type)) - { - if (hook) - { - BOOL res = CALLHOOKPKT((struct Hook *)hook, entry, userdata); - - if (res) - count++; - } - else - count++; - } - entry = (struct ACPI_TABLE_DEF_ENTRY_HEADER *)((unsigned long)entry + entry->length); - } - - return count; - - AROS_LIBFUNC_EXIT -} diff --git a/arch/all-pc/acpi/scansdt.c b/arch/all-pc/acpi/scansdt.c deleted file mode 100644 index 89a0f23c9c..0000000000 --- a/arch/all-pc/acpi/scansdt.c +++ /dev/null @@ -1,77 +0,0 @@ -#include -#include - -/***************************************************************************** - - NAME */ -#include - - AROS_LH3(ULONG, ACPI_ScanSDT, - -/* SYNOPSIS */ - AROS_LHA(ULONG, id, D0), - AROS_LHA(const struct Hook *, hook, A0), - AROS_LHA(APTR, userdata, A1), - -/* LOCATION */ - struct ACPIBase *, ACPIBase, 5, Acpi) - -/* FUNCTION - Scan multiple system description tables with the given signature. - - INPUTS - id - a signature of the table(s) to scan. Supply ACPI_ID_ALL - to enumerate all tables. - hook - a hook to call. The hook will be called with 'object' - argument set to table pointer, and 'paramPacket' set to - 'userdata' argument. You can pass a NULL here in order just - to count the number of tables. - userdata - a user-supplied data to pass to the hook. - - RESULT - Total number of processed tables. The table is considered processed if - either supplied hook returns nonzero value, or there's no hook supplied. - - NOTES - Root tables, containing no data but only pointers to other tables - (like RSDT and XSDT) are not included in the scan. - - EXAMPLE - - BUGS - - SEE ALSO - ACPI_FindSDT() - - INTERNALS - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - ULONG count = 0; - struct ACPI_TABLE_DEF_HEADER *header; - ULONG i; - - for (i = 0; i < ACPIBase->ACPIB_SDT_Count; i++) - { - header = ACPIBase->ACPIB_SDT_Entry[i]; - - if ((id == ACPI_ID_ALL) || (id == header->signature)) - { - if (hook) - { - BOOL res = CALLHOOKPKT((struct Hook *)hook, header, userdata); - - if (res) - count++; - } - else - count++; - } - } - - return count; - - AROS_LIBFUNC_EXIT -} diff --git a/arch/all-pc/acpi/writereg.c b/arch/all-pc/acpi/writereg.c deleted file mode 100644 index 6c9950a3da..0000000000 --- a/arch/all-pc/acpi/writereg.c +++ /dev/null @@ -1,108 +0,0 @@ -#include -#include - -#include "gas_io.h" - -/***************************************************************************** - - NAME */ -#include - - AROS_LH2I(void, ACPI_WriteReg, - -/* SYNOPSIS */ - AROS_LHA(struct GENERIC_ACPI_ADDR *, reg, A0), - AROS_LHA(IPTR, value, D0), - -/* LOCATION */ - struct ACPIBase *, ACPIBase, 4, Acpi) - -/* FUNCTION - Write a value from the register specified by GAS - - INPUTS - reg - a pointer to a generic address structure - value - a value to write to the register - - RESULT - None - - NOTES - Only memory and I/O spaces are supported. - 64-bit registers are supported only in memory space and only on 64-bit platforms. - The given GAS must address a complete register, not a data structure. - - EXAMPLE - - BUGS - - SEE ALSO - - INTERNALS - -******************************************************************************/ -{ - AROS_LIBFUNC_INIT - - unsigned char size = GetSize(reg); - - if (reg->register_bit_width != FullSize[reg->size]) - { - /* - * Partial bit field. - * Read original value from the register and replace the needed bits. - */ - unsigned long mask = ((1 << reg->register_bit_width) - 1) << reg->register_bit_offset; - unsigned long old = ReadRegInt(reg, size); - - value = (value << reg->register_bit_offset) & mask; - value |= (old & ~mask); - } - - switch (reg->address_space_id) - { - case ACPI_SPACE_MEM: - switch (size) - { - case ACPI_SIZE_BYTE: - *((UBYTE *)(IPTR)reg->address) = value; - break; - - case ACPI_SIZE_WORD: - *((UWORD *)(IPTR)reg->address) = value; - break; - - case ACPI_SIZE_DWORD: - *((ULONG *)(IPTR)reg->address) = value; - break; - -#if __WORDSIZE == 64 - case ACPI_SIZE_QUAD: - *((UQUAD *)(IPTR)reg->address) = value; - break; -#endif - } - break; - - case ACPI_SPACE_IO: - switch (size) - { - case ACPI_SIZE_BYTE: - outb(value, reg->address); - break; - - case ACPI_SIZE_WORD: - outw(value, reg->address); - break; - - case ACPI_SIZE_DWORD: - outl(value, reg->address); - break; - - /* ACPI_SIZE_QUAD - not supported ? */ - } - break; - } - - AROS_LIBFUNC_EXIT -} diff --git a/compiler/include/resources/acpi.h b/compiler/include/resources/acpi.h deleted file mode 100644 index ad1cd7951b..0000000000 --- a/compiler/include/resources/acpi.h +++ /dev/null @@ -1,521 +0,0 @@ -/* - Copyright © 1995-2012, The AROS Development Team. All rights reserved. - $Id$ - - Desc: AROS Generic ACPI Definitions. - Lang: english -*/ -#ifndef __AROS_ACPI_H__ -#define __AROS_ACPI_H__ - -#include -#include -#include -#include -#include - -/********** ACPI DEFINITIONS ****************/ - -/* - * Actually a reverse of AROS_MAKE_ID(). - * Reverse because ACPI signatures appear to be stored in bigendian format. - */ -#define ACPI_MAKE_ID(a, b, c, d) (((ULONG) (d)<<24) | ((ULONG) (c)<<16) | \ - ((ULONG) (b)<<8) | ((ULONG) (a))) - -#define ACPI_ID_ALL 0xFFFFFFFF - -/* ACPI 2.0 Generic Address Structure (GAS) */ - -struct GENERIC_ACPI_ADDR -{ - unsigned char address_space_id; /* Address space where struct or register exists. */ - unsigned char register_bit_width; /* Size in bits of given register */ - unsigned char register_bit_offset; /* Bit offset within the register */ - unsigned char size; /* Acces size (see below) */ - UQUAD address; /* 64-bit address of struct or register */ -} __attribute__ ((packed)); - -/* Address spaces */ -#define ACPI_SPACE_MEM 0 -#define ACPI_SPACE_IO 1 -#define ACPI_SPACE_PCI 2 -#define ACPI_SPACE_EMBEDDED 3 -#define ACPI_SPACE_SMBUS 4 -#define ACPI_SPACE_FIXED 0x7F -#define ACPI_SPACE_OEM 0xC0 - -/* Access sizes */ -#define ACPI_SIZE_UNDEFINED 0 /* Specified by bit offset and width */ -#define ACPI_SIZE_BYTE 1 -#define ACPI_SIZE_WORD 2 -#define ACPI_SIZE_DWORD 3 -#define ACPI_SIZE_QUAD 4 - -#define ACPI_PCI_OFFSET(addr) (unsigned short)((addr) & 0x0FFFF) -#define ACPI_PCI_FUNC(addr) (unsigned short)(((addr) >> 16) & 0x0FFFF) -#define ACPI_PCI_DEV(addr) (unsigned short)(((addr) >> 32) & 0x0FFFF) - -struct ACPI_TABLE_DEF_HEADER /* ACPI common table header */ -{ - unsigned int signature; /* ACPI signature (4 ASCII characters) */ - unsigned int length; /* Length of table, in bytes, including header */ - unsigned char revision; /* ACPI Specification minor version # */ - unsigned char checksum; /* To make sum of entire table == 0 */ - char oem_id [6]; /* OEM identification */ - char oem_table_id [8]; /* OEM table identification */ - unsigned int oem_revision; /* OEM revision number */ - char asl_compiler_id [4]; /* ASL compiler vendor ID */ - unsigned int asl_compiler_revision; /* ASL compiler revision number */ -}; - -/* Table Handlers */ - -enum ACPI_IRQ_PICS -{ - ACPI_IRQ_PIC_8259 = 0, - ACPI_IRQ_PIC_IOAPIC, - ACPI_IRQ_PIC_IOSAPIC, - ACPI_IRQ_PIC_COUNT -}; - -/* Root System Description Pointer "RSDP" structure */ -struct ACPI_TABLE_TYPE_RSDP -{ - char signature[8]; - unsigned char checksum; - char oem_id[6]; - unsigned char revision; - unsigned int rsdt_address; - /* The following fields are present only if revision >= 2 */ - unsigned int length; - UQUAD xsdt_address; - unsigned char ext_checksum; - unsigned char reserved[3]; -}; - -struct ACPI_TABLE_DEF_ENTRY_HEADER -{ - unsigned char type; - unsigned char length; -}; - -#define ACPI_ENTRY_TYPE_ALL -1 - -struct ACPI_TABLE_TYPE_RSDT /* Root System Description Table "RSDT" structures */ -{ - struct ACPI_TABLE_DEF_HEADER header; - unsigned int entry[8]; -}; - -struct ACPI_TABLE_TYPE_XSDT /* Extended System Description Table "XSDT" structures */ -{ - struct ACPI_TABLE_DEF_HEADER header; - UQUAD entry[1]; -} __attribute__ ((packed)); - -struct ACPI_TABLE_TYPE_FADT /* Fixed ACPI Description Table "FADT" structures */ -{ - struct ACPI_TABLE_DEF_HEADER header; - unsigned int facs_addr; - unsigned int dsdt_addr; - unsigned char reserved0; /* ACPI 1.0: interrupt model. Actually never used. */ - unsigned char pm_profile; /* ACPI >= 2.0: preferred system profile, see below */ - unsigned short sci_int; - unsigned int smi_cmd; - unsigned char acpi_enable; - unsigned char acpi_disable; - unsigned char s4bios_req; - unsigned char pstate_cnt; - unsigned int pm1a_evt_blk; - unsigned int pm1b_evt_blk; - unsigned int pm1a_cnt_blk; - unsigned int pm1b_cnt_blk; - unsigned int pm2_cnt_blk; - unsigned int pm_tmr_blk; - unsigned int gpe0_blk; - unsigned int gpe1_blk; - unsigned char pm1_evt_len; - unsigned char pm1_cnt_len; - unsigned char pm2_cnt_len; - unsigned char pm_tmr_len; - unsigned char gpe0_blk_len; - unsigned char gpe1_blk_len; - unsigned char gpe1_base; - unsigned char cst_cnt; - unsigned short p_lvl2_lat; - unsigned short p_lvl3_lat; - unsigned short flush_size; /* Obsolete leftover from ACPI v1.0 */ - unsigned short flush_stride; /* Obsolete leftover from ACPI v1.0 */ - unsigned char duty_offset; - unsigned char duty_width; - unsigned char day_alarm; - unsigned char mon_alarm; - unsigned char century; - unsigned short pc_arch; /* ACPI >= 2.0: IA-PC architecture flags, see below */ - unsigned char reserved1; - unsigned int flags; /* Fixed feature flags, see below */ - /* The following is present in ACPI >= 2.0 */ - struct GENERIC_ACPI_ADDR reset_reg; - unsigned char reset_value; - unsigned char reserved2[3]; - unsigned long long x_firmware_ctrl; - unsigned long long x_dsdt; - struct GENERIC_ACPI_ADDR x_pm1a_evt_blk; - struct GENERIC_ACPI_ADDR x_pm1b_evt_blk; - struct GENERIC_ACPI_ADDR x_pm1a_cnt_blk; - struct GENERIC_ACPI_ADDR x_pm1b_cnt_blk; - struct GENERIC_ACPI_ADDR x_pm2_cnt_blk; - struct GENERIC_ACPI_ADDR x_pm_tmr_blk; - struct GENERIC_ACPI_ADDR x_gpe0_blk; - struct GENERIC_ACPI_ADDR x_gpe1_blk; -} __attribute__ ((packed)); - -/* Preferred system profiles */ -#define FACP_PROFILE_UNSPECIFIED 0 -#define FACP_PROFILE_DESKTOP 1 -#define FACP_PROFILE_MOBILE 2 -#define FACP_PROFILE_WORKSTATION 3 -#define FACP_PROFILE_ENTERPRIZE 4 -#define FACP_PROFILE_SOHO 5 -#define FACP_PROFILE_APPLIANCE 6 -#define FACP_PROFILE_PERFORMANCE 7 - -/* IA-PC architecture flags */ -#define FACP_PC_LEGACY (1 << 0) -#define FACP_PC_8042 (1 << 1) -#define FACP_PC_NO_VGA (1 << 2) -#define FACP_PC_NO_MSI (1 << 3) -#define FACP_PCIE_ASPM (1 << 4) - -/* Fixed feature flags */ -#define FACP_FF_WBINVD (1 << 0) -#define FACP_FF_WBINVD_FLUSH (1 << 1) -#define FACP_FF_PROC_C1 (1 << 2) -#define FACP_FF_P_LVL2_UP (1 << 3) -#define FACP_FF_PWR_BUTTON (1 << 4) -#define FACP_FF_SLP_BUTTON (1 << 5) -#define FACP_FF_FIX_RTC (1 << 6) -#define FACP_FF_RTC_S4 (1 << 7) -#define FACP_FF_TMR_VAL_EXT (1 << 8) -#define FACP_FF_DCK_CAP (1 << 9) -#define FACP_FF_RESET_REG_SUP (1 << 10) -#define FACP_FF_SEALED_CASE (1 << 11) -#define FACP_FF_HEADLESS (1 << 12) -#define FACP_FF_CPU_SW_SLP (1 << 13) -#define FACP_FF_PCI_EXP_WAK (1 << 14) -#define FACP_FF_PLATFORM_CLOCK (1 << 15) -#define FACP_FF_S4_RTC_STS_VALID (1 << 16) -#define FACP_FF_REMOTE_PWRON (1 << 17) -#define FACP_FF_APIC_CLUSTER (1 << 18) -#define FACP_FF_APIC_PHYS_DEST (1 << 19) - -struct ACPI_TABLE_TYPE_MADT /* Multiple APIC Description Table "MADT" structures */ -{ - struct ACPI_TABLE_DEF_HEADER header; - unsigned int lapic_address; - struct - { - unsigned int pcat_compat:1; - unsigned int reserved:31; - } flags; - struct ACPI_TABLE_DEF_ENTRY_HEADER entries[0]; -}; - -enum ACPI_MADT_TYPES -{ - ACPI_MADT_LAPIC = 0, - ACPI_MADT_IOAPIC, - ACPI_MADT_INT_SRC_OVR, - ACPI_MADT_NMI_SRC, - ACPI_MADT_LAPIC_NMI, - ACPI_MADT_LAPIC_ADDR_OVR, - ACPI_MADT_IOSAPIC, - ACPI_MADT_LSAPIC, - ACPI_MADT_PLAT_INT_SRC, - ACPI_MADT_X2APIC, - ACPI_MADT_X2APIC_NMI, - ACPI_MADT_ENTRY_COUNT -}; - -typedef struct -{ - UWORD polarity:2; /* See below */ - UWORD trigger:2; /* See below */ - UWORD reserved:12; -} ACPI_INT_FLAGS; - -/* Polarity and trigger mode values */ -#define INTF_POLARITY_BUS 0 /* Bus default */ -#define INTF_POLARITY_HIGH 1 /* Active high */ -#define INTF_POLARITY_LOW 3 /* Active low */ -#define INTF_TRIGGER_BUS 0 /* Bus default */ -#define INTF_TRIGGER_EDGE 1 -#define INTF_TRIGGER_LEVEL 3 - -struct ACPI_TABLE_TYPE_LAPIC -{ - struct ACPI_TABLE_DEF_ENTRY_HEADER header; - unsigned char acpi_id; - unsigned char id; - struct - { - unsigned int enabled:1; - unsigned int reserved:31; - } flags; -}; - -struct ACPI_TABLE_TYPE_IOAPIC -{ - struct ACPI_TABLE_DEF_ENTRY_HEADER header; - unsigned char id; - unsigned char reserved; - unsigned int address; - unsigned int global_irq_base; -}; - -struct ACPI_TABLE_TYPE_INT_SRCOVR -{ - struct ACPI_TABLE_DEF_ENTRY_HEADER header; - unsigned char bus; - unsigned char bus_irq; - unsigned int global_irq; - ACPI_INT_FLAGS flags; -}; - -struct ACPI_TABLE_TYPE_LAPIC_NMI_SRC -{ - struct ACPI_TABLE_DEF_ENTRY_HEADER header; - ACPI_INT_FLAGS flags; - unsigned int global_irq; -}; - -struct ACPI_TABLE_TYPE_LAPIC_NMI -{ - struct ACPI_TABLE_DEF_ENTRY_HEADER header; - unsigned char acpi_id; - ACPI_INT_FLAGS flags; - unsigned char lint; -} __attribute__ ((packed)); - -#define ACPI_ID_BROADCAST 0xFF - -struct ACPI_TABLE_TYPE_LAPIC_ADDROVR -{ - struct ACPI_TABLE_DEF_ENTRY_HEADER header; - unsigned char reserved[2]; - UQUAD address; -} __attribute__ ((packed)); - -struct ACPI_TABLE_TYPE_IOSAPIC -{ - struct ACPI_TABLE_DEF_ENTRY_HEADER header; - unsigned char id; - unsigned char reserved; - unsigned int global_irq_base; - UQUAD address; -}; - -struct ACPI_TABLE_TYPE_LSAPIC -{ - struct ACPI_TABLE_DEF_ENTRY_HEADER header; - unsigned char acpi_id; - unsigned char id; - unsigned char eid; - unsigned char reserved[3]; - struct { - unsigned int enabled:1; - unsigned int reserved:31; - } flags; -}; - -struct ACPI_TABLE_TYPE_PLAT_INTSRC -{ - struct ACPI_TABLE_DEF_ENTRY_HEADER header; - ACPI_INT_FLAGS flags; - unsigned char type; /* See acpi_interrupt_type */ - unsigned char id; - unsigned char eid; - unsigned char iosapic_vector; - unsigned int global_irq; - unsigned int srcflags; /* See below */ -}; - -/* Interrupt types */ -enum ACPI_INT_IDS -{ - ACPI_INTERRUPT_PMI = 1, - ACPI_INTERRUPT_INIT, - ACPI_INTERRUPT_CPEI, - ACPI_INTERRUPT_COUNT -}; - -/* Interrupt source flags */ -#define ACPI_CPEI_PROC_OVERRIDE (1 << 0) - -struct ACPI_TABLE_TYPE_X2APIC -{ - struct ACPI_TABLE_DEF_ENTRY_HEADER header; - /* 2 bytes of padding here */ - unsigned int id; - unsigned int flags; - unsigned int acpi_uid; -}; - -#define ACPI_X2APIC_ENABLED (1 << 0) - -struct ACPI_TABLE_TYPE_X2APIC_NMI -{ - struct ACPI_TABLE_DEF_ENTRY_HEADER header; - ACPI_INT_FLAGS flags; - unsigned int acpi_uid; - unsigned char lint; -}; - -#define ACPI_UID_BROADCAST 0xFFFFFFFF - -struct ACPI_TABLE_TYPE_HPET -{ - struct ACPI_TABLE_DEF_HEADER header; - unsigned int id; - struct GENERIC_ACPI_ADDR addr; - unsigned char number; - UWORD min_tick; - unsigned char page_protect; -} __attribute__ ((packed)); - -/* ID components */ -#define HPET_HW_REV_MASK 0x000000FF -#define HPET_NUM_COMPARATORS_MASK 0x00001F00 -#define HPET_NUM_COMPARATORS_SHIFT 8 -#define HPET_COUNTER_SIZE 0x00002000 -#define HPET_LEGACY_REPLACEMENT 0x00008000 -#define HPET_PCI_VENDOR_MASK 0xFFFF0000 -#define HPET_PCI_VENDOR_SHIFT 16 - -/* page_protect components */ -#define HPET_PAGE_PROTECT_MASK 0x0F -#define HPET_OEM_ATTR_MASK 0xF0 -#define HPET_OEM_ATTR_SHIFT 4 - -#define HPET_PAGE_NONE 0 -#define HPET_PAGE_4K 1 -#define HPET_PAGE_64K 2 - -/* - System Resource Affinity Table (SRAT) [ see http://www.microsoft.com/hwdev/design/srat.htm ] -*/ - -struct ACPI_TABLE_TYPE_SRAT -{ - struct ACPI_TABLE_DEF_HEADER header; - unsigned int table_revision; - UQUAD reserved; -}; - -enum ACPI_SRAT_ENTRY_IDS -{ - ACPI_SRAT_PROCESSOR_AFFINITY = 0, - ACPI_SRAT_MEMORY_AFFINITY, - ACPI_SRAT_ENTRY_COUNT -}; - -struct ACPI_TABLE_AFFIN_PROCESSOR -{ - struct ACPI_TABLE_DEF_ENTRY_HEADER header; - unsigned char proximity_domain; - unsigned char apic_id; - struct - { - unsigned int enabled:1; - unsigned int reserved:31; - } flags; - unsigned char lsapic_eid; - unsigned char reserved[7]; -}; - -struct ACPI_TABLE_AFFIN_MEMORY -{ - struct ACPI_TABLE_DEF_ENTRY_HEADER header; - unsigned char proximity_domain; - unsigned char reserved1[5]; - unsigned int base_addr_lo; - unsigned int base_addr_hi; - unsigned int length_lo; - unsigned int length_hi; - unsigned int memory_type; /* See acpi_address_range_id */ - struct - { - unsigned int enabled:1; - unsigned int hot_pluggable:1; - unsigned int reserved:30; - } flags; - UQUAD reserved2; -}; - -enum acpi_address_range_id -{ - ACPI_ADDRESS_RANGE_MEMORY = 1, - ACPI_ADDRESS_RANGE_RESERVED = 2, - ACPI_ADDRESS_RANGE_ACPI = 3, - ACPI_ADDRESS_RANGE_NVS = 4, - ACPI_ADDRESS_RANGE_COUNT -}; - -/* - System Locality Information Table (SLIT) [ see http://devresource.hp.com/devresource/docs/techpapers/ia64/slit.pdf ] -*/ - -struct ACPI_TABLE_TYPE_SLIT -{ - struct ACPI_TABLE_DEF_HEADER header; - UQUAD localities; - unsigned char entry[1]; /* real size = localities^2 */ -}; - -struct ACPI_TABLE_TYPE_SBST /* Smart Battery Description Table (SBST) */ -{ - struct ACPI_TABLE_DEF_HEADER header; - unsigned int warning; /* Warn user */ - unsigned int low; /* Critical sleep */ - unsigned int critical; /* Critical shutdown */ -}; - -struct ACPI_TABLE_TYPE_ECDT /* Embedded Controller Boot Resources Table (ECDT) */ -{ - struct ACPI_TABLE_DEF_HEADER header; - struct GENERIC_ACPI_ADDR ec_control; - struct GENERIC_ACPI_ADDR ec_data; - unsigned int uid; - unsigned char gpe_bit; - char ec_id[0]; -}; - -/* - * acpi.resource base. - * For a casual user it's actually black box. Use API to access the data. - * These pointers are provided for diagnostics purposes only. - */ -struct ACPIBase -{ - struct Library ACPIB_LibNode; - - struct Interrupt ACPIB_ResetHandler; - - struct ACPI_TABLE_TYPE_RSDP *ACPIB_RSDP_Addr; /* Supervisor-only!!! */ - struct ACPI_TABLE_DEF_HEADER *ACPIB_SDT_Addr; /* Raw XSDT or RSDT pointer */ - int ACPIB_SDT_Count; /* These two are private. Do not use! */ - struct ACPI_TABLE_DEF_HEADER **ACPIB_SDT_Entry; - char ACPI_OEM_ID[6]; /* Cached from RSDP */ - unsigned char ACPI_Revision; -/*..*/ - APTR ACPIB_ACPI_Data; /* Base address of acpi data block */ - APTR ACPIB_ACPI_Data_End; - APTR ACPIB_ACPI_NVM; /* Base address of acpi data block */ - - int ACPIB_ACPI_IRQ; - - int ACPIB_ACPI_HT; -}; - -#endif /* __AROS_ACPI_H__ */ diff --git a/rom/exec/exec_init.c b/rom/exec/exec_init.c index 34b315f258..f3183d661e 100644 --- a/rom/exec/exec_init.c +++ b/rom/exec/exec_init.c @@ -58,7 +58,7 @@ AROS_UFP3S(struct ExecBase *, GM_UNIQUENAME(init), * COLDSTART level). * Such mechanism allows kernel.resource boot code to do some additional setup after * all SINGLETASK residents are run. Usually these are various lowlevel hardware resources - * (like acpi.resource, efi.resource, etc) which can be needed for kernel.resource to + * (like acpica.library, efi.resource, etc) which can be needed for kernel.resource to * complete own setup. This helps to get rid of additional ROMTag hooks. * There's one more magic with this ROMTag: it's called twice. First time it's called manually * from within krnPrepareExecBase(), for initial ExecBase creation. This magic is described below. diff --git a/rom/mmakefile.src b/rom/mmakefile.src index 624429ab3f..d2d75dfd9c 100644 --- a/rom/mmakefile.src +++ b/rom/mmakefile.src @@ -26,7 +26,7 @@ include $(TOP)/config/make.cfg # This metatarget represents all includes for SDK. # Note that it includes also some machine-specific modules (hostlib.resource, -# acpi.resource, efi.resource, etc). This is because our SDK is universal. +# acpica.library, efi.resource, etc). This is because our SDK is universal. #MM- includes-generate : \ #MM kernel-kernel-includes \ diff --git a/test/cplusplus/headertest.cpp b/test/cplusplus/headertest.cpp index ab974b4121..cfc6c0ecba 100644 --- a/test/cplusplus/headertest.cpp +++ b/test/cplusplus/headertest.cpp @@ -6,8 +6,6 @@ // get rid of a dbus error #define DBUS_API_SUBJECT_TO_CHANGE -#include - // ADF redefines AROS types //#include //#include diff --git a/workbench/locale/help/English/options.txt b/workbench/locale/help/English/options.txt index e531dd994a..ee85edc475 100644 --- a/workbench/locale/help/English/options.txt +++ b/workbench/locale/help/English/options.txt @@ -135,9 +135,9 @@ from this device. Do not add ':' at the end. Force power on all OHCI USB ports to ON and disable overcurrent detection. Known to be needed on Intel MacMini. Try this if your USB doesn't work. - acpi.resource + acpica.library ================================================================================================ noacpi - Totally disables ACPI subsystem. acpi.resource is not initialized. + Totally disables ACPI subsystem. acpica.library is not initialized. -- 2.11.4.GIT