📄 aclocal.h
字号:
/****************************************************************************** * * Name: aclocal.h - Internal data types used across the ACPI subsystem * *****************************************************************************//* * Copyright (C) 2000 - 2007, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * Alternatively, this software may be distributed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * * NO WARRANTY * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGES. */#ifndef __ACLOCAL_H__#define __ACLOCAL_H__/* acpisrc:struct_defs -- for acpisrc conversion */#define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */#define ACPI_DO_NOT_WAIT 0#define ACPI_SERIALIZED 0xFFtypedef u32 acpi_mutex_handle;#define ACPI_GLOBAL_LOCK (acpi_semaphore) (-1)/* Total number of aml opcodes defined */#define AML_NUM_OPCODES 0x7F/* Forward declarations */struct acpi_walk_state;struct acpi_obj_mutex;union acpi_parse_object;/***************************************************************************** * * Mutex typedefs and structs * ****************************************************************************//* * Predefined handles for the mutex objects used within the subsystem * All mutex objects are automatically created by acpi_ut_mutex_initialize. * * The acquire/release ordering protocol is implied via this list. Mutexes * with a lower value must be acquired before mutexes with a higher value. * * NOTE: any changes here must be reflected in the acpi_gbl_mutex_names * table below also! */#define ACPI_MTX_INTERPRETER 0 /* AML Interpreter, main lock */#define ACPI_MTX_NAMESPACE 1 /* ACPI Namespace */#define ACPI_MTX_TABLES 2 /* Data for ACPI tables */#define ACPI_MTX_EVENTS 3 /* Data for ACPI events */#define ACPI_MTX_CACHES 4 /* Internal caches, general purposes */#define ACPI_MTX_MEMORY 5 /* Debug memory tracking lists */#define ACPI_MTX_DEBUG_CMD_COMPLETE 6 /* AML debugger */#define ACPI_MTX_DEBUG_CMD_READY 7 /* AML debugger */#define ACPI_MAX_MUTEX 7#define ACPI_NUM_MUTEX ACPI_MAX_MUTEX+1#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)#ifdef DEFINE_ACPI_GLOBALS/* Debug names for the mutexes above */static char *acpi_gbl_mutex_names[ACPI_NUM_MUTEX] = { "ACPI_MTX_Interpreter", "ACPI_MTX_Tables", "ACPI_MTX_Namespace", "ACPI_MTX_Events", "ACPI_MTX_Caches", "ACPI_MTX_Memory", "ACPI_MTX_CommandComplete", "ACPI_MTX_CommandReady"};#endif#endif/* * Predefined handles for spinlocks used within the subsystem. * These spinlocks are created by acpi_ut_mutex_initialize */#define ACPI_LOCK_GPES 0#define ACPI_LOCK_HARDWARE 1#define ACPI_MAX_LOCK 1#define ACPI_NUM_LOCK ACPI_MAX_LOCK+1/* Owner IDs are used to track namespace nodes for selective deletion */typedef u8 acpi_owner_id;#define ACPI_OWNER_ID_MAX 0xFF/* This Thread ID means that the mutex is not in use (unlocked) */#define ACPI_MUTEX_NOT_ACQUIRED (acpi_thread_id) 0/* Table for the global mutexes */struct acpi_mutex_info { acpi_mutex mutex; u32 use_count; acpi_thread_id thread_id;};/* Lock flag parameter for various interfaces */#define ACPI_MTX_DO_NOT_LOCK 0#define ACPI_MTX_LOCK 1/* Field access granularities */#define ACPI_FIELD_BYTE_GRANULARITY 1#define ACPI_FIELD_WORD_GRANULARITY 2#define ACPI_FIELD_DWORD_GRANULARITY 4#define ACPI_FIELD_QWORD_GRANULARITY 8#define ACPI_ENTRY_NOT_FOUND NULL/***************************************************************************** * * Namespace typedefs and structs * ****************************************************************************//* Operational modes of the AML interpreter/scanner */typedef enum { ACPI_IMODE_LOAD_PASS1 = 0x01, ACPI_IMODE_LOAD_PASS2 = 0x02, ACPI_IMODE_EXECUTE = 0x03} acpi_interpreter_mode;union acpi_name_union { u32 integer; char ascii[4];};/* * The Namespace Node describes a named object that appears in the AML. * descriptor_type is used to differentiate between internal descriptors. * * The node is optimized for both 32-bit and 64-bit platforms: * 20 bytes for the 32-bit case, 32 bytes for the 64-bit case. * * 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. */struct acpi_namespace_node { union acpi_operand_object *object; /* Interpreter object */ u8 descriptor_type; /* Differentiate object descriptor types */ u8 type; /* ACPI Type associated with this name */ u8 flags; /* Miscellaneous flags */ acpi_owner_id owner_id; /* Node creator */ union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */ struct acpi_namespace_node *child; /* First child */ struct acpi_namespace_node *peer; /* Peer. Parent if ANOBJ_END_OF_PEER_LIST set */ /* * The following fields are used by the ASL compiler and disassembler only */#ifdef ACPI_LARGE_NAMESPACE_NODE union acpi_parse_object *op; u32 value; u32 length;#endif};/* Namespace Node flags */#define ANOBJ_END_OF_PEER_LIST 0x01 /* End-of-list, Peer field points to parent */#define ANOBJ_TEMPORARY 0x02 /* Node is create by a method and is temporary */#define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */#define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */#define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */#define ANOBJ_IS_EXTERNAL 0x08 /* i_aSL only: This object created via External() */#define ANOBJ_METHOD_NO_RETVAL 0x10 /* i_aSL only: Method has no return value */#define ANOBJ_METHOD_SOME_NO_RETVAL 0x20 /* i_aSL only: Method has at least one return value */#define ANOBJ_IS_BIT_OFFSET 0x40 /* i_aSL only: Reference is a bit offset */#define ANOBJ_IS_REFERENCED 0x80 /* i_aSL only: Object was referenced *//* * ACPI Table Descriptor. One per ACPI table */struct acpi_table_desc { acpi_physical_address address; struct acpi_table_header *pointer; u32 length; /* Length fixed at 32 bits */ union acpi_name_union signature; acpi_owner_id owner_id; u8 flags;};/* Flags for above */#define ACPI_TABLE_ORIGIN_UNKNOWN (0)#define ACPI_TABLE_ORIGIN_MAPPED (1)#define ACPI_TABLE_ORIGIN_ALLOCATED (2)#define ACPI_TABLE_ORIGIN_MASK (3)#define ACPI_TABLE_IS_LOADED (4)/* One internal RSDT for table management */struct acpi_internal_rsdt { struct acpi_table_desc *tables; u32 count; u32 size; u8 flags;};/* Flags for above */#define ACPI_ROOT_ORIGIN_UNKNOWN (0) /* ~ORIGIN_ALLOCATED */#define ACPI_ROOT_ORIGIN_ALLOCATED (1)#define ACPI_ROOT_ALLOW_RESIZE (2)/* Predefined (fixed) table indexes */#define ACPI_TABLE_INDEX_DSDT (0)#define ACPI_TABLE_INDEX_FACS (1)struct acpi_find_context { char *search_for; acpi_handle *list; u32 *count;};struct acpi_ns_search_data { struct acpi_namespace_node *node;};/* * Predefined Namespace items */struct acpi_predefined_names { char *name; u8 type; char *val;};/* Object types used during package copies */#define ACPI_COPY_TYPE_SIMPLE 0#define ACPI_COPY_TYPE_PACKAGE 1/* Info structure used to convert external<->internal namestrings */struct acpi_namestring_info { char *external_name; char *next_external_char; char *internal_name; u32 length; u32 num_segments; u32 num_carats; u8 fully_qualified;};/* Field creation info */struct acpi_create_field_info { struct acpi_namespace_node *region_node; struct acpi_namespace_node *field_node; struct acpi_namespace_node *register_node; struct acpi_namespace_node *data_register_node; u32 bank_value; u32 field_bit_position; u32 field_bit_length; u8 field_flags; u8 attribute; u8 field_type;};typedefacpi_status(*ACPI_INTERNAL_METHOD) (struct acpi_walk_state * walk_state);/* * Bitmapped ACPI types. Used internally only */#define ACPI_BTYPE_ANY 0x00000000#define ACPI_BTYPE_INTEGER 0x00000001#define ACPI_BTYPE_STRING 0x00000002#define ACPI_BTYPE_BUFFER 0x00000004#define ACPI_BTYPE_PACKAGE 0x00000008#define ACPI_BTYPE_FIELD_UNIT 0x00000010#define ACPI_BTYPE_DEVICE 0x00000020#define ACPI_BTYPE_EVENT 0x00000040
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -