Print this page
update to acpica-unix2-20140114
acpica-unix2-20130823
PANKOVs restructure
   1 /*******************************************************************************
   2  *
   3  * Module Name: dmresrcs.c - "Small" Resource Descriptor disassembly
   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.


  59  *
  60  * PARAMETERS:  Resource            - Pointer to the resource descriptor
  61  *              Length              - Length of the descriptor in bytes
  62  *              Level               - Current source code indentation level
  63  *
  64  * RETURN:      None
  65  *
  66  * DESCRIPTION: Decode a IRQ descriptor, either Irq() or IrqNoFlags()
  67  *
  68  ******************************************************************************/
  69 
  70 void
  71 AcpiDmIrqDescriptor (
  72     AML_RESOURCE            *Resource,
  73     UINT32                  Length,
  74     UINT32                  Level)
  75 {
  76 
  77     AcpiDmIndent (Level);
  78     AcpiOsPrintf ("%s (",
  79         AcpiGbl_IrqDecode [Length & 1]);
  80 
  81     /* Decode flags byte if present */
  82 
  83     if (Length & 1)
  84     {
  85         AcpiOsPrintf ("%s, %s, %s, ",
  86             AcpiGbl_HeDecode [Resource->Irq.Flags & 1],
  87             AcpiGbl_LlDecode [(Resource->Irq.Flags >> 3) & 1],
  88             AcpiGbl_ShrDecode [(Resource->Irq.Flags >> 4) & 1]);
  89     }
  90 
  91     /* Insert a descriptor name */
  92 
  93     AcpiDmDescriptorName ();
  94     AcpiOsPrintf (")\n");
  95 
  96     AcpiDmIndent (Level + 1);
  97     AcpiDmBitList (Resource->Irq.IrqMask);
  98 }
  99 
 100 
 101 /*******************************************************************************
 102  *
 103  * FUNCTION:    AcpiDmDmaDescriptor
 104  *
 105  * PARAMETERS:  Resource            - Pointer to the resource descriptor
 106  *              Length              - Length of the descriptor in bytes
 107  *              Level               - Current source code indentation level
 108  *
 109  * RETURN:      None
 110  *
 111  * DESCRIPTION: Decode a DMA descriptor
 112  *
 113  ******************************************************************************/
 114 
 115 void
 116 AcpiDmDmaDescriptor (
 117     AML_RESOURCE            *Resource,
 118     UINT32                  Length,
 119     UINT32                  Level)
 120 {
 121 
 122     AcpiDmIndent (Level);
 123     AcpiOsPrintf ("DMA (%s, %s, %s, ",
 124             AcpiGbl_TypDecode [(Resource->Dma.Flags >> 5) & 3],
 125             AcpiGbl_BmDecode  [(Resource->Dma.Flags >> 2) & 1],
 126             AcpiGbl_SizDecode [(Resource->Dma.Flags >> 0) & 3]);
 127 
 128     /* Insert a descriptor name */
 129 
 130     AcpiDmDescriptorName ();
 131     AcpiOsPrintf (")\n");
 132 
 133     AcpiDmIndent (Level + 1);
 134     AcpiDmBitList (Resource->Dma.DmaChannelMask);
 135 }
 136 
 137 
 138 /*******************************************************************************
 139  *











































 140  * FUNCTION:    AcpiDmIoDescriptor
 141  *
 142  * PARAMETERS:  Resource            - Pointer to the resource descriptor
 143  *              Length              - Length of the descriptor in bytes
 144  *              Level               - Current source code indentation level
 145  *
 146  * RETURN:      None
 147  *
 148  * DESCRIPTION: Decode an IO descriptor
 149  *
 150  ******************************************************************************/
 151 
 152 void
 153 AcpiDmIoDescriptor (
 154     AML_RESOURCE            *Resource,
 155     UINT32                  Length,
 156     UINT32                  Level)
 157 {
 158 
 159     AcpiDmIndent (Level);
 160     AcpiOsPrintf ("IO (%s,\n",
 161         AcpiGbl_IoDecode [(Resource->Io.Flags & 1)]);
 162 
 163     AcpiDmIndent (Level + 1);
 164     AcpiDmDumpInteger16 (Resource->Io.Minimum, "Range Minimum");
 165 
 166     AcpiDmIndent (Level + 1);
 167     AcpiDmDumpInteger16 (Resource->Io.Maximum, "Range Maximum");
 168 
 169     AcpiDmIndent (Level + 1);
 170     AcpiDmDumpInteger8 (Resource->Io.Alignment, "Alignment");
 171 
 172     AcpiDmIndent (Level + 1);
 173     AcpiDmDumpInteger8 (Resource->Io.AddressLength, "Length");
 174 
 175     /* Insert a descriptor name */
 176 
 177     AcpiDmIndent (Level + 1);
 178     AcpiDmDescriptorName ();
 179     AcpiOsPrintf (")\n");
 180 }
 181 


 227  *              Level               - Current source code indentation level
 228  *
 229  * RETURN:      None
 230  *
 231  * DESCRIPTION: Decode a Start Dependendent functions descriptor
 232  *
 233  ******************************************************************************/
 234 
 235 void
 236 AcpiDmStartDependentDescriptor (
 237     AML_RESOURCE            *Resource,
 238     UINT32                  Length,
 239     UINT32                  Level)
 240 {
 241 
 242     AcpiDmIndent (Level);
 243 
 244     if (Length & 1)
 245     {
 246         AcpiOsPrintf ("StartDependentFn (0x%2.2X, 0x%2.2X)\n",
 247             (UINT32) Resource->StartDpf.Flags & 3,
 248             (UINT32) (Resource->StartDpf.Flags >> 2) & 3);
 249     }
 250     else
 251     {
 252         AcpiOsPrintf ("StartDependentFnNoPri ()\n");
 253     }
 254 
 255     AcpiDmIndent (Level);
 256     AcpiOsPrintf ("{\n");
 257 }
 258 
 259 
 260 /*******************************************************************************
 261  *
 262  * FUNCTION:    AcpiDmEndDependentDescriptor
 263  *
 264  * PARAMETERS:  Resource            - Pointer to the resource descriptor
 265  *              Length              - Length of the descriptor in bytes
 266  *              Level               - Current source code indentation level
 267  *
 268  * RETURN:      None


 295  *
 296  * RETURN:      None
 297  *
 298  * DESCRIPTION: Decode a Vendor Small Descriptor
 299  *
 300  ******************************************************************************/
 301 
 302 void
 303 AcpiDmVendorSmallDescriptor (
 304     AML_RESOURCE            *Resource,
 305     UINT32                  Length,
 306     UINT32                  Level)
 307 {
 308 
 309     AcpiDmVendorCommon ("Short",
 310         ACPI_ADD_PTR (UINT8, Resource, sizeof (AML_RESOURCE_SMALL_HEADER)),
 311         Length, Level);
 312 }
 313 
 314 #endif
 315 
   1 /*******************************************************************************
   2  *
   3  * Module Name: dmresrcs.c - "Small" Resource Descriptor disassembly
   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.


  59  *
  60  * PARAMETERS:  Resource            - Pointer to the resource descriptor
  61  *              Length              - Length of the descriptor in bytes
  62  *              Level               - Current source code indentation level
  63  *
  64  * RETURN:      None
  65  *
  66  * DESCRIPTION: Decode a IRQ descriptor, either Irq() or IrqNoFlags()
  67  *
  68  ******************************************************************************/
  69 
  70 void
  71 AcpiDmIrqDescriptor (
  72     AML_RESOURCE            *Resource,
  73     UINT32                  Length,
  74     UINT32                  Level)
  75 {
  76 
  77     AcpiDmIndent (Level);
  78     AcpiOsPrintf ("%s (",
  79         AcpiGbl_IrqDecode [ACPI_GET_1BIT_FLAG (Length)]);
  80 
  81     /* Decode flags byte if present */
  82 
  83     if (Length & 1)
  84     {
  85         AcpiOsPrintf ("%s, %s, %s, ",
  86             AcpiGbl_HeDecode [ACPI_GET_1BIT_FLAG (Resource->Irq.Flags)],
  87             AcpiGbl_LlDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->Irq.Flags, 3)],
  88             AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Irq.Flags, 4)]);
  89     }
  90 
  91     /* Insert a descriptor name */
  92 
  93     AcpiDmDescriptorName ();
  94     AcpiOsPrintf (")\n");
  95 
  96     AcpiDmIndent (Level + 1);
  97     AcpiDmBitList (Resource->Irq.IrqMask);
  98 }
  99 
 100 
 101 /*******************************************************************************
 102  *
 103  * FUNCTION:    AcpiDmDmaDescriptor
 104  *
 105  * PARAMETERS:  Resource            - Pointer to the resource descriptor
 106  *              Length              - Length of the descriptor in bytes
 107  *              Level               - Current source code indentation level
 108  *
 109  * RETURN:      None
 110  *
 111  * DESCRIPTION: Decode a DMA descriptor
 112  *
 113  ******************************************************************************/
 114 
 115 void
 116 AcpiDmDmaDescriptor (
 117     AML_RESOURCE            *Resource,
 118     UINT32                  Length,
 119     UINT32                  Level)
 120 {
 121 
 122     AcpiDmIndent (Level);
 123     AcpiOsPrintf ("DMA (%s, %s, %s, ",
 124         AcpiGbl_TypDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Dma.Flags, 5)],
 125         AcpiGbl_BmDecode  [ACPI_EXTRACT_1BIT_FLAG (Resource->Dma.Flags, 2)],
 126         AcpiGbl_SizDecode [ACPI_GET_2BIT_FLAG (Resource->Dma.Flags)]);
 127 
 128     /* Insert a descriptor name */
 129 
 130     AcpiDmDescriptorName ();
 131     AcpiOsPrintf (")\n");
 132 
 133     AcpiDmIndent (Level + 1);
 134     AcpiDmBitList (Resource->Dma.DmaChannelMask);
 135 }
 136 
 137 
 138 /*******************************************************************************
 139  *
 140  * FUNCTION:    AcpiDmFixedDmaDescriptor
 141  *
 142  * PARAMETERS:  Resource            - Pointer to the resource descriptor
 143  *              Length              - Length of the descriptor in bytes
 144  *              Level               - Current source code indentation level
 145  *
 146  * RETURN:      None
 147  *
 148  * DESCRIPTION: Decode a FixedDMA descriptor
 149  *
 150  ******************************************************************************/
 151 
 152 void
 153 AcpiDmFixedDmaDescriptor (
 154     AML_RESOURCE            *Resource,
 155     UINT32                  Length,
 156     UINT32                  Level)
 157 {
 158 
 159     AcpiDmIndent (Level);
 160     AcpiOsPrintf ("FixedDMA (0x%4.4X, 0x%4.4X, ",
 161         Resource->FixedDma.RequestLines,
 162         Resource->FixedDma.Channels);
 163 
 164     if (Resource->FixedDma.Width <= 5)
 165     {
 166         AcpiOsPrintf ("%s, ",
 167             AcpiGbl_DtsDecode [Resource->FixedDma.Width]);
 168     }
 169     else
 170     {
 171         AcpiOsPrintf ("%X /* INVALID DMA WIDTH */, ", Resource->FixedDma.Width);
 172     }
 173 
 174     /* Insert a descriptor name */
 175 
 176     AcpiDmDescriptorName ();
 177     AcpiOsPrintf (")\n");
 178 }
 179 
 180 
 181 /*******************************************************************************
 182  *
 183  * FUNCTION:    AcpiDmIoDescriptor
 184  *
 185  * PARAMETERS:  Resource            - Pointer to the resource descriptor
 186  *              Length              - Length of the descriptor in bytes
 187  *              Level               - Current source code indentation level
 188  *
 189  * RETURN:      None
 190  *
 191  * DESCRIPTION: Decode an IO descriptor
 192  *
 193  ******************************************************************************/
 194 
 195 void
 196 AcpiDmIoDescriptor (
 197     AML_RESOURCE            *Resource,
 198     UINT32                  Length,
 199     UINT32                  Level)
 200 {
 201 
 202     AcpiDmIndent (Level);
 203     AcpiOsPrintf ("IO (%s,\n",
 204         AcpiGbl_IoDecode [ACPI_GET_1BIT_FLAG (Resource->Io.Flags)]);
 205 
 206     AcpiDmIndent (Level + 1);
 207     AcpiDmDumpInteger16 (Resource->Io.Minimum, "Range Minimum");
 208 
 209     AcpiDmIndent (Level + 1);
 210     AcpiDmDumpInteger16 (Resource->Io.Maximum, "Range Maximum");
 211 
 212     AcpiDmIndent (Level + 1);
 213     AcpiDmDumpInteger8 (Resource->Io.Alignment, "Alignment");
 214 
 215     AcpiDmIndent (Level + 1);
 216     AcpiDmDumpInteger8 (Resource->Io.AddressLength, "Length");
 217 
 218     /* Insert a descriptor name */
 219 
 220     AcpiDmIndent (Level + 1);
 221     AcpiDmDescriptorName ();
 222     AcpiOsPrintf (")\n");
 223 }
 224 


 270  *              Level               - Current source code indentation level
 271  *
 272  * RETURN:      None
 273  *
 274  * DESCRIPTION: Decode a Start Dependendent functions descriptor
 275  *
 276  ******************************************************************************/
 277 
 278 void
 279 AcpiDmStartDependentDescriptor (
 280     AML_RESOURCE            *Resource,
 281     UINT32                  Length,
 282     UINT32                  Level)
 283 {
 284 
 285     AcpiDmIndent (Level);
 286 
 287     if (Length & 1)
 288     {
 289         AcpiOsPrintf ("StartDependentFn (0x%2.2X, 0x%2.2X)\n",
 290             (UINT32) ACPI_GET_2BIT_FLAG (Resource->StartDpf.Flags),
 291             (UINT32) ACPI_EXTRACT_2BIT_FLAG (Resource->StartDpf.Flags, 2));
 292     }
 293     else
 294     {
 295         AcpiOsPrintf ("StartDependentFnNoPri ()\n");
 296     }
 297 
 298     AcpiDmIndent (Level);
 299     AcpiOsPrintf ("{\n");
 300 }
 301 
 302 
 303 /*******************************************************************************
 304  *
 305  * FUNCTION:    AcpiDmEndDependentDescriptor
 306  *
 307  * PARAMETERS:  Resource            - Pointer to the resource descriptor
 308  *              Length              - Length of the descriptor in bytes
 309  *              Level               - Current source code indentation level
 310  *
 311  * RETURN:      None


 338  *
 339  * RETURN:      None
 340  *
 341  * DESCRIPTION: Decode a Vendor Small Descriptor
 342  *
 343  ******************************************************************************/
 344 
 345 void
 346 AcpiDmVendorSmallDescriptor (
 347     AML_RESOURCE            *Resource,
 348     UINT32                  Length,
 349     UINT32                  Level)
 350 {
 351 
 352     AcpiDmVendorCommon ("Short",
 353         ACPI_ADD_PTR (UINT8, Resource, sizeof (AML_RESOURCE_SMALL_HEADER)),
 354         Length, Level);
 355 }
 356 
 357 #endif