From: David van Moolenbroek Date: Tue, 23 Dec 2014 09:45:52 +0000 (+0000) Subject: ACPI: OS-dependent code tweaks X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=2a3bc70264d4a84a6403c7de8a72b16ad9e0fce6;p=minix.git ACPI: OS-dependent code tweaks Change-Id: I533685f6716cb48ccf3d5ca5ef0fb681a5293549 --- diff --git a/minix/drivers/power/acpi/osminixxf.c b/minix/drivers/power/acpi/osminixxf.c index 47052c403..30013550c 100644 --- a/minix/drivers/power/acpi/osminixxf.c +++ b/minix/drivers/power/acpi/osminixxf.c @@ -317,6 +317,7 @@ AcpiOsVprintf ( va_list Args) { + printf("ACPI: "); vprintf (Fmt, Args); printf("\n"); } @@ -366,15 +367,7 @@ AcpiOsMapMemory ( ACPI_PHYSICAL_ADDRESS where, /* not page aligned */ ACPI_SIZE length) /* in bytes, not page-aligned */ { - ACPI_PHYSICAL_ADDRESS addr; - void * vir; - unsigned sdiff; - - addr = where & ~0xfff; /* align to 4k */ - sdiff = where - addr; - vir = vm_map_phys(SELF, (void *) addr, length + sdiff); - - return (void *) ((char *)vir + sdiff); + return vm_map_phys(SELF, (void *) where, length); } @@ -397,6 +390,7 @@ AcpiOsUnmapMemory ( void *where, ACPI_SIZE length) { + vm_unmap_phys(SELF, where, length); } @@ -588,7 +582,7 @@ AcpiOsInstallInterruptHandler ( ACPI_OSD_HANDLER ServiceRoutine, void *Context) { - printf("AcpiOsInstallInterruptHandler NOT SUPPORTED\n"); + printf("ACPI: no support for power interrupt yet\n"); return AE_OK; } @@ -610,7 +604,7 @@ AcpiOsRemoveInterruptHandler ( UINT32 InterruptNumber, ACPI_OSD_HANDLER ServiceRoutine) { - printf("AcpiOsRemoveInterruptHandler NOT SUPPORTED\n"); + printf("ACPI: no support for power interrupt yet\n"); return AE_OK; } @@ -795,6 +789,8 @@ AcpiOsReadPort ( case 32: sys_inl(Address, Value); break; + default: + panic("unsupported width: %d", Width); } return AE_OK; } @@ -830,9 +826,10 @@ AcpiOsWritePort ( case 32: sys_outl(Address, Value); break; + default: + panic("unsupported width: %d", Width); } return AE_OK; - return AE_OK; }