sys/contrib/dev/acpica/source/components/disassembler/dmresrcl2.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiDmGpioCommon
 *
 * PARAMETERS:  Info                - Extra resource info
 *              Resource            - Pointer to the resource descriptor
 *              Level               - Current source code indentation level
 *
 * RETURN:      None
 *
 * DESCRIPTION: Decode common parts of a GPIO Interrupt descriptor
 *
 ******************************************************************************/
AcpiDmGpioCommon
PARAMETERS:  Info                - Extra resource info
Resource            - Pointer to the resource descriptor
Level               - Current source code indentation level

None

Decode common parts of a GPIO Interrupt descriptor
AcpiDmGpioCommon PARAMETERS : Info - Extra resource info Resource - Pointer to the resource descriptor Level - Current source code indentation level None Decode common parts of a GPIO Interrupt descriptor
static void
AcpiDmGpioCommon (
    ACPI_OP_WALK_INFO       *Info,
    AML_RESOURCE            *Resource,
    UINT32                  Level)
{
    UINT16                  *PinList;
    UINT8                   *VendorData;
    char                    *DeviceName = NULL;
    UINT32                  PinCount;
    UINT32                  i;
    AcpiDmIndent (Level + 1);
    if (Resource->Gpio.ResSourceOffset)
    {
        DeviceName = ACPI_ADD_PTR (char,
            Resource, Resource->Gpio.ResSourceOffset),
        AcpiUtPrintString (DeviceName, ACPI_UINT16_MAX);
    }
    AcpiOsPrintf (", ");
    AcpiOsPrintf ("0x%2.2X, ", Resource->Gpio.ResSourceIndex);
    AcpiOsPrintf ("%s, ",
        AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Resource->Gpio.Flags)]);
    AcpiDmDescriptorName ();
    AcpiOsPrintf (",");
    if (Resource->Gpio.VendorOffset)
    {
        AcpiOsPrintf ("\n");
        AcpiDmIndent (Level + 1);
        VendorData = ACPI_ADD_PTR (UINT8, Resource,
            Resource->Gpio.VendorOffset);
        AcpiDmDumpRawDataBuffer (VendorData,
            Resource->Gpio.VendorLength, Level);
    }
    AcpiOsPrintf (")\n");
    AcpiDmIndent (Level + 1);
    AcpiOsPrintf ("{   // Pin list\n");
    PinCount = ((UINT32) (Resource->Gpio.ResSourceOffset -
        Resource->Gpio.PinTableOffset)) /
        sizeof (UINT16);
    PinList = (UINT16 *) ACPI_ADD_PTR (char, Resource,
        Resource->Gpio.PinTableOffset);
    for (i = 0; i < PinCount; i++)
    {
        AcpiDmIndent (Level + 2);
        AcpiOsPrintf ("0x%4.4X%s\n", PinList[i],
            ((i + 1) < PinCount) ? "," : "");
    }
    AcpiDmIndent (Level + 1);
    AcpiOsPrintf ("}\n");
#ifndef _KERNEL
    MpSaveGpioInfo (Info->MappingOp, Resource,
        PinCount, PinList, DeviceName);
#endif
}
static void AcpiDmGpioCommon ( ACPI_OP_WALK_INFO * Info , AML_RESOURCE * Resource , UINT32 Level ) { UINT16 * PinList ; UINT8 * VendorData ; char * DeviceName = NULL ; UINT32 PinCount ; UINT32 i ; AcpiDmIndent ( Level + 1 ) ; if ( Resource -> Gpio . ResSourceOffset ) { DeviceName = ACPI_ADD_PTR ( char , Resource , Resource -> Gpio . ResSourceOffset ) , AcpiUtPrintString ( DeviceName , ACPI_UINT16_MAX ) ; } AcpiOsPrintf ( " " ) ; AcpiOsPrintf ( " " , Resource -> Gpio . ResSourceIndex ) ; AcpiOsPrintf ( " " , AcpiGbl_ConsumeDecode [ ACPI_GET_1BIT_FLAG ( Resource -> Gpio . Flags ) ] ) ; AcpiDmDescriptorName ( ) ; AcpiOsPrintf ( " " ) ; if ( Resource -> Gpio . VendorOffset ) { AcpiOsPrintf ( " \n " ) ; AcpiDmIndent ( Level + 1 ) ; VendorData = ACPI_ADD_PTR ( UINT8 , Resource , Resource -> Gpio . VendorOffset ) ; AcpiDmDumpRawDataBuffer ( VendorData , Resource -> Gpio . VendorLength , Level ) ; } AcpiOsPrintf ( " \n " ) ; AcpiDmIndent ( Level + 1 ) ; AcpiOsPrintf ( " \n " ) ; PinCount = ( ( UINT32 ) ( Resource -> Gpio . ResSourceOffset - Resource -> Gpio . PinTableOffset ) ) / sizeof ( UINT16 ) ; PinList = ( UINT16 * ) ACPI_ADD_PTR ( char , Resource , Resource -> Gpio . PinTableOffset ) ; for ( i = 0 ; i < PinCount ; i ++ ) { AcpiDmIndent ( Level + 2 ) ; AcpiOsPrintf ( " \n " , PinList [ i ] , ( ( i + 1 ) < PinCount ) ? " " : " " ) ; } AcpiDmIndent ( Level + 1 ) ; AcpiOsPrintf ( " \n " ) ; #ifndef _KERNEL MpSaveGpioInfo ( Info -> MappingOp , Resource , PinCount , PinList , DeviceName ) ; #endif }
FUNCTION:    AcpiDmGpioCommon
 PARAMETERS:  Info                - Extra resource info
              Resource            - Pointer to the resource descriptor
              Level               - Current source code indentation level
FUNCTION : AcpiDmGpioCommon PARAMETERS : Info - Extra resource info Resource - Pointer to the resource descriptor Level - Current source code indentation level
/* ResourceSource, ResourceSourceIndex, ResourceType */ /* Insert a descriptor name */ /* Dump the vendor data */ /* Dump the interrupt list */