Index: acpi.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpi.c,v retrieving revision 1.3 diff -u -r1.3 acpi.c --- acpi.c 2000/11/06 22:33:49 1.3 +++ acpi.c 2000/11/17 16:58:55 @@ -153,7 +153,7 @@ acpi_identify(driver_t *driver, device_t parent) { device_t child; - void *rsdp; + ACPI_PHYSICAL_ADDRESS rsdp; int error; #ifdef ENABLE_DEBUGGER char *debugpoint = getenv("debug.acpi.debugger"); @@ -214,8 +214,8 @@ char buf[20]; int error; - if ((error = AcpiGetTableHeader(ACPI_TABLE_RSDT, 1, &th)) != AE_OK) { - device_printf(dev, "couldn't get RSDT header: %s\n", acpi_strerror(error)); + if ((error = AcpiGetTableHeader(ACPI_TABLE_XSDT, 1, &th)) != AE_OK) { + device_printf(dev, "couldn't get XSDT header: %s\n", acpi_strerror(error)); return(ENXIO); } sprintf(buf, "%.6s %.8s", th.OemId, th.OemTableId); @@ -295,13 +295,13 @@ sc->acpi_lid_switch_sx = ACPI_LID_SWITCH_DEFAULT_SX; /* Enable and clear fixed events and install handlers. */ - if (AcpiGbl_FACP != NULL && AcpiGbl_FACP->PwrButton == 0) { + if (AcpiGbl_FADT != NULL && AcpiGbl_FADT->PwrButton == 0) { AcpiEnableEvent(ACPI_EVENT_POWER_BUTTON, ACPI_EVENT_FIXED); AcpiClearEvent(ACPI_EVENT_POWER_BUTTON, ACPI_EVENT_FIXED); AcpiInstallFixedEventHandler(ACPI_EVENT_POWER_BUTTON, acpi_eventhandler_power_button_for_sleep, sc); device_printf(dev, "power button is handled as a fixed feature programming model.\n"); } - if (AcpiGbl_FACP != NULL && AcpiGbl_FACP->SleepButton == 0) { + if (AcpiGbl_FADT != NULL && AcpiGbl_FADT->SleepButton == 0) { AcpiEnableEvent(ACPI_EVENT_SLEEP_BUTTON, ACPI_EVENT_FIXED); AcpiClearEvent(ACPI_EVENT_SLEEP_BUTTON, ACPI_EVENT_FIXED); AcpiInstallFixedEventHandler(ACPI_EVENT_SLEEP_BUTTON, acpi_eventhandler_sleep_button_for_sleep, sc); Index: acpi_timer.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpi_timer.c,v retrieving revision 1.1 diff -u -r1.1 acpi_timer.c --- acpi_timer.c 2000/10/28 06:59:48 1.1 +++ acpi_timer.c 2000/11/17 17:10:08 @@ -67,7 +67,7 @@ static void acpi_timer_identify(driver_t *driver, device_t parent) { - static FIXED_ACPI_DESCRIPTION_TABLE facp; + static FADT_DESCRIPTOR facp; ACPI_BUFFER buf; ACPI_STATUS status; device_t dev; @@ -75,12 +75,12 @@ buf.Pointer = &facp; buf.Length = sizeof(facp); - if ((status = AcpiGetTable(ACPI_TABLE_FACP, 1, &buf)) != AE_OK) { - device_printf(parent, "can't locate FACP - %s\n", acpi_strerror(status)); + if ((status = AcpiGetTable(ACPI_TABLE_FADT, 1, &buf)) != AE_OK) { + device_printf(parent, "can't locate FADT - %s\n", acpi_strerror(status)); return; } if (buf.Length != sizeof(facp)) { - device_printf(parent, "invalid FACP\n"); + device_printf(parent, "invalid FADT\n"); return; } Index: Osd/OsdMemory.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/Osd/OsdMemory.c,v retrieving revision 1.1 diff -u -r1.1 OsdMemory.c --- Osd/OsdMemory.c 2000/10/28 06:56:15 1.1 +++ Osd/OsdMemory.c 2000/11/17 18:12:43 @@ -64,7 +64,7 @@ } ACPI_STATUS -AcpiOsMapMemory (void *PhysicalAddress, UINT32 Length, void **LogicalAddress) +AcpiOsMapMemory (ACPI_PHYSICAL_ADDRESS PhysicalAddress, UINT32 Length, void **LogicalAddress) { *LogicalAddress = pmap_mapdev((vm_offset_t)PhysicalAddress, Length); if (*LogicalAddress == NULL) @@ -92,5 +92,94 @@ AcpiOsWritable (void *Pointer, UINT32 Length) { return(TRUE); +} + +static __inline +UINT32 +AcpiOsMemInX (UINT32 Length, ACPI_PHYSICAL_ADDRESS InAddr) +{ + UINT32 Value; + void *LogicalAddress; + + if (AcpiOsMapMemory(InAddr, Length, &LogicalAddress) != AE_OK) { + return(0); + } + + switch (Length) { + case 1: + Value = (*(volatile u_int8_t *)LogicalAddress) & 0xff; + break; + case 2: + Value = (*(volatile u_int16_t *)LogicalAddress) & 0xffff; + break; + case 4: + Value = (*(volatile u_int32_t *)LogicalAddress); + break; + } + + AcpiOsUnmapMemory(LogicalAddress, Length); + + return(Value); +} + +UINT8 +AcpiOsMemIn8 (ACPI_PHYSICAL_ADDRESS InAddr) +{ + return((UINT8)AcpiOsMemInX(1, InAddr)); +} + +UINT16 +AcpiOsMemIn16 (ACPI_PHYSICAL_ADDRESS InAddr) +{ + return((UINT16)AcpiOsMemInX(2, InAddr)); +} + +UINT32 +AcpiOsMemIn32 (ACPI_PHYSICAL_ADDRESS InAddr) +{ + return((UINT32)AcpiOsMemInX(4, InAddr)); +} + +static __inline +void +AcpiOsMemOutX (UINT32 Length, ACPI_PHYSICAL_ADDRESS OutAddr, UINT32 Value) +{ + void *LogicalAddress; + + if (AcpiOsMapMemory(OutAddr, Length, &LogicalAddress) != AE_OK) { + return; + } + + switch (Length) { + case 1: + (*(volatile u_int8_t *)LogicalAddress) = Value & 0xff; + break; + case 2: + (*(volatile u_int16_t *)LogicalAddress) = Value & 0xffff; + break; + case 4: + (*(volatile u_int32_t *)LogicalAddress) = Value; + break; + } + + AcpiOsUnmapMemory(LogicalAddress, Length); +} + +void +AcpiOsMemOut8 (ACPI_PHYSICAL_ADDRESS OutAddr, UINT8 Value) +{ + AcpiOsMemOutX(1, OutAddr, (UINT32)Value); +} + +void +AcpiOsMemOut16 (ACPI_PHYSICAL_ADDRESS OutAddr, UINT16 Value) +{ + AcpiOsMemOutX(2, OutAddr, (UINT32)Value); +} + +void +AcpiOsMemOut32 (ACPI_PHYSICAL_ADDRESS OutAddr, UINT32 Value) +{ + AcpiOsMemOutX(4, OutAddr, (UINT32)Value); }