FreeBSD/sys/contrib/dev/acpica/compiler/dtfield.c
/******************************************************************************
 *
 * FUNCTION:    DtCompileOneField
 *
 * PARAMETERS:  Buffer              - Output buffer
 *              Field               - Field to be compiled
 *              ByteLength          - Byte length of the field
 *              Type                - Field type
 *
 * RETURN:      None
 *
 * DESCRIPTION: Compile a field value to binary
 *
 *****************************************************************************/
DtCompileOneField
PARAMETERS:  Buffer              - Output buffer
Field               - Field to be compiled
ByteLength          - Byte length of the field
Type                - Field type

None

Compile a field value to binary
DtCompileOneField PARAMETERS : Buffer - Output buffer Field - Field to be compiled ByteLength - Byte length of the field Type - Field type None Compile a field value to binary
void
DtCompileOneField (
    UINT8                   *Buffer,
    DT_FIELD                *Field,
    UINT32                  ByteLength,
    UINT8                   Type,
    UINT8                   Flags)
{
    ACPI_STATUS             Status;
    switch (Type)
    {
    case DT_FIELD_TYPE_INTEGER:
        DtCompileInteger (Buffer, Field, ByteLength, Flags);
        break;
    case DT_FIELD_TYPE_STRING:
        DtCompileString (Buffer, Field, ByteLength);
        break;
    case DT_FIELD_TYPE_UUID:
        Status = DtCompileUuid (Buffer, Field, ByteLength);
        if (ACPI_SUCCESS (Status))
        {
            break;
        }
    case DT_FIELD_TYPE_BUFFER:
        DtCompileBuffer (Buffer, Field->Value, Field, ByteLength);
        break;
    case DT_FIELD_TYPE_UNICODE:
        DtCompileUnicode (Buffer, Field, ByteLength);
        break;
    case DT_FIELD_TYPE_DEVICE_PATH:
        break;
    default:
        DtFatal (ASL_MSG_COMPILER_INTERNAL, Field, "Invalid field type");
        break;
    }
}
void DtCompileOneField ( UINT8 * Buffer , DT_FIELD * Field , UINT32 ByteLength , UINT8 Type , UINT8 Flags ) { ACPI_STATUS Status ; switch ( Type ) { case DT_FIELD_TYPE_INTEGER : DtCompileInteger ( Buffer , Field , ByteLength , Flags ) ; break ; case DT_FIELD_TYPE_STRING : DtCompileString ( Buffer , Field , ByteLength ) ; break ; case DT_FIELD_TYPE_UUID : Status = DtCompileUuid ( Buffer , Field , ByteLength ) ; if ( ACPI_SUCCESS ( Status ) ) { break ; } case DT_FIELD_TYPE_BUFFER : DtCompileBuffer ( Buffer , Field -> Value , Field , ByteLength ) ; break ; case DT_FIELD_TYPE_UNICODE : DtCompileUnicode ( Buffer , Field , ByteLength ) ; break ; case DT_FIELD_TYPE_DEVICE_PATH : break ; default : DtFatal ( ASL_MSG_COMPILER_INTERNAL , Field , " " ) ; break ; } }
FUNCTION:    DtCompileOneField
 PARAMETERS:  Buffer              - Output buffer
              Field               - Field to be compiled
              ByteLength          - Byte length of the field
              Type                - Field type
FUNCTION : DtCompileOneField PARAMETERS : Buffer - Output buffer Field - Field to be compiled ByteLength - Byte length of the field Type - Field type
/* Fall through. */