FreeBSD/sys/contrib/dev/acpica/compiler/aslpredef.c
/*******************************************************************************
 *
 * FUNCTION:    ApCheckForPredefinedName
 *
 * PARAMETERS:  Op              - A parse node
 *              Name            - NameSeg to check
 *
 * RETURN:      None
 *
 * DESCRIPTION: Check a NameSeg against the reserved list.
 *
 ******************************************************************************/
ApCheckForPredefinedName
PARAMETERS:  Op              - A parse node
Name            - NameSeg to check

None

Check a NameSeg against the reserved list.
ApCheckForPredefinedName PARAMETERS : Op - A parse node Name - NameSeg to check None Check a NameSeg against the reserved list .
UINT32
ApCheckForPredefinedName (
    ACPI_PARSE_OBJECT       *Op,
    char                    *Name)
{
    UINT32                      i;
    const ACPI_PREDEFINED_INFO  *ThisName;
    if (Name[0] == 0)
    {
        AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, Op,
            "zero length name found");
    }
    if (Name[0] != '_')
    {
        return (ACPI_NOT_RESERVED_NAME);
    }
    ThisName = AcpiGbl_PredefinedMethods;
    for (i = 0; ThisName->Info.Name[0]; i++)
    {
        if (ACPI_COMPARE_NAME (Name, ThisName->Info.Name))
        {
            return (i);
        }
        ThisName++; 
    }
    ThisName = AcpiGbl_ResourceNames;
    while (ThisName->Info.Name[0])
    {
        if (ACPI_COMPARE_NAME (Name, ThisName->Info.Name))
        {
            return (ACPI_PREDEFINED_NAME);
        }
        ThisName++;
    }
    ThisName = AcpiGbl_ScopeNames;
    while (ThisName->Info.Name[0])
    {
        if (ACPI_COMPARE_NAME (Name, ThisName->Info.Name))
        {
            return (ACPI_PREDEFINED_NAME);
        }
        ThisName++;
    }
    return (ApCheckForSpecialName (Op, Name));
}
UINT32 ApCheckForPredefinedName ( ACPI_PARSE_OBJECT * Op , char * Name ) { UINT32 i ; const ACPI_PREDEFINED_INFO * ThisName ; if ( Name [ 0 ] == 0 ) { AslError ( ASL_ERROR , ASL_MSG_COMPILER_INTERNAL , Op , " " ) ; } if ( Name [ 0 ] != ' ' ) { return ( ACPI_NOT_RESERVED_NAME ) ; } ThisName = AcpiGbl_PredefinedMethods ; for ( i = 0 ; ThisName -> Info . Name [ 0 ] ; i ++ ) { if ( ACPI_COMPARE_NAME ( Name , ThisName -> Info . Name ) ) { return ( i ) ; } ThisName ++ ; } ThisName = AcpiGbl_ResourceNames ; while ( ThisName -> Info . Name [ 0 ] ) { if ( ACPI_COMPARE_NAME ( Name , ThisName -> Info . Name ) ) { return ( ACPI_PREDEFINED_NAME ) ; } ThisName ++ ; } ThisName = AcpiGbl_ScopeNames ; while ( ThisName -> Info . Name [ 0 ] ) { if ( ACPI_COMPARE_NAME ( Name , ThisName -> Info . Name ) ) { return ( ACPI_PREDEFINED_NAME ) ; } ThisName ++ ; } return ( ApCheckForSpecialName ( Op , Name ) ) ; }
FUNCTION:    ApCheckForPredefinedName
 PARAMETERS:  Op              - A parse node
              Name            - NameSeg to check
FUNCTION : ApCheckForPredefinedName PARAMETERS : Op - A parse node Name - NameSeg to check
/* All reserved names are prefixed with a single underscore */ /* Check for a standard predefined method name */ /* Return index into predefined array */ /* Does not account for extra package data, but is OK */ /* Check for resource names and predefined scope names */ /* Check for _Lxx/_Exx/_Wxx/_Qxx/_T_x. Warning if unknown predefined name */