kernel/acpica/compiler/aslrestype2s.c
/*******************************************************************************
 *
 * FUNCTION:    RsGetVendorData
 *
 * PARAMETERS:  InitializerOp       - Current parse op, start of the resource
 *                                    descriptor.
 *              VendorData          - Where the vendor data is returned
 *              DescriptorOffset    - Where vendor data begins in descriptor
 *
 * RETURN:      TRUE if valid vendor data was returned, FALSE otherwise.
 *
 * DESCRIPTION: Extract the vendor data and construct a vendor data buffer.
 *
 ******************************************************************************/
RsGetVendorData
PARAMETERS:  InitializerOp       - Current parse op, start of the resource
descriptor.
VendorData          - Where the vendor data is returned
DescriptorOffset    - Where vendor data begins in descriptor

TRUE if valid vendor data was returned, FALSE otherwise.

Extract the vendor data and construct a vendor data buffer.
RsGetVendorData PARAMETERS : InitializerOp - Current parse op start of the resource descriptor . VendorData - Where the vendor data is returned DescriptorOffset - Where vendor data begins in descriptor TRUE if valid vendor data was returned FALSE otherwise . Extract the vendor data and construct a vendor data buffer .
static BOOLEAN
RsGetVendorData (
    ACPI_PARSE_OBJECT       *InitializerOp,
    UINT8                   *VendorData,
    ACPI_SIZE               DescriptorOffset)
{
    ACPI_PARSE_OBJECT       *BufferOp;
    UINT32                  SpecifiedLength = ACPI_UINT32_MAX;
    UINT16                  ActualLength = 0;
    if (InitializerOp->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG)
    {
        return (FALSE);
    }
    BufferOp = InitializerOp->Asl.Child;
    if (!BufferOp)
    {
        AslError (ASL_ERROR, ASL_MSG_SYNTAX, InitializerOp, "");
        return (FALSE);
    }
    if (BufferOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
    {
        SpecifiedLength = (UINT16) BufferOp->Asl.Value.Integer;
    }
    RsCreateByteField (InitializerOp, ACPI_RESTAG_VENDORDATA,
        (UINT16) DescriptorOffset);
    BufferOp = RsCompleteNodeAndGetNext (BufferOp);
    if (BufferOp->Asl.ParseOpcode != PARSEOP_DEFAULT_ARG)
    {
        while (BufferOp)
        {
            *VendorData = (UINT8) BufferOp->Asl.Value.Integer;
            VendorData++;
            ActualLength++;
            BufferOp = RsCompleteNodeAndGetNext (BufferOp);
        }
    }
    if ((SpecifiedLength == 0) ||
        ((SpecifiedLength == ACPI_UINT32_MAX) && (ActualLength == 0)))
    {
        AslError (ASL_ERROR, ASL_MSG_BUFFER_LENGTH, InitializerOp, NULL);
        return (FALSE);
    }
    if (SpecifiedLength != ACPI_UINT32_MAX)
    {
        if (ActualLength > SpecifiedLength)
        {
            AslError (ASL_ERROR, ASL_MSG_LIST_LENGTH_LONG, InitializerOp, NULL);
            return (FALSE);
        }
        else if (ActualLength < SpecifiedLength)
        {
            AslError (ASL_REMARK, ASL_MSG_LIST_LENGTH_SHORT, InitializerOp, NULL);
            return (FALSE);
        }
    }
    return (TRUE);
}
static BOOLEAN RsGetVendorData ( ACPI_PARSE_OBJECT * InitializerOp , UINT8 * VendorData , ACPI_SIZE DescriptorOffset ) { ACPI_PARSE_OBJECT * BufferOp ; UINT32 SpecifiedLength = ACPI_UINT32_MAX ; UINT16 ActualLength = 0 ; if ( InitializerOp -> Asl . ParseOpcode == PARSEOP_DEFAULT_ARG ) { return ( FALSE ) ; } BufferOp = InitializerOp -> Asl . Child ; if ( ! BufferOp ) { AslError ( ASL_ERROR , ASL_MSG_SYNTAX , InitializerOp , " " ) ; return ( FALSE ) ; } if ( BufferOp -> Asl . ParseOpcode != PARSEOP_DEFAULT_ARG ) { SpecifiedLength = ( UINT16 ) BufferOp -> Asl . Value . Integer ; } RsCreateByteField ( InitializerOp , ACPI_RESTAG_VENDORDATA , ( UINT16 ) DescriptorOffset ) ; BufferOp = RsCompleteNodeAndGetNext ( BufferOp ) ; if ( BufferOp -> Asl . ParseOpcode != PARSEOP_DEFAULT_ARG ) { while ( BufferOp ) { * VendorData = ( UINT8 ) BufferOp -> Asl . Value . Integer ; VendorData ++ ; ActualLength ++ ; BufferOp = RsCompleteNodeAndGetNext ( BufferOp ) ; } } if ( ( SpecifiedLength == 0 ) || ( ( SpecifiedLength == ACPI_UINT32_MAX ) && ( ActualLength == 0 ) ) ) { AslError ( ASL_ERROR , ASL_MSG_BUFFER_LENGTH , InitializerOp , NULL ) ; return ( FALSE ) ; } if ( SpecifiedLength != ACPI_UINT32_MAX ) { if ( ActualLength > SpecifiedLength ) { AslError ( ASL_ERROR , ASL_MSG_LIST_LENGTH_LONG , InitializerOp , NULL ) ; return ( FALSE ) ; } else if ( ActualLength < SpecifiedLength ) { AslError ( ASL_REMARK , ASL_MSG_LIST_LENGTH_SHORT , InitializerOp , NULL ) ; return ( FALSE ) ; } } return ( TRUE ) ; }
FUNCTION:    RsGetVendorData
 PARAMETERS:  InitializerOp       - Current parse op, start of the resource
                                    descriptor.
FUNCTION : RsGetVendorData PARAMETERS : InitializerOp - Current parse op start of the resource descriptor .
/* Vendor Data field is always optional */ /* First child is the optional buffer length (WORD) */ /* Insert field tag _VEN */ /* Walk the list of buffer initializers (each is one byte) */ /* Length validation. Buffer cannot be of zero length */ /* ActualLength > SpecifiedLength -> error */ /* ActualLength < SpecifiedLength -> remark */