FreeBSD/sys/contrib/dev/acpica/components/disassembler/dmopcode.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiDmFieldPredefinedDescription
 *
 * PARAMETERS:  Op              - Parse object
 *
 * RETURN:      None
 *
 * DESCRIPTION: Emit a description comment for a resource descriptor tag
 *              (which is a predefined ACPI name.) Used for iASL compiler only.
 *
 ******************************************************************************/
AcpiDmFieldPredefinedDescription
PARAMETERS:  Op              - Parse object

None

Emit a description comment for a resource descriptor tag
(which is a predefined ACPI name.) Used for iASL compiler only.
AcpiDmFieldPredefinedDescription PARAMETERS : Op - Parse object None Emit a description comment for a resource descriptor tag ( which is a predefined ACPI name . ) Used for iASL compiler only .
void
AcpiDmFieldPredefinedDescription (
    ACPI_PARSE_OBJECT       *Op)
{
#ifdef ACPI_ASL_COMPILER
    ACPI_PARSE_OBJECT       *IndexOp;
    char                    *Tag;
    const ACPI_OPCODE_INFO  *OpInfo;
    const AH_PREDEFINED_NAME *Info;
    if (!Op)
    {
        return;
    }
    if (Op->Common.DisasmFlags & ACPI_PARSEOP_PREDEFINED_CHECKED)
    {
        return;
    }
    Op->Common.DisasmFlags |= ACPI_PARSEOP_PREDEFINED_CHECKED;
    OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
    if (!(OpInfo->Flags & AML_CREATE))
    {
        return;
    }
    IndexOp = Op->Common.Value.Arg;
    IndexOp = IndexOp->Common.Next;
    if (IndexOp->Common.AmlOpcode != AML_INT_NAMEPATH_OP)
    {
        return;
    }
    Tag = ACPI_CAST_PTR (char, IndexOp->Common.Node);
    if (!Tag)
    {
        return;
    }
    Info = AcpiAhMatchPredefinedName (Tag);
    if (Info)
    {
        AcpiOsPrintf ("  // %4.4s: %s", Tag,
            ACPI_CAST_PTR (char, Info->Description));
    }
#endif
    return;
}
void AcpiDmFieldPredefinedDescription ( ACPI_PARSE_OBJECT * Op ) { #ifdef ACPI_ASL_COMPILER ACPI_PARSE_OBJECT * IndexOp ; char * Tag ; const ACPI_OPCODE_INFO * OpInfo ; const AH_PREDEFINED_NAME * Info ; if ( ! Op ) { return ; } if ( Op -> Common . DisasmFlags & ACPI_PARSEOP_PREDEFINED_CHECKED ) { return ; } Op -> Common . DisasmFlags |= ACPI_PARSEOP_PREDEFINED_CHECKED ; OpInfo = AcpiPsGetOpcodeInfo ( Op -> Common . AmlOpcode ) ; if ( ! ( OpInfo -> Flags & AML_CREATE ) ) { return ; } IndexOp = Op -> Common . Value . Arg ; IndexOp = IndexOp -> Common . Next ; if ( IndexOp -> Common . AmlOpcode != AML_INT_NAMEPATH_OP ) { return ; } Tag = ACPI_CAST_PTR ( char , IndexOp -> Common . Node ) ; if ( ! Tag ) { return ; } Info = AcpiAhMatchPredefinedName ( Tag ) ; if ( Info ) { AcpiOsPrintf ( " " , Tag , ACPI_CAST_PTR ( char , Info -> Description ) ) ; } #endif return ; }
FUNCTION:    AcpiDmFieldPredefinedDescription
 PARAMETERS:  Op              - Parse object
FUNCTION : AcpiDmFieldPredefinedDescription PARAMETERS : Op - Parse object
/* Ensure that the comment field is emitted only once */ /*
     * Op must be one of the Create* operators: CreateField, CreateBitField,
     * CreateByteField, CreateWordField, CreateDwordField, CreateQwordField
     */ /* Second argument is the Index argument */ /* Index argument must be a namepath */ /* Major cheat: We previously put the Tag ptr in the Node field */ /* Match the name in the info table */