Print this page
acpica-unix2-20130823
PANKOVs restructure

@@ -20,18 +20,22 @@
  */
 
 /*
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
- * Copyright 2011 Joyent, Inc.  All rights reserved.
+ * Copyright 2012 Joyent, Inc.  All rights reserved.
+ * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
+ * Copyright 2013 PALO, Richard. All rights reserved.
  */
+
 /*
  * Copyright (c) 2009-2010, Intel Corporation.
  * All rights reserved.
  */
+
 /*
- * ACPI CA OSL for Solaris x86
+ * x86 ACPI CA OSL
  */
 
 #include <sys/types.h>
 #include <sys/kmem.h>
 #include <sys/psm.h>

@@ -46,11 +50,11 @@
 #include <sys/strlog.h>
 #include <sys/x86_archext.h>
 #include <sys/note.h>
 #include <sys/promif.h>
 
-#include <sys/acpi/accommon.h>
+#include <acpica/include/accommon.h>
 #include <sys/acpica.h>
 
 #define MAX_DAT_FILE_SIZE       (64*1024)
 
 /* local functions */

@@ -313,10 +317,16 @@
         kmem_free(buf1, MAX_DAT_FILE_SIZE);
 
         return (AE_OK);
 }
 
+ACPI_STATUS
+AcpiOsPhysicalTableOverride(ACPI_TABLE_HEADER *ExistingTable,
+    ACPI_PHYSICAL_ADDRESS *NewAddress, UINT32 *NewTableLength)
+{
+        return (AE_SUPPORT);
+}
 
 /*
  * ACPI semaphore implementation
  */
 typedef struct {

@@ -742,10 +752,26 @@
         return (AE_OK);
 
 }
 
 void
+AcpiOsWaitEventsComplete (void)
+{
+        if (acpica_eventq_init) {
+                int     i;
+                /*
+                 * blocks until all events initiated by AcpiOsExecute have completed
+                 */
+                for (i = OSL_GLOBAL_LOCK_HANDLER; i <= OSL_EC_BURST_HANDLER; i++) {
+                        if (osl_eventq[i])
+                                ddi_taskq_wait(osl_eventq[i]);
+                }
+        }
+    return;
+}
+
+void
 AcpiOsSleep(ACPI_INTEGER Milliseconds)
 {
         /*
          * During kernel startup, before the first tick interrupt
          * has taken place, we can't call delay; very late in

@@ -881,11 +907,11 @@
         { if (rw) *((type *)(ptr)) = *((type *) val); \
             else *((type *) val) = *((type *)(ptr)); }
 
 
 static void
-osl_rw_memory(ACPI_PHYSICAL_ADDRESS Address, UINT32 *Value,
+osl_rw_memory(ACPI_PHYSICAL_ADDRESS Address, UINT64 *Value,
     UINT32 Width, int write)
 {
         size_t  maplen = Width / 8;
         caddr_t ptr;
 

@@ -900,10 +926,13 @@
                 OSL_RW(ptr, Value, uint16_t, write);
                 break;
         case 4:
                 OSL_RW(ptr, Value, uint32_t, write);
                 break;
+        case 8:
+                OSL_RW(ptr, Value, uint64_t, write);
+                break;
         default:
                 cmn_err(CE_WARN, "!osl_rw_memory: invalid size %d",
                     Width);
                 break;
         }

@@ -911,19 +940,19 @@
         psm_unmap(ptr, maplen);
 }
 
 ACPI_STATUS
 AcpiOsReadMemory(ACPI_PHYSICAL_ADDRESS Address,
-                UINT32 *Value, UINT32 Width)
+                UINT64 *Value, UINT32 Width)
 {
         osl_rw_memory(Address, Value, Width, 0);
         return (AE_OK);
 }
 
 ACPI_STATUS
 AcpiOsWriteMemory(ACPI_PHYSICAL_ADDRESS Address,
-                UINT32 Value, UINT32 Width)
+                UINT64 Value, UINT32 Width)
 {
         osl_rw_memory(Address, &Value, Width, 1);
         return (AE_OK);
 }