Print this page
acpica-unix2-20130823
PANKOVs restructure

@@ -3,11 +3,11 @@
  * Module Name: dmresrcl.c - "Large" Resource Descriptor disassembly
  *
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2013, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:

@@ -151,20 +151,23 @@
         AcpiDmIndent (Level + 1);
 
         switch (Type)
         {
         case 16:
+
             AcpiDmDumpInteger16 (ACPI_CAST_PTR (UINT16, Source)[i],
                 AcpiDmMemoryNames[i]);
             break;
 
         case 32:
+
             AcpiDmDumpInteger32 (ACPI_CAST_PTR (UINT32, Source)[i],
                 AcpiDmMemoryNames[i]);
             break;
 
         default:
+
             return;
         }
     }
 }
 

@@ -199,25 +202,29 @@
         AcpiDmIndent (Level + 1);
 
         switch (Type)
         {
         case 16:
+
             AcpiDmDumpInteger16 (ACPI_CAST_PTR (UINT16, Source)[i],
                 AcpiDmAddressNames[i]);
             break;
 
         case 32:
+
             AcpiDmDumpInteger32 (ACPI_CAST_PTR (UINT32, Source)[i],
                 AcpiDmAddressNames[i]);
             break;
 
         case 64:
+
             AcpiDmDumpInteger64 (ACPI_CAST_PTR (UINT64, Source)[i],
                 AcpiDmAddressNames[i]);
             break;
 
         default:
+
             return;
         }
     }
 }
 

@@ -240,26 +247,31 @@
 {
 
     switch (Type)
     {
     case ACPI_RESOURCE_TYPE_ADDRESS16:
+
         AcpiOsPrintf ("Word");
         break;
 
     case ACPI_RESOURCE_TYPE_ADDRESS32:
+
         AcpiOsPrintf ("DWord");
         break;
 
     case ACPI_RESOURCE_TYPE_ADDRESS64:
+
         AcpiOsPrintf ("QWord");
         break;
 
     case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64:
+
         AcpiOsPrintf ("Extended");
         break;
 
     default:
+
         return;
     }
 }
 
 

@@ -316,11 +328,11 @@
         return;
     }
 
     /* This is either a Memory, IO, or BusNumber descriptor (0,1,2) */
 
-    AcpiOsPrintf ("%s (", AcpiGbl_WordDecode [ResourceType & 0x3]);
+    AcpiOsPrintf ("%s (", AcpiGbl_WordDecode [ACPI_GET_2BIT_FLAG (ResourceType)]);
 
     /* Decode the general and type-specific flags */
 
     if (ResourceType == ACPI_MEMORY_RANGE)
     {

@@ -329,11 +341,11 @@
     else /* IO range or BusNumberRange */
     {
         AcpiDmIoFlags (Flags);
         if (ResourceType == ACPI_IO_RANGE)
         {
-            AcpiOsPrintf (" %s,", AcpiGbl_RngDecode [SpecificFlags & 0x3]);
+            AcpiOsPrintf (" %s,", AcpiGbl_RngDecode [ACPI_GET_2BIT_FLAG (SpecificFlags)]);
         }
     }
 }
 
 

