FreeBSD/sys/contrib/dev/acpica/components/parser/psutils.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiPsAllocOp
 *
 * PARAMETERS:  Opcode          - Opcode that will be stored in the new Op
 *              Aml             - Address of the opcode
 *
 * RETURN:      Pointer to the new Op, null on failure
 *
 * DESCRIPTION: Allocate an acpi_op, choose op type (and thus size) based on
 *              opcode. A cache of opcodes is available for the pure
 *              GENERIC_OP, since this is by far the most commonly used.
 *
 ******************************************************************************/
AcpiPsAllocOp
PARAMETERS:  Opcode          - Opcode that will be stored in the new Op
Aml             - Address of the opcode

Pointer to the new Op, null on failure

Allocate an acpi_op, choose op type (and thus size) based on
opcode. A cache of opcodes is available for the pure
GENERIC_OP, since this is by far the most commonly used.
AcpiPsAllocOp PARAMETERS : Opcode - Opcode that will be stored in the new Op Aml - Address of the opcode Pointer to the new Op null on failure Allocate an acpi_op choose op type ( and thus size ) based on opcode . A cache of opcodes is available for the pure GENERIC_OP since this is by far the most commonly used .
ACPI_PARSE_OBJECT*
AcpiPsAllocOp (
    UINT16                  Opcode,
    UINT8                   *Aml)
{
    ACPI_PARSE_OBJECT       *Op;
    const ACPI_OPCODE_INFO  *OpInfo;
    UINT8                   Flags = ACPI_PARSEOP_GENERIC;
    ACPI_FUNCTION_ENTRY ();
    OpInfo = AcpiPsGetOpcodeInfo (Opcode);
    if (OpInfo->Flags & AML_DEFER)
    {
        Flags = ACPI_PARSEOP_DEFERRED;
    }
    else if (OpInfo->Flags & AML_NAMED)
    {
        Flags = ACPI_PARSEOP_NAMED_OBJECT;
    }
    else if (Opcode == AML_INT_BYTELIST_OP)
    {
        Flags = ACPI_PARSEOP_BYTELIST;
    }
    if (Flags == ACPI_PARSEOP_GENERIC)
    {
        Op = AcpiOsAcquireObject (AcpiGbl_PsNodeCache);
    }
    else
    {
        Op = AcpiOsAcquireObject (AcpiGbl_PsNodeExtCache);
    }
    if (Op)
    {
        AcpiPsInitOp (Op, Opcode);
        Op->Common.Aml = Aml;
        Op->Common.Flags = Flags;
    }
    return (Op);
}
ACPI_PARSE_OBJECT * AcpiPsAllocOp ( UINT16 Opcode , UINT8 * Aml ) { ACPI_PARSE_OBJECT * Op ; const ACPI_OPCODE_INFO * OpInfo ; UINT8 Flags = ACPI_PARSEOP_GENERIC ; ACPI_FUNCTION_ENTRY ( ) ; OpInfo = AcpiPsGetOpcodeInfo ( Opcode ) ; if ( OpInfo -> Flags & AML_DEFER ) { Flags = ACPI_PARSEOP_DEFERRED ; } else if ( OpInfo -> Flags & AML_NAMED ) { Flags = ACPI_PARSEOP_NAMED_OBJECT ; } else if ( Opcode == AML_INT_BYTELIST_OP ) { Flags = ACPI_PARSEOP_BYTELIST ; } if ( Flags == ACPI_PARSEOP_GENERIC ) { Op = AcpiOsAcquireObject ( AcpiGbl_PsNodeCache ) ; } else { Op = AcpiOsAcquireObject ( AcpiGbl_PsNodeExtCache ) ; } if ( Op ) { AcpiPsInitOp ( Op , Opcode ) ; Op -> Common . Aml = Aml ; Op -> Common . Flags = Flags ; } return ( Op ) ; }
FUNCTION:    AcpiPsAllocOp
 PARAMETERS:  Opcode          - Opcode that will be stored in the new Op
              Aml             - Address of the opcode
FUNCTION : AcpiPsAllocOp PARAMETERS : Opcode - Opcode that will be stored in the new Op Aml - Address of the opcode
/* Determine type of ParseOp required */ /* Allocate the minimum required size object */ /* The generic op (default) is by far the most common (16 to 1) */ /* Extended parseop */ /* Initialize the Op */