linux/drivers/acpi/acpica/acobject.h

/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
/******************************************************************************
 *
 * Name: acobject.h - Definition of union acpi_operand_object  (Internal object only)
 *
 * Copyright (C) 2000 - 2023, Intel Corp.
 *
 *****************************************************************************/

#ifndef _ACOBJECT_H
#define _ACOBJECT_H

/* acpisrc:struct_defs -- for acpisrc conversion */

/*
 * The union acpi_operand_object is used to pass AML operands from the dispatcher
 * to the interpreter, and to keep track of the various handlers such as
 * address space handlers and notify handlers. The object is a constant
 * size in order to allow it to be cached and reused.
 *
 * Note: The object is optimized to be aligned and will not work if it is
 * byte-packed.
 */
#if ACPI_MACHINE_WIDTH == 64
#pragma pack(8)
#else
#pragma pack(4)
#endif

/*******************************************************************************
 *
 * Common Descriptors
 *
 ******************************************************************************/

/*
 * Common area for all objects.
 *
 * descriptor_type is used to differentiate between internal descriptors, and
 * must be in the same place across all descriptors
 *
 * Note: The descriptor_type and Type fields must appear in the identical
 * position in both the struct acpi_namespace_node and union acpi_operand_object
 * structures.
 */
#define ACPI_OBJECT_COMMON_HEADER
	/*
	 * Note: There are 3 bytes available here before the
	 * next natural alignment boundary (for both 32/64 cases)
	 */

/* Values for Flag byte above */

#define AOPOBJ_AML_CONSTANT
#define AOPOBJ_STATIC_POINTER
#define AOPOBJ_DATA_VALID
#define AOPOBJ_OBJECT_INITIALIZED
#define AOPOBJ_REG_CONNECTED
#define AOPOBJ_SETUP_COMPLETE
#define AOPOBJ_INVALID

/******************************************************************************
 *
 * Basic data types
 *
 *****************************************************************************/

struct acpi_object_common {};

struct acpi_object_integer {};

/*
 * Note: The String and Buffer object must be identical through the
 * pointer and length elements. There is code that depends on this.
 *
 * Fields common to both Strings and Buffers
 */
#define ACPI_COMMON_BUFFER_INFO(_type)

/* Null terminated, ASCII characters only */

struct acpi_object_string {};

struct acpi_object_buffer {};

struct acpi_object_package {};

/******************************************************************************
 *
 * Complex data types
 *
 *****************************************************************************/

struct acpi_object_event {};

struct acpi_object_mutex {};

struct acpi_object_region {};

struct acpi_object_method {};

/* Flags for info_flags field above */

#define ACPI_METHOD_MODULE_LEVEL
#define ACPI_METHOD_INTERNAL_ONLY
#define ACPI_METHOD_SERIALIZED
#define ACPI_METHOD_SERIALIZED_PENDING
#define ACPI_METHOD_IGNORE_SYNC_LEVEL
#define ACPI_METHOD_MODIFIED_NAMESPACE

/******************************************************************************
 *
 * Objects that can be notified. All share a common notify_info area.
 *
 *****************************************************************************/

/*
 * Common fields for objects that support ASL notifications
 */
#define ACPI_COMMON_NOTIFY_INFO

/* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */

struct acpi_object_notify_common {};

struct acpi_object_device {};

struct acpi_object_power_resource {};

struct acpi_object_processor {};

struct acpi_object_thermal_zone {};

/******************************************************************************
 *
 * Fields. All share a common header/info field.
 *
 *****************************************************************************/

/*
 * Common bitfield for the field objects
 * "Field Datum"  -- a datum from the actual field object
 * "Buffer Datum" -- a datum from a user buffer, read from or to be written to the field
 */
#define ACPI_COMMON_FIELD_INFO


/* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */

struct acpi_object_field_common {};

struct acpi_object_region_field {};

struct acpi_object_bank_field {};

struct acpi_object_index_field {};

/* The buffer_field is different in that it is part of a Buffer, not an op_region */

struct acpi_object_buffer_field {};

/******************************************************************************
 *
 * Objects for handlers
 *
 *****************************************************************************/

struct acpi_object_notify_handler {};

struct acpi_object_addr_handler {};

/* Flags for address handler (handler_flags) */

#define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED

/******************************************************************************
 *
 * Special internal objects
 *
 *****************************************************************************/

/*
 * The Reference object is used for these opcodes:
 * Arg[0-6], Local[0-7], index_op, name_op, ref_of_op, load_op, load_table_op, debug_op
 * The Reference.Class differentiates these types.
 */
struct acpi_object_reference {};

/* Values for Reference.Class above */

ACPI_REFERENCE_CLASSES;

/*
 * Extra object is used as additional storage for types that
 * have AML code in their declarations (term_args) that must be
 * evaluated at run time.
 *
 * Currently: Region and field_unit types
 */
struct acpi_object_extra {};

/* Additional data that can be attached to namespace nodes */

struct acpi_object_data {};

/* Structure used when objects are cached for reuse */

struct acpi_object_cache_list {};

/******************************************************************************
 *
 * union acpi_operand_object descriptor - a giant union of all of the above
 *
 *****************************************************************************/

acpi_operand_object;

/******************************************************************************
 *
 * union acpi_descriptor - objects that share a common descriptor identifier
 *
 *****************************************************************************/

/* Object descriptor types */

#define ACPI_DESC_TYPE_CACHED
#define ACPI_DESC_TYPE_STATE
#define ACPI_DESC_TYPE_STATE_UPDATE
#define ACPI_DESC_TYPE_STATE_PACKAGE
#define ACPI_DESC_TYPE_STATE_CONTROL
#define ACPI_DESC_TYPE_STATE_RPSCOPE
#define ACPI_DESC_TYPE_STATE_PSCOPE
#define ACPI_DESC_TYPE_STATE_WSCOPE
#define ACPI_DESC_TYPE_STATE_RESULT
#define ACPI_DESC_TYPE_STATE_NOTIFY
#define ACPI_DESC_TYPE_STATE_THREAD
#define ACPI_DESC_TYPE_WALK
#define ACPI_DESC_TYPE_PARSER
#define ACPI_DESC_TYPE_OPERAND
#define ACPI_DESC_TYPE_NAMED
#define ACPI_DESC_TYPE_MAX

struct acpi_common_descriptor {};

acpi_descriptor;

#pragma pack()

#endif				/* _ACOBJECT_H */