@@ -381,14 +393,14 @@
 AcpiDmSpaceFlags (
     UINT8                   Flags)
 {
 
     AcpiOsPrintf ("%s, %s, %s, %s,",
-        AcpiGbl_ConsumeDecode [(Flags & 1)],
-        AcpiGbl_DecDecode [(Flags & 0x2) >> 1],
-        AcpiGbl_MinDecode [(Flags & 0x4) >> 2],
-        AcpiGbl_MaxDecode [(Flags & 0x8) >> 3]);
+        AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Flags)],
+        AcpiGbl_DecDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 1)],
+        AcpiGbl_MinDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 2)],
+        AcpiGbl_MaxDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 3)]);
 }
 
 
 /*******************************************************************************
  *

@@ -405,14 +417,14 @@
 static void
 AcpiDmIoFlags (
         UINT8               Flags)
 {
     AcpiOsPrintf ("%s, %s, %s, %s,",
-        AcpiGbl_ConsumeDecode [(Flags & 1)],
-        AcpiGbl_MinDecode [(Flags & 0x4) >> 2],
-        AcpiGbl_MaxDecode [(Flags & 0x8) >> 3],
-        AcpiGbl_DecDecode [(Flags & 0x2) >> 1]);
+        AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Flags)],
+        AcpiGbl_MinDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 2)],
+        AcpiGbl_MaxDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 3)],
+        AcpiGbl_DecDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 1)]);
 }
 
 
 /*******************************************************************************
  *

@@ -430,18 +442,18 @@
 AcpiDmIoFlags2 (
         UINT8               SpecificFlags)
 {
 
     AcpiOsPrintf (", %s",
-        AcpiGbl_TtpDecode [(SpecificFlags & 0x10) >> 4]);
+        AcpiGbl_TtpDecode [ACPI_EXTRACT_1BIT_FLAG (SpecificFlags, 4)]);
 
     /* TRS is only used if TTP is TypeTranslation */
 
     if (SpecificFlags & 0x10)
     {
         AcpiOsPrintf (", %s",
-            AcpiGbl_TrsDecode [(SpecificFlags & 0x20) >> 5]);
+            AcpiGbl_TrsDecode [ACPI_EXTRACT_1BIT_FLAG (SpecificFlags, 5)]);
     }
 }
 
 
 /*******************************************************************************

@@ -462,16 +474,16 @@
     UINT8                   Flags,
     UINT8                   SpecificFlags)
 {
 
     AcpiOsPrintf ("%s, %s, %s, %s, %s, %s,",
-        AcpiGbl_ConsumeDecode [(Flags & 1)],
-        AcpiGbl_DecDecode [(Flags & 0x2) >> 1],
-        AcpiGbl_MinDecode [(Flags & 0x4) >> 2],
-        AcpiGbl_MaxDecode [(Flags & 0x8) >> 3],
-        AcpiGbl_MemDecode [(SpecificFlags & 0x6) >> 1],
-        AcpiGbl_RwDecode [(SpecificFlags & 0x1)]);
+        AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Flags)],
+        AcpiGbl_DecDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 1)],
+        AcpiGbl_MinDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 2)],
+        AcpiGbl_MaxDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 3)],
+        AcpiGbl_MemDecode [ACPI_EXTRACT_2BIT_FLAG (SpecificFlags, 1)],
+        AcpiGbl_RwDecode [ACPI_GET_1BIT_FLAG (SpecificFlags)]);
 }
 
 
 /*******************************************************************************
  *

@@ -489,12 +501,12 @@
 AcpiDmMemoryFlags2 (
     UINT8                   SpecificFlags)
 {
 
     AcpiOsPrintf (", %s, %s",
-        AcpiGbl_MtpDecode [(SpecificFlags & 0x18) >> 3],
-        AcpiGbl_TtpDecode [(SpecificFlags & 0x20) >> 5]);
+        AcpiGbl_MtpDecode [ACPI_EXTRACT_2BIT_FLAG (SpecificFlags, 3)],
+        AcpiGbl_TtpDecode [ACPI_EXTRACT_1BIT_FLAG (SpecificFlags, 5)]);
 }
 
 
 /*******************************************************************************
  *

@@ -551,11 +563,11 @@
     /* Make sure that the ResourceSource string exists before dumping it */
 
     if (TotalLength > (MinimumTotalLength + 1))
     {
         AcpiOsPrintf (" ");
-        AcpiUtPrintString ((char *) &AmlResourceSource[1], ACPI_UINT8_MAX);
+        AcpiUtPrintString ((char *) &AmlResourceSource[1], ACPI_UINT16_MAX);
     }
 
     AcpiOsPrintf (", ");
 }
 

@@ -765,11 +777,11 @@
 
     /* Dump name and read/write flag */
 
     AcpiDmIndent (Level);
     AcpiOsPrintf ("Memory24 (%s,\n",
-        AcpiGbl_RwDecode [Resource->Memory24.Flags & 1]);
+        AcpiGbl_RwDecode [ACPI_GET_1BIT_FLAG (Resource->Memory24.Flags)]);
 
     /* Dump the 4 contiguous WORD values */
 
     AcpiDmMemoryFields (&Resource->Memory24.Minimum, 16, Level);
 

@@ -804,11 +816,11 @@
 
     /* Dump name and read/write flag */
 
     AcpiDmIndent (Level);
     AcpiOsPrintf ("Memory32 (%s,\n",
-        AcpiGbl_RwDecode [Resource->Memory32.Flags & 1]);
+        AcpiGbl_RwDecode [ACPI_GET_1BIT_FLAG (Resource->Memory32.Flags)]);
 
     /* Dump the 4 contiguous DWORD values */
 
     AcpiDmMemoryFields (&Resource->Memory32.Minimum, 32, Level);
 

@@ -843,11 +855,11 @@
 
     /* Dump name and read/write flag */
 
     AcpiDmIndent (Level);
     AcpiOsPrintf ("Memory32Fixed (%s,\n",
-        AcpiGbl_RwDecode [Resource->FixedMemory32.Flags & 1]);
+        AcpiGbl_RwDecode [ACPI_GET_1BIT_FLAG (Resource->FixedMemory32.Flags)]);
 
     AcpiDmIndent (Level + 1);
     AcpiDmDumpInteger32 (Resource->FixedMemory32.Address, "Address Base");
 
     AcpiDmIndent (Level + 1);

@@ -940,14 +952,14 @@
     UINT32                  i;
 
 
     AcpiDmIndent (Level);
     AcpiOsPrintf ("Interrupt (%s, %s, %s, %s, ",
-        AcpiGbl_ConsumeDecode [(Resource->ExtendedIrq.Flags & 1)],
-        AcpiGbl_HeDecode [(Resource->ExtendedIrq.Flags >> 1) & 1],
-        AcpiGbl_LlDecode [(Resource->ExtendedIrq.Flags >> 2) & 1],
-        AcpiGbl_ShrDecode [(Resource->ExtendedIrq.Flags >> 3) & 1]);
+        AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Resource->ExtendedIrq.Flags)],
+        AcpiGbl_HeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->ExtendedIrq.Flags, 1)],
+        AcpiGbl_LlDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->ExtendedIrq.Flags, 2)],
+        AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->ExtendedIrq.Flags, 3)]);
 
     /*
      * The ResourceSource fields are optional and appear after the interrupt
      * list. Must compute length based on length of the list. First xrupt
      * is included in the struct (reason for -1 below)

@@ -1048,6 +1060,5 @@
         ACPI_ADD_PTR (UINT8, Resource, sizeof (AML_RESOURCE_LARGE_HEADER)),
         Length, Level);
 }
 
 #endif
-