]> Zhao Yanbai Git Server - minix.git/commitdiff
ACPI: OS-dependent code tweaks 37/2937/1
authorDavid van Moolenbroek <david@minix3.org>
Tue, 23 Dec 2014 09:45:52 +0000 (09:45 +0000)
committerDavid van Moolenbroek <david@minix3.org>
Tue, 10 Feb 2015 13:47:28 +0000 (13:47 +0000)
Change-Id: I533685f6716cb48ccf3d5ca5ef0fb681a5293549

minix/drivers/power/acpi/osminixxf.c

index 47052c403adb918b4263893b991bd6cc020c9fb7..30013550c1f8243c1402dbdae3ef38758effe54d 100644 (file)
@@ -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;
 }