Print this page
update to acpica-unix2-20140114
acpica-unix2-20130823
PANKOVs restructure
   1 /******************************************************************************
   2  *
   3  * Module Name: exdebug - Support for stores to the AML Debug Object
   4  *
   5  *****************************************************************************/
   6 
   7 /*
   8  * Copyright (C) 2000 - 2011, Intel Corp.
   9  * All rights reserved.
  10  *
  11  * Redistribution and use in source and binary forms, with or without
  12  * modification, are permitted provided that the following conditions
  13  * are met:
  14  * 1. Redistributions of source code must retain the above copyright
  15  *    notice, this list of conditions, and the following disclaimer,
  16  *    without modification.
  17  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  18  *    substantially similar to the "NO WARRANTY" disclaimer below
  19  *    ("Disclaimer") and any redistribution must be conditioned upon
  20  *    including a substantially similar Disclaimer requirement for further
  21  *    binary redistribution.
  22  * 3. Neither the names of the above-listed copyright holders nor the names
  23  *    of any contributors may be used to endorse or promote products derived
  24  *    from this software without specific prior written permission.
  25  *
  26  * Alternatively, this software may be distributed under the terms of the
  27  * GNU General Public License ("GPL") version 2 as published by the Free
  28  * Software Foundation.


 145     {
 146     case ACPI_TYPE_INTEGER:
 147 
 148         /* Output correct integer width */
 149 
 150         if (AcpiGbl_IntegerByteWidth == 4)
 151         {
 152             AcpiOsPrintf ("0x%8.8X\n",
 153                 (UINT32) SourceDesc->Integer.Value);
 154         }
 155         else
 156         {
 157             AcpiOsPrintf ("0x%8.8X%8.8X\n",
 158                 ACPI_FORMAT_UINT64 (SourceDesc->Integer.Value));
 159         }
 160         break;
 161 
 162     case ACPI_TYPE_BUFFER:
 163 
 164         AcpiOsPrintf ("[0x%.2X]\n", (UINT32) SourceDesc->Buffer.Length);
 165         AcpiUtDumpBuffer2 (SourceDesc->Buffer.Pointer,
 166             (SourceDesc->Buffer.Length < 256) ?
 167                 SourceDesc->Buffer.Length : 256, DB_BYTE_DISPLAY);
 168         break;
 169 
 170     case ACPI_TYPE_STRING:
 171 
 172         AcpiOsPrintf ("[0x%.2X] \"%s\"\n",
 173             SourceDesc->String.Length, SourceDesc->String.Pointer);
 174         break;
 175 
 176     case ACPI_TYPE_PACKAGE:
 177 
 178         AcpiOsPrintf ("[Contains 0x%.2X Elements]\n",
 179             SourceDesc->Package.Count);
 180 
 181         /* Output the entire contents of the package */
 182 
 183         for (i = 0; i < SourceDesc->Package.Count; i++)
 184         {
 185             AcpiExDoDebugObject (SourceDesc->Package.Elements[i],
 186                 Level+4, i+1);
 187         }
 188         break;
 189 
 190     case ACPI_TYPE_LOCAL_REFERENCE:
 191 
 192         AcpiOsPrintf ("[%s] ", AcpiUtGetReferenceName (SourceDesc));
 193 
 194         /* Decode the reference */
 195 
 196         switch (SourceDesc->Reference.Class)
 197         {
 198         case ACPI_REFCLASS_INDEX:
 199 
 200             AcpiOsPrintf ("0x%X\n", SourceDesc->Reference.Value);
 201             break;
 202 
 203         case ACPI_REFCLASS_TABLE:
 204 
 205             /* Case for DdbHandle */
 206 
 207             AcpiOsPrintf ("Table Index 0x%X\n", SourceDesc->Reference.Value);
 208             return;
 209 
 210         default:

 211             break;
 212         }
 213 
 214         AcpiOsPrintf ("  ");
 215 
 216         /* Check for valid node first, then valid object */
 217 
 218         if (SourceDesc->Reference.Node)
 219         {
 220             if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc->Reference.Node) !=
 221                     ACPI_DESC_TYPE_NAMED)
 222             {
 223                 AcpiOsPrintf (" %p - Not a valid namespace node\n",
 224                     SourceDesc->Reference.Node);
 225             }
 226             else
 227             {
 228                 AcpiOsPrintf ("Node %p [%4.4s] ", SourceDesc->Reference.Node,
 229                     (SourceDesc->Reference.Node)->Name.Ascii);
 230 
 231                 switch ((SourceDesc->Reference.Node)->Type)
 232                 {
 233                 /* These types have no attached object */
 234 
 235                 case ACPI_TYPE_DEVICE:
 236                     AcpiOsPrintf ("Device\n");
 237                     break;
 238 
 239                 case ACPI_TYPE_THERMAL:
 240                     AcpiOsPrintf ("Thermal Zone\n");
 241                     break;
 242 
 243                 default:

 244                     AcpiExDoDebugObject ((SourceDesc->Reference.Node)->Object,
 245                         Level+4, 0);
 246                     break;
 247                 }
 248             }
 249         }
 250         else if (SourceDesc->Reference.Object)
 251         {
 252             if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc->Reference.Object) ==
 253                     ACPI_DESC_TYPE_NAMED)
 254             {
 255                 AcpiExDoDebugObject (((ACPI_NAMESPACE_NODE *)
 256                     SourceDesc->Reference.Object)->Object,
 257                     Level+4, 0);
 258             }
 259             else
 260             {
 261                 AcpiExDoDebugObject (SourceDesc->Reference.Object,
 262                     Level+4, 0);
 263             }
 264         }
 265         break;
 266 
 267     default:
 268 
 269         AcpiOsPrintf ("%p\n", SourceDesc);
 270         break;
 271     }
 272 
 273     ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, "\n"));
 274     return_VOID;
 275 }
 276 #endif
 277 
 278 
   1 /******************************************************************************
   2  *
   3  * Module Name: exdebug - Support for stores to the AML Debug Object
   4  *
   5  *****************************************************************************/
   6 
   7 /*
   8  * Copyright (C) 2000 - 2014, Intel Corp.
   9  * All rights reserved.
  10  *
  11  * Redistribution and use in source and binary forms, with or without
  12  * modification, are permitted provided that the following conditions
  13  * are met:
  14  * 1. Redistributions of source code must retain the above copyright
  15  *    notice, this list of conditions, and the following disclaimer,
  16  *    without modification.
  17  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  18  *    substantially similar to the "NO WARRANTY" disclaimer below
  19  *    ("Disclaimer") and any redistribution must be conditioned upon
  20  *    including a substantially similar Disclaimer requirement for further
  21  *    binary redistribution.
  22  * 3. Neither the names of the above-listed copyright holders nor the names
  23  *    of any contributors may be used to endorse or promote products derived
  24  *    from this software without specific prior written permission.
  25  *
  26  * Alternatively, this software may be distributed under the terms of the
  27  * GNU General Public License ("GPL") version 2 as published by the Free
  28  * Software Foundation.


 145     {
 146     case ACPI_TYPE_INTEGER:
 147 
 148         /* Output correct integer width */
 149 
 150         if (AcpiGbl_IntegerByteWidth == 4)
 151         {
 152             AcpiOsPrintf ("0x%8.8X\n",
 153                 (UINT32) SourceDesc->Integer.Value);
 154         }
 155         else
 156         {
 157             AcpiOsPrintf ("0x%8.8X%8.8X\n",
 158                 ACPI_FORMAT_UINT64 (SourceDesc->Integer.Value));
 159         }
 160         break;
 161 
 162     case ACPI_TYPE_BUFFER:
 163 
 164         AcpiOsPrintf ("[0x%.2X]\n", (UINT32) SourceDesc->Buffer.Length);
 165         AcpiUtDumpBuffer (SourceDesc->Buffer.Pointer,
 166             (SourceDesc->Buffer.Length < 256) ?
 167                 SourceDesc->Buffer.Length : 256, DB_BYTE_DISPLAY, 0);
 168         break;
 169 
 170     case ACPI_TYPE_STRING:
 171 
 172         AcpiOsPrintf ("[0x%.2X] \"%s\"\n",
 173             SourceDesc->String.Length, SourceDesc->String.Pointer);
 174         break;
 175 
 176     case ACPI_TYPE_PACKAGE:
 177 
 178         AcpiOsPrintf ("[Contains 0x%.2X Elements]\n",
 179             SourceDesc->Package.Count);
 180 
 181         /* Output the entire contents of the package */
 182 
 183         for (i = 0; i < SourceDesc->Package.Count; i++)
 184         {
 185             AcpiExDoDebugObject (SourceDesc->Package.Elements[i],
 186                 Level+4, i+1);
 187         }
 188         break;
 189 
 190     case ACPI_TYPE_LOCAL_REFERENCE:
 191 
 192         AcpiOsPrintf ("[%s] ", AcpiUtGetReferenceName (SourceDesc));
 193 
 194         /* Decode the reference */
 195 
 196         switch (SourceDesc->Reference.Class)
 197         {
 198         case ACPI_REFCLASS_INDEX:
 199 
 200             AcpiOsPrintf ("0x%X\n", SourceDesc->Reference.Value);
 201             break;
 202 
 203         case ACPI_REFCLASS_TABLE:
 204 
 205             /* Case for DdbHandle */
 206 
 207             AcpiOsPrintf ("Table Index 0x%X\n", SourceDesc->Reference.Value);
 208             return_VOID;
 209 
 210         default:
 211 
 212             break;
 213         }
 214 
 215         AcpiOsPrintf ("  ");
 216 
 217         /* Check for valid node first, then valid object */
 218 
 219         if (SourceDesc->Reference.Node)
 220         {
 221             if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc->Reference.Node) !=
 222                     ACPI_DESC_TYPE_NAMED)
 223             {
 224                 AcpiOsPrintf (" %p - Not a valid namespace node\n",
 225                     SourceDesc->Reference.Node);
 226             }
 227             else
 228             {
 229                 AcpiOsPrintf ("Node %p [%4.4s] ", SourceDesc->Reference.Node,
 230                     (SourceDesc->Reference.Node)->Name.Ascii);
 231 
 232                 switch ((SourceDesc->Reference.Node)->Type)
 233                 {
 234                 /* These types have no attached object */
 235 
 236                 case ACPI_TYPE_DEVICE:
 237                     AcpiOsPrintf ("Device\n");
 238                     break;
 239 
 240                 case ACPI_TYPE_THERMAL:
 241                     AcpiOsPrintf ("Thermal Zone\n");
 242                     break;
 243 
 244                 default:
 245 
 246                     AcpiExDoDebugObject ((SourceDesc->Reference.Node)->Object,
 247                         Level+4, 0);
 248                     break;
 249                 }
 250             }
 251         }
 252         else if (SourceDesc->Reference.Object)
 253         {
 254             if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc->Reference.Object) ==
 255                     ACPI_DESC_TYPE_NAMED)
 256             {
 257                 AcpiExDoDebugObject (((ACPI_NAMESPACE_NODE *)
 258                     SourceDesc->Reference.Object)->Object,
 259                     Level+4, 0);
 260             }
 261             else
 262             {
 263                 AcpiExDoDebugObject (SourceDesc->Reference.Object,
 264                     Level+4, 0);
 265             }
 266         }
 267         break;
 268 
 269     default:
 270 
 271         AcpiOsPrintf ("%p\n", SourceDesc);
 272         break;
 273     }
 274 
 275     ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, "\n"));
 276     return_VOID;
 277 }
 278 #endif