17c478bd9Sstevel@tonic-gate 27c478bd9Sstevel@tonic-gate /****************************************************************************** 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * Name: acobject.h - Definition of ACPI_OPERAND_OBJECT (Internal object only) 5*db2bae30SDana Myers * $Revision: 1.144 $ 67c478bd9Sstevel@tonic-gate * 77c478bd9Sstevel@tonic-gate *****************************************************************************/ 87c478bd9Sstevel@tonic-gate 97c478bd9Sstevel@tonic-gate /****************************************************************************** 107c478bd9Sstevel@tonic-gate * 117c478bd9Sstevel@tonic-gate * 1. Copyright Notice 127c478bd9Sstevel@tonic-gate * 13*db2bae30SDana Myers * Some or all of this work - Copyright (c) 1999 - 2008, Intel Corp. 147c478bd9Sstevel@tonic-gate * All rights reserved. 157c478bd9Sstevel@tonic-gate * 167c478bd9Sstevel@tonic-gate * 2. License 177c478bd9Sstevel@tonic-gate * 187c478bd9Sstevel@tonic-gate * 2.1. This is your license from Intel Corp. under its intellectual property 197c478bd9Sstevel@tonic-gate * rights. You may have additional license terms from the party that provided 207c478bd9Sstevel@tonic-gate * you this software, covering your right to use that party's intellectual 217c478bd9Sstevel@tonic-gate * property rights. 227c478bd9Sstevel@tonic-gate * 237c478bd9Sstevel@tonic-gate * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 247c478bd9Sstevel@tonic-gate * copy of the source code appearing in this file ("Covered Code") an 257c478bd9Sstevel@tonic-gate * irrevocable, perpetual, worldwide license under Intel's copyrights in the 267c478bd9Sstevel@tonic-gate * base code distributed originally by Intel ("Original Intel Code") to copy, 277c478bd9Sstevel@tonic-gate * make derivatives, distribute, use and display any portion of the Covered 287c478bd9Sstevel@tonic-gate * Code in any form, with the right to sublicense such rights; and 297c478bd9Sstevel@tonic-gate * 307c478bd9Sstevel@tonic-gate * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 317c478bd9Sstevel@tonic-gate * license (with the right to sublicense), under only those claims of Intel 327c478bd9Sstevel@tonic-gate * patents that are infringed by the Original Intel Code, to make, use, sell, 337c478bd9Sstevel@tonic-gate * offer to sell, and import the Covered Code and derivative works thereof 347c478bd9Sstevel@tonic-gate * solely to the minimum extent necessary to exercise the above copyright 357c478bd9Sstevel@tonic-gate * license, and in no event shall the patent license extend to any additions 367c478bd9Sstevel@tonic-gate * to or modifications of the Original Intel Code. No other license or right 377c478bd9Sstevel@tonic-gate * is granted directly or by implication, estoppel or otherwise; 387c478bd9Sstevel@tonic-gate * 397c478bd9Sstevel@tonic-gate * The above copyright and patent license is granted only if the following 407c478bd9Sstevel@tonic-gate * conditions are met: 417c478bd9Sstevel@tonic-gate * 427c478bd9Sstevel@tonic-gate * 3. Conditions 437c478bd9Sstevel@tonic-gate * 447c478bd9Sstevel@tonic-gate * 3.1. Redistribution of Source with Rights to Further Distribute Source. 457c478bd9Sstevel@tonic-gate * Redistribution of source code of any substantial portion of the Covered 467c478bd9Sstevel@tonic-gate * Code or modification with rights to further distribute source must include 477c478bd9Sstevel@tonic-gate * the above Copyright Notice, the above License, this list of Conditions, 487c478bd9Sstevel@tonic-gate * and the following Disclaimer and Export Compliance provision. In addition, 497c478bd9Sstevel@tonic-gate * Licensee must cause all Covered Code to which Licensee contributes to 507c478bd9Sstevel@tonic-gate * contain a file documenting the changes Licensee made to create that Covered 517c478bd9Sstevel@tonic-gate * Code and the date of any change. Licensee must include in that file the 527c478bd9Sstevel@tonic-gate * documentation of any changes made by any predecessor Licensee. Licensee 537c478bd9Sstevel@tonic-gate * must include a prominent statement that the modification is derived, 547c478bd9Sstevel@tonic-gate * directly or indirectly, from Original Intel Code. 557c478bd9Sstevel@tonic-gate * 567c478bd9Sstevel@tonic-gate * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 577c478bd9Sstevel@tonic-gate * Redistribution of source code of any substantial portion of the Covered 587c478bd9Sstevel@tonic-gate * Code or modification without rights to further distribute source must 597c478bd9Sstevel@tonic-gate * include the following Disclaimer and Export Compliance provision in the 607c478bd9Sstevel@tonic-gate * documentation and/or other materials provided with distribution. In 617c478bd9Sstevel@tonic-gate * addition, Licensee may not authorize further sublicense of source of any 627c478bd9Sstevel@tonic-gate * portion of the Covered Code, and must include terms to the effect that the 637c478bd9Sstevel@tonic-gate * license from Licensee to its licensee is limited to the intellectual 647c478bd9Sstevel@tonic-gate * property embodied in the software Licensee provides to its licensee, and 657c478bd9Sstevel@tonic-gate * not to intellectual property embodied in modifications its licensee may 667c478bd9Sstevel@tonic-gate * make. 677c478bd9Sstevel@tonic-gate * 687c478bd9Sstevel@tonic-gate * 3.3. Redistribution of Executable. Redistribution in executable form of any 697c478bd9Sstevel@tonic-gate * substantial portion of the Covered Code or modification must reproduce the 707c478bd9Sstevel@tonic-gate * above Copyright Notice, and the following Disclaimer and Export Compliance 717c478bd9Sstevel@tonic-gate * provision in the documentation and/or other materials provided with the 727c478bd9Sstevel@tonic-gate * distribution. 737c478bd9Sstevel@tonic-gate * 747c478bd9Sstevel@tonic-gate * 3.4. Intel retains all right, title, and interest in and to the Original 757c478bd9Sstevel@tonic-gate * Intel Code. 767c478bd9Sstevel@tonic-gate * 777c478bd9Sstevel@tonic-gate * 3.5. Neither the name Intel nor any other trademark owned or controlled by 787c478bd9Sstevel@tonic-gate * Intel shall be used in advertising or otherwise to promote the sale, use or 797c478bd9Sstevel@tonic-gate * other dealings in products derived from or relating to the Covered Code 807c478bd9Sstevel@tonic-gate * without prior written authorization from Intel. 817c478bd9Sstevel@tonic-gate * 827c478bd9Sstevel@tonic-gate * 4. Disclaimer and Export Compliance 837c478bd9Sstevel@tonic-gate * 847c478bd9Sstevel@tonic-gate * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 857c478bd9Sstevel@tonic-gate * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 867c478bd9Sstevel@tonic-gate * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 877c478bd9Sstevel@tonic-gate * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 887c478bd9Sstevel@tonic-gate * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 897c478bd9Sstevel@tonic-gate * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 907c478bd9Sstevel@tonic-gate * PARTICULAR PURPOSE. 917c478bd9Sstevel@tonic-gate * 927c478bd9Sstevel@tonic-gate * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 937c478bd9Sstevel@tonic-gate * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 947c478bd9Sstevel@tonic-gate * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 957c478bd9Sstevel@tonic-gate * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 967c478bd9Sstevel@tonic-gate * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 977c478bd9Sstevel@tonic-gate * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 987c478bd9Sstevel@tonic-gate * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 997c478bd9Sstevel@tonic-gate * LIMITED REMEDY. 1007c478bd9Sstevel@tonic-gate * 1017c478bd9Sstevel@tonic-gate * 4.3. Licensee shall not export, either directly or indirectly, any of this 1027c478bd9Sstevel@tonic-gate * software or system incorporating such software without first obtaining any 1037c478bd9Sstevel@tonic-gate * required license or other approval from the U. S. Department of Commerce or 1047c478bd9Sstevel@tonic-gate * any other agency or department of the United States Government. In the 1057c478bd9Sstevel@tonic-gate * event Licensee exports any such software from the United States or 1067c478bd9Sstevel@tonic-gate * re-exports any such software from a foreign destination, Licensee shall 1077c478bd9Sstevel@tonic-gate * ensure that the distribution and export/re-export of the software is in 1087c478bd9Sstevel@tonic-gate * compliance with all laws, regulations, orders, or other restrictions of the 1097c478bd9Sstevel@tonic-gate * U.S. Export Administration Regulations. Licensee agrees that neither it nor 1107c478bd9Sstevel@tonic-gate * any of its subsidiaries will export/re-export any technical data, process, 1117c478bd9Sstevel@tonic-gate * software, or service, directly or indirectly, to any country for which the 1127c478bd9Sstevel@tonic-gate * United States government or any agency thereof requires an export license, 1137c478bd9Sstevel@tonic-gate * other governmental approval, or letter of assurance, without first obtaining 1147c478bd9Sstevel@tonic-gate * such license, approval or letter. 1157c478bd9Sstevel@tonic-gate * 1167c478bd9Sstevel@tonic-gate *****************************************************************************/ 1177c478bd9Sstevel@tonic-gate 1187c478bd9Sstevel@tonic-gate #ifndef _ACOBJECT_H 1197c478bd9Sstevel@tonic-gate #define _ACOBJECT_H 1207c478bd9Sstevel@tonic-gate 12127f7c583Smyers /* acpisrc:StructDefs -- for acpisrc conversion */ 12227f7c583Smyers 1237c478bd9Sstevel@tonic-gate 1247c478bd9Sstevel@tonic-gate /* 12527f7c583Smyers * The ACPI_OPERAND_OBJECT is used to pass AML operands from the dispatcher 1267c478bd9Sstevel@tonic-gate * to the interpreter, and to keep track of the various handlers such as 12727f7c583Smyers * address space handlers and notify handlers. The object is a constant 1287c478bd9Sstevel@tonic-gate * size in order to allow it to be cached and reused. 129*db2bae30SDana Myers * 130*db2bae30SDana Myers * Note: The object is optimized to be aligned and will not work if it is 131*db2bae30SDana Myers * byte-packed. 1327c478bd9Sstevel@tonic-gate */ 133*db2bae30SDana Myers #if ACPI_MACHINE_WIDTH == 64 134*db2bae30SDana Myers #pragma pack(8) 135*db2bae30SDana Myers #else 136*db2bae30SDana Myers #pragma pack(4) 137*db2bae30SDana Myers #endif 1387c478bd9Sstevel@tonic-gate 1397c478bd9Sstevel@tonic-gate /******************************************************************************* 1407c478bd9Sstevel@tonic-gate * 1417c478bd9Sstevel@tonic-gate * Common Descriptors 1427c478bd9Sstevel@tonic-gate * 1437c478bd9Sstevel@tonic-gate ******************************************************************************/ 1447c478bd9Sstevel@tonic-gate 1457c478bd9Sstevel@tonic-gate /* 1467c478bd9Sstevel@tonic-gate * Common area for all objects. 1477c478bd9Sstevel@tonic-gate * 14827f7c583Smyers * DescriptorType is used to differentiate between internal descriptors, and 14927f7c583Smyers * must be in the same place across all descriptors 15027f7c583Smyers * 15127f7c583Smyers * Note: The DescriptorType and Type fields must appear in the identical 15227f7c583Smyers * position in both the ACPI_NAMESPACE_NODE and ACPI_OPERAND_OBJECT 15327f7c583Smyers * structures. 1547c478bd9Sstevel@tonic-gate */ 15527f7c583Smyers #define ACPI_OBJECT_COMMON_HEADER \ 15627f7c583Smyers union acpi_operand_object *NextObject; /* Objects linked to parent NS node */\ 15727f7c583Smyers UINT8 DescriptorType; /* To differentiate various internal objs */\ 1587c478bd9Sstevel@tonic-gate UINT8 Type; /* ACPI_OBJECT_TYPE */\ 1597c478bd9Sstevel@tonic-gate UINT16 ReferenceCount; /* For object deletion management */\ 16030082d0cSmyers UINT8 Flags; 16127f7c583Smyers /* 16227f7c583Smyers * Note: There are 3 bytes available here before the 16327f7c583Smyers * next natural alignment boundary (for both 32/64 cases) 16427f7c583Smyers */ 1657c478bd9Sstevel@tonic-gate 16627f7c583Smyers /* Values for Flag byte above */ 1677c478bd9Sstevel@tonic-gate 1687c478bd9Sstevel@tonic-gate #define AOPOBJ_AML_CONSTANT 0x01 1697c478bd9Sstevel@tonic-gate #define AOPOBJ_STATIC_POINTER 0x02 1707c478bd9Sstevel@tonic-gate #define AOPOBJ_DATA_VALID 0x04 1717c478bd9Sstevel@tonic-gate #define AOPOBJ_OBJECT_INITIALIZED 0x08 1727c478bd9Sstevel@tonic-gate #define AOPOBJ_SETUP_COMPLETE 0x10 1737c478bd9Sstevel@tonic-gate #define AOPOBJ_SINGLE_DATUM 0x20 17427f7c583Smyers #define AOPOBJ_INVALID 0x40 /* Used if host OS won't allow an OpRegion address */ 1757c478bd9Sstevel@tonic-gate 1767c478bd9Sstevel@tonic-gate 1777c478bd9Sstevel@tonic-gate /****************************************************************************** 1787c478bd9Sstevel@tonic-gate * 1797c478bd9Sstevel@tonic-gate * Basic data types 1807c478bd9Sstevel@tonic-gate * 1817c478bd9Sstevel@tonic-gate *****************************************************************************/ 1827c478bd9Sstevel@tonic-gate 1837c478bd9Sstevel@tonic-gate typedef struct acpi_object_common 1847c478bd9Sstevel@tonic-gate { 1857c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 1867c478bd9Sstevel@tonic-gate 1877c478bd9Sstevel@tonic-gate } ACPI_OBJECT_COMMON; 1887c478bd9Sstevel@tonic-gate 1897c478bd9Sstevel@tonic-gate 1907c478bd9Sstevel@tonic-gate typedef struct acpi_object_integer 1917c478bd9Sstevel@tonic-gate { 1927c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 193*db2bae30SDana Myers UINT8 Fill[3]; /* Prevent warning on some compilers */ 1947c478bd9Sstevel@tonic-gate ACPI_INTEGER Value; 1957c478bd9Sstevel@tonic-gate 1967c478bd9Sstevel@tonic-gate } ACPI_OBJECT_INTEGER; 1977c478bd9Sstevel@tonic-gate 1987c478bd9Sstevel@tonic-gate 1997c478bd9Sstevel@tonic-gate /* 2007c478bd9Sstevel@tonic-gate * Note: The String and Buffer object must be identical through the Pointer 20127f7c583Smyers * and length elements. There is code that depends on this. 20227f7c583Smyers * 20327f7c583Smyers * Fields common to both Strings and Buffers 2047c478bd9Sstevel@tonic-gate */ 20527f7c583Smyers #define ACPI_COMMON_BUFFER_INFO(_Type) \ 20627f7c583Smyers _Type *Pointer; \ 20727f7c583Smyers UINT32 Length; 20827f7c583Smyers 20927f7c583Smyers 2107c478bd9Sstevel@tonic-gate typedef struct acpi_object_string /* Null terminated, ASCII characters only */ 2117c478bd9Sstevel@tonic-gate { 2127c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 21327f7c583Smyers ACPI_COMMON_BUFFER_INFO (char) /* String in AML stream or allocated string */ 2147c478bd9Sstevel@tonic-gate 2157c478bd9Sstevel@tonic-gate } ACPI_OBJECT_STRING; 2167c478bd9Sstevel@tonic-gate 2177c478bd9Sstevel@tonic-gate 2187c478bd9Sstevel@tonic-gate typedef struct acpi_object_buffer 2197c478bd9Sstevel@tonic-gate { 2207c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 22127f7c583Smyers ACPI_COMMON_BUFFER_INFO (UINT8) /* Buffer in AML stream or allocated buffer */ 2227c478bd9Sstevel@tonic-gate UINT32 AmlLength; 22327f7c583Smyers UINT8 *AmlStart; 22427f7c583Smyers ACPI_NAMESPACE_NODE *Node; /* Link back to parent node */ 2257c478bd9Sstevel@tonic-gate 2267c478bd9Sstevel@tonic-gate } ACPI_OBJECT_BUFFER; 2277c478bd9Sstevel@tonic-gate 2287c478bd9Sstevel@tonic-gate 2297c478bd9Sstevel@tonic-gate typedef struct acpi_object_package 2307c478bd9Sstevel@tonic-gate { 2317c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 2327c478bd9Sstevel@tonic-gate ACPI_NAMESPACE_NODE *Node; /* Link back to parent node */ 2337c478bd9Sstevel@tonic-gate union acpi_operand_object **Elements; /* Array of pointers to AcpiObjects */ 23427f7c583Smyers UINT8 *AmlStart; 23527f7c583Smyers UINT32 AmlLength; 23627f7c583Smyers UINT32 Count; /* # of elements in package */ 2377c478bd9Sstevel@tonic-gate 2387c478bd9Sstevel@tonic-gate } ACPI_OBJECT_PACKAGE; 2397c478bd9Sstevel@tonic-gate 2407c478bd9Sstevel@tonic-gate 2417c478bd9Sstevel@tonic-gate /****************************************************************************** 2427c478bd9Sstevel@tonic-gate * 2437c478bd9Sstevel@tonic-gate * Complex data types 2447c478bd9Sstevel@tonic-gate * 2457c478bd9Sstevel@tonic-gate *****************************************************************************/ 2467c478bd9Sstevel@tonic-gate 2477c478bd9Sstevel@tonic-gate typedef struct acpi_object_event 2487c478bd9Sstevel@tonic-gate { 2497c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 25027f7c583Smyers ACPI_SEMAPHORE OsSemaphore; /* Actual OS synchronization object */ 2517c478bd9Sstevel@tonic-gate 2527c478bd9Sstevel@tonic-gate } ACPI_OBJECT_EVENT; 2537c478bd9Sstevel@tonic-gate 2547c478bd9Sstevel@tonic-gate 2557c478bd9Sstevel@tonic-gate typedef struct acpi_object_mutex 2567c478bd9Sstevel@tonic-gate { 2577c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 2587c478bd9Sstevel@tonic-gate UINT8 SyncLevel; /* 0-15, specified in Mutex() call */ 2597c478bd9Sstevel@tonic-gate UINT16 AcquisitionDepth; /* Allow multiple Acquires, same thread */ 26027f7c583Smyers ACPI_MUTEX OsMutex; /* Actual OS synchronization object */ 261*db2bae30SDana Myers ACPI_THREAD_ID ThreadId; /* Current owner of the mutex */ 262*db2bae30SDana Myers struct acpi_thread_state *OwnerThread; /* Current owner of the mutex */ 2637c478bd9Sstevel@tonic-gate union acpi_operand_object *Prev; /* Link for list of acquired mutexes */ 2647c478bd9Sstevel@tonic-gate union acpi_operand_object *Next; /* Link for list of acquired mutexes */ 2657c478bd9Sstevel@tonic-gate ACPI_NAMESPACE_NODE *Node; /* Containing namespace node */ 2667c478bd9Sstevel@tonic-gate UINT8 OriginalSyncLevel; /* Owner's original sync level (0-15) */ 2677c478bd9Sstevel@tonic-gate 2687c478bd9Sstevel@tonic-gate } ACPI_OBJECT_MUTEX; 2697c478bd9Sstevel@tonic-gate 2707c478bd9Sstevel@tonic-gate 2717c478bd9Sstevel@tonic-gate typedef struct acpi_object_region 2727c478bd9Sstevel@tonic-gate { 2737c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 2747c478bd9Sstevel@tonic-gate UINT8 SpaceId; 2757c478bd9Sstevel@tonic-gate ACPI_NAMESPACE_NODE *Node; /* Containing namespace node */ 27627f7c583Smyers union acpi_operand_object *Handler; /* Handler for region access */ 2777c478bd9Sstevel@tonic-gate union acpi_operand_object *Next; 2787c478bd9Sstevel@tonic-gate ACPI_PHYSICAL_ADDRESS Address; 27927f7c583Smyers UINT32 Length; 2807c478bd9Sstevel@tonic-gate 2817c478bd9Sstevel@tonic-gate } ACPI_OBJECT_REGION; 2827c478bd9Sstevel@tonic-gate 2837c478bd9Sstevel@tonic-gate 28427f7c583Smyers typedef struct acpi_object_method 28527f7c583Smyers { 28627f7c583Smyers ACPI_OBJECT_COMMON_HEADER 28727f7c583Smyers UINT8 MethodFlags; 28827f7c583Smyers UINT8 ParamCount; 28927f7c583Smyers UINT8 SyncLevel; 29027f7c583Smyers union acpi_operand_object *Mutex; 29127f7c583Smyers UINT8 *AmlStart; 29227f7c583Smyers ACPI_INTERNAL_METHOD Implementation; 29327f7c583Smyers UINT32 AmlLength; 29427f7c583Smyers UINT8 ThreadCount; 29527f7c583Smyers ACPI_OWNER_ID OwnerId; 29627f7c583Smyers 29727f7c583Smyers } ACPI_OBJECT_METHOD; 29827f7c583Smyers 29927f7c583Smyers 3007c478bd9Sstevel@tonic-gate /****************************************************************************** 3017c478bd9Sstevel@tonic-gate * 3027c478bd9Sstevel@tonic-gate * Objects that can be notified. All share a common NotifyInfo area. 3037c478bd9Sstevel@tonic-gate * 3047c478bd9Sstevel@tonic-gate *****************************************************************************/ 3057c478bd9Sstevel@tonic-gate 30627f7c583Smyers /* 30727f7c583Smyers * Common fields for objects that support ASL notifications 30827f7c583Smyers */ 30927f7c583Smyers #define ACPI_COMMON_NOTIFY_INFO \ 31027f7c583Smyers union acpi_operand_object *SystemNotify; /* Handler for system notifies */\ 31127f7c583Smyers union acpi_operand_object *DeviceNotify; /* Handler for driver notifies */\ 31227f7c583Smyers union acpi_operand_object *Handler; /* Handler for Address space */ 31327f7c583Smyers 31427f7c583Smyers 3157c478bd9Sstevel@tonic-gate typedef struct acpi_object_notify_common /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */ 3167c478bd9Sstevel@tonic-gate { 3177c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 3187c478bd9Sstevel@tonic-gate ACPI_COMMON_NOTIFY_INFO 3197c478bd9Sstevel@tonic-gate 3207c478bd9Sstevel@tonic-gate } ACPI_OBJECT_NOTIFY_COMMON; 3217c478bd9Sstevel@tonic-gate 3227c478bd9Sstevel@tonic-gate 3237c478bd9Sstevel@tonic-gate typedef struct acpi_object_device 3247c478bd9Sstevel@tonic-gate { 3257c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 3267c478bd9Sstevel@tonic-gate ACPI_COMMON_NOTIFY_INFO 3277c478bd9Sstevel@tonic-gate ACPI_GPE_BLOCK_INFO *GpeBlock; 3287c478bd9Sstevel@tonic-gate 3297c478bd9Sstevel@tonic-gate } ACPI_OBJECT_DEVICE; 3307c478bd9Sstevel@tonic-gate 3317c478bd9Sstevel@tonic-gate 3327c478bd9Sstevel@tonic-gate typedef struct acpi_object_power_resource 3337c478bd9Sstevel@tonic-gate { 3347c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 3357c478bd9Sstevel@tonic-gate ACPI_COMMON_NOTIFY_INFO 3367c478bd9Sstevel@tonic-gate UINT32 SystemLevel; 3377c478bd9Sstevel@tonic-gate UINT32 ResourceOrder; 3387c478bd9Sstevel@tonic-gate 3397c478bd9Sstevel@tonic-gate } ACPI_OBJECT_POWER_RESOURCE; 3407c478bd9Sstevel@tonic-gate 3417c478bd9Sstevel@tonic-gate 3427c478bd9Sstevel@tonic-gate typedef struct acpi_object_processor 3437c478bd9Sstevel@tonic-gate { 3447c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 345*db2bae30SDana Myers 346*db2bae30SDana Myers /* The next two fields take advantage of the 3-byte space before NOTIFY_INFO */ 347*db2bae30SDana Myers 34827f7c583Smyers UINT8 ProcId; 34927f7c583Smyers UINT8 Length; 3507c478bd9Sstevel@tonic-gate ACPI_COMMON_NOTIFY_INFO 3517c478bd9Sstevel@tonic-gate ACPI_IO_ADDRESS Address; 3527c478bd9Sstevel@tonic-gate 3537c478bd9Sstevel@tonic-gate } ACPI_OBJECT_PROCESSOR; 3547c478bd9Sstevel@tonic-gate 3557c478bd9Sstevel@tonic-gate 3567c478bd9Sstevel@tonic-gate typedef struct acpi_object_thermal_zone 3577c478bd9Sstevel@tonic-gate { 3587c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 3597c478bd9Sstevel@tonic-gate ACPI_COMMON_NOTIFY_INFO 3607c478bd9Sstevel@tonic-gate 3617c478bd9Sstevel@tonic-gate } ACPI_OBJECT_THERMAL_ZONE; 3627c478bd9Sstevel@tonic-gate 3637c478bd9Sstevel@tonic-gate 3647c478bd9Sstevel@tonic-gate /****************************************************************************** 3657c478bd9Sstevel@tonic-gate * 3667c478bd9Sstevel@tonic-gate * Fields. All share a common header/info field. 3677c478bd9Sstevel@tonic-gate * 3687c478bd9Sstevel@tonic-gate *****************************************************************************/ 3697c478bd9Sstevel@tonic-gate 37027f7c583Smyers /* 37127f7c583Smyers * Common bitfield for the field objects 37227f7c583Smyers * "Field Datum" -- a datum from the actual field object 37327f7c583Smyers * "Buffer Datum" -- a datum from a user buffer, read from or to be written to the field 37427f7c583Smyers */ 37527f7c583Smyers #define ACPI_COMMON_FIELD_INFO \ 37627f7c583Smyers UINT8 FieldFlags; /* Access, update, and lock bits */\ 37727f7c583Smyers UINT8 Attribute; /* From AccessAs keyword */\ 37827f7c583Smyers UINT8 AccessByteWidth; /* Read/Write size in bytes */\ 37927f7c583Smyers ACPI_NAMESPACE_NODE *Node; /* Link back to parent node */\ 38027f7c583Smyers UINT32 BitLength; /* Length of field in bits */\ 38127f7c583Smyers UINT32 BaseByteOffset; /* Byte offset within containing object */\ 38227f7c583Smyers UINT32 Value; /* Value to store into the Bank or Index register */\ 38327f7c583Smyers UINT8 StartFieldBitOffset;/* Bit offset within first field datum (0-63) */\ 38427f7c583Smyers UINT8 AccessBitWidth; /* Read/Write size in bits (8-64) */ 38527f7c583Smyers 38627f7c583Smyers 3877c478bd9Sstevel@tonic-gate typedef struct acpi_object_field_common /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */ 3887c478bd9Sstevel@tonic-gate { 3897c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 3907c478bd9Sstevel@tonic-gate ACPI_COMMON_FIELD_INFO 39127f7c583Smyers union acpi_operand_object *RegionObj; /* Parent Operation Region object (REGION/BANK fields only) */ 39227f7c583Smyers 3937c478bd9Sstevel@tonic-gate } ACPI_OBJECT_FIELD_COMMON; 3947c478bd9Sstevel@tonic-gate 3957c478bd9Sstevel@tonic-gate 3967c478bd9Sstevel@tonic-gate typedef struct acpi_object_region_field 3977c478bd9Sstevel@tonic-gate { 3987c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 3997c478bd9Sstevel@tonic-gate ACPI_COMMON_FIELD_INFO 4007c478bd9Sstevel@tonic-gate union acpi_operand_object *RegionObj; /* Containing OpRegion object */ 4017c478bd9Sstevel@tonic-gate 4027c478bd9Sstevel@tonic-gate } ACPI_OBJECT_REGION_FIELD; 4037c478bd9Sstevel@tonic-gate 4047c478bd9Sstevel@tonic-gate 4057c478bd9Sstevel@tonic-gate typedef struct acpi_object_bank_field 4067c478bd9Sstevel@tonic-gate { 4077c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 4087c478bd9Sstevel@tonic-gate ACPI_COMMON_FIELD_INFO 4097c478bd9Sstevel@tonic-gate union acpi_operand_object *RegionObj; /* Containing OpRegion object */ 4107c478bd9Sstevel@tonic-gate union acpi_operand_object *BankObj; /* BankSelect Register object */ 4117c478bd9Sstevel@tonic-gate 4127c478bd9Sstevel@tonic-gate } ACPI_OBJECT_BANK_FIELD; 4137c478bd9Sstevel@tonic-gate 4147c478bd9Sstevel@tonic-gate 4157c478bd9Sstevel@tonic-gate typedef struct acpi_object_index_field 4167c478bd9Sstevel@tonic-gate { 4177c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 4187c478bd9Sstevel@tonic-gate ACPI_COMMON_FIELD_INFO 4197c478bd9Sstevel@tonic-gate 4207c478bd9Sstevel@tonic-gate /* 4217c478bd9Sstevel@tonic-gate * No "RegionObj" pointer needed since the Index and Data registers 4227c478bd9Sstevel@tonic-gate * are each field definitions unto themselves. 4237c478bd9Sstevel@tonic-gate */ 4247c478bd9Sstevel@tonic-gate union acpi_operand_object *IndexObj; /* Index register */ 4257c478bd9Sstevel@tonic-gate union acpi_operand_object *DataObj; /* Data register */ 4267c478bd9Sstevel@tonic-gate 4277c478bd9Sstevel@tonic-gate } ACPI_OBJECT_INDEX_FIELD; 4287c478bd9Sstevel@tonic-gate 4297c478bd9Sstevel@tonic-gate 4307c478bd9Sstevel@tonic-gate /* The BufferField is different in that it is part of a Buffer, not an OpRegion */ 4317c478bd9Sstevel@tonic-gate 4327c478bd9Sstevel@tonic-gate typedef struct acpi_object_buffer_field 4337c478bd9Sstevel@tonic-gate { 4347c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 4357c478bd9Sstevel@tonic-gate ACPI_COMMON_FIELD_INFO 4367c478bd9Sstevel@tonic-gate union acpi_operand_object *BufferObj; /* Containing Buffer object */ 4377c478bd9Sstevel@tonic-gate 4387c478bd9Sstevel@tonic-gate } ACPI_OBJECT_BUFFER_FIELD; 4397c478bd9Sstevel@tonic-gate 4407c478bd9Sstevel@tonic-gate 4417c478bd9Sstevel@tonic-gate /****************************************************************************** 4427c478bd9Sstevel@tonic-gate * 4437c478bd9Sstevel@tonic-gate * Objects for handlers 4447c478bd9Sstevel@tonic-gate * 4457c478bd9Sstevel@tonic-gate *****************************************************************************/ 4467c478bd9Sstevel@tonic-gate 4477c478bd9Sstevel@tonic-gate typedef struct acpi_object_notify_handler 4487c478bd9Sstevel@tonic-gate { 4497c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 4507c478bd9Sstevel@tonic-gate ACPI_NAMESPACE_NODE *Node; /* Parent device */ 4517c478bd9Sstevel@tonic-gate ACPI_NOTIFY_HANDLER Handler; 4527c478bd9Sstevel@tonic-gate void *Context; 4537c478bd9Sstevel@tonic-gate 4547c478bd9Sstevel@tonic-gate } ACPI_OBJECT_NOTIFY_HANDLER; 4557c478bd9Sstevel@tonic-gate 4567c478bd9Sstevel@tonic-gate 4577c478bd9Sstevel@tonic-gate typedef struct acpi_object_addr_handler 4587c478bd9Sstevel@tonic-gate { 4597c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 4607c478bd9Sstevel@tonic-gate UINT8 SpaceId; 46127f7c583Smyers UINT8 HandlerFlags; 4627c478bd9Sstevel@tonic-gate ACPI_ADR_SPACE_HANDLER Handler; 4637c478bd9Sstevel@tonic-gate ACPI_NAMESPACE_NODE *Node; /* Parent device */ 4647c478bd9Sstevel@tonic-gate void *Context; 4657c478bd9Sstevel@tonic-gate ACPI_ADR_SPACE_SETUP Setup; 4667c478bd9Sstevel@tonic-gate union acpi_operand_object *RegionList; /* regions using this handler */ 4677c478bd9Sstevel@tonic-gate union acpi_operand_object *Next; 4687c478bd9Sstevel@tonic-gate 4697c478bd9Sstevel@tonic-gate } ACPI_OBJECT_ADDR_HANDLER; 4707c478bd9Sstevel@tonic-gate 47127f7c583Smyers /* Flags for address handler (HandlerFlags) */ 47227f7c583Smyers 47327f7c583Smyers #define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED 0x01 47427f7c583Smyers 4757c478bd9Sstevel@tonic-gate 4767c478bd9Sstevel@tonic-gate /****************************************************************************** 4777c478bd9Sstevel@tonic-gate * 4787c478bd9Sstevel@tonic-gate * Special internal objects 4797c478bd9Sstevel@tonic-gate * 4807c478bd9Sstevel@tonic-gate *****************************************************************************/ 4817c478bd9Sstevel@tonic-gate 4827c478bd9Sstevel@tonic-gate /* 483*db2bae30SDana Myers * The Reference object is used for these opcodes: 484*db2bae30SDana Myers * Arg[0-6], Local[0-7], IndexOp, NameOp, RefOfOp, LoadOp, LoadTableOp, DebugOp 485*db2bae30SDana Myers * The Reference.Class differentiates these types. 4867c478bd9Sstevel@tonic-gate */ 4877c478bd9Sstevel@tonic-gate typedef struct acpi_object_reference 4887c478bd9Sstevel@tonic-gate { 4897c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 490*db2bae30SDana Myers UINT8 Class; /* Reference Class */ 491*db2bae30SDana Myers UINT8 TargetType; /* Used for Index Op */ 492*db2bae30SDana Myers UINT8 Reserved; 493*db2bae30SDana Myers void *Object; /* NameOp=>HANDLE to obj, IndexOp=>ACPI_OPERAND_OBJECT */ 494*db2bae30SDana Myers ACPI_NAMESPACE_NODE *Node; /* RefOf or Namepath */ 495*db2bae30SDana Myers union acpi_operand_object **Where; /* Target of Index */ 496*db2bae30SDana Myers UINT32 Value; /* Used for Local/Arg/Index/DdbHandle */ 4977c478bd9Sstevel@tonic-gate 4987c478bd9Sstevel@tonic-gate } ACPI_OBJECT_REFERENCE; 4997c478bd9Sstevel@tonic-gate 500*db2bae30SDana Myers /* Values for Reference.Class above */ 501*db2bae30SDana Myers 502*db2bae30SDana Myers typedef enum 503*db2bae30SDana Myers { 504*db2bae30SDana Myers ACPI_REFCLASS_LOCAL = 0, /* Method local */ 505*db2bae30SDana Myers ACPI_REFCLASS_ARG = 1, /* Method argument */ 506*db2bae30SDana Myers ACPI_REFCLASS_REFOF = 2, /* Result of RefOf() TBD: Split to Ref/Node and Ref/OperandObj? */ 507*db2bae30SDana Myers ACPI_REFCLASS_INDEX = 3, /* Result of Index() */ 508*db2bae30SDana Myers ACPI_REFCLASS_TABLE = 4, /* DdbHandle - Load(), LoadTable() */ 509*db2bae30SDana Myers ACPI_REFCLASS_NAME = 5, /* Reference to a named object */ 510*db2bae30SDana Myers ACPI_REFCLASS_DEBUG = 6, /* Debug object */ 511*db2bae30SDana Myers 512*db2bae30SDana Myers ACPI_REFCLASS_MAX = 6 513*db2bae30SDana Myers 514*db2bae30SDana Myers } ACPI_REFERENCE_CLASSES; 515*db2bae30SDana Myers 5167c478bd9Sstevel@tonic-gate 5177c478bd9Sstevel@tonic-gate /* 5187c478bd9Sstevel@tonic-gate * Extra object is used as additional storage for types that 5197c478bd9Sstevel@tonic-gate * have AML code in their declarations (TermArgs) that must be 5207c478bd9Sstevel@tonic-gate * evaluated at run time. 5217c478bd9Sstevel@tonic-gate * 5227c478bd9Sstevel@tonic-gate * Currently: Region and FieldUnit types 5237c478bd9Sstevel@tonic-gate */ 5247c478bd9Sstevel@tonic-gate typedef struct acpi_object_extra 5257c478bd9Sstevel@tonic-gate { 5267c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 5277c478bd9Sstevel@tonic-gate ACPI_NAMESPACE_NODE *Method_REG; /* _REG method for this region (if any) */ 5287c478bd9Sstevel@tonic-gate void *RegionContext; /* Region-specific data */ 52927f7c583Smyers UINT8 *AmlStart; 53027f7c583Smyers UINT32 AmlLength; 5317c478bd9Sstevel@tonic-gate 5327c478bd9Sstevel@tonic-gate } ACPI_OBJECT_EXTRA; 5337c478bd9Sstevel@tonic-gate 5347c478bd9Sstevel@tonic-gate 5357c478bd9Sstevel@tonic-gate /* Additional data that can be attached to namespace nodes */ 5367c478bd9Sstevel@tonic-gate 5377c478bd9Sstevel@tonic-gate typedef struct acpi_object_data 5387c478bd9Sstevel@tonic-gate { 5397c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 5407c478bd9Sstevel@tonic-gate ACPI_OBJECT_HANDLER Handler; 5417c478bd9Sstevel@tonic-gate void *Pointer; 5427c478bd9Sstevel@tonic-gate 5437c478bd9Sstevel@tonic-gate } ACPI_OBJECT_DATA; 5447c478bd9Sstevel@tonic-gate 5457c478bd9Sstevel@tonic-gate 5467c478bd9Sstevel@tonic-gate /* Structure used when objects are cached for reuse */ 5477c478bd9Sstevel@tonic-gate 5487c478bd9Sstevel@tonic-gate typedef struct acpi_object_cache_list 5497c478bd9Sstevel@tonic-gate { 5507c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 5517c478bd9Sstevel@tonic-gate union acpi_operand_object *Next; /* Link for object cache and internal lists*/ 5527c478bd9Sstevel@tonic-gate 5537c478bd9Sstevel@tonic-gate } ACPI_OBJECT_CACHE_LIST; 5547c478bd9Sstevel@tonic-gate 5557c478bd9Sstevel@tonic-gate 5567c478bd9Sstevel@tonic-gate /****************************************************************************** 5577c478bd9Sstevel@tonic-gate * 5587c478bd9Sstevel@tonic-gate * ACPI_OPERAND_OBJECT Descriptor - a giant union of all of the above 5597c478bd9Sstevel@tonic-gate * 5607c478bd9Sstevel@tonic-gate *****************************************************************************/ 5617c478bd9Sstevel@tonic-gate 5627c478bd9Sstevel@tonic-gate typedef union acpi_operand_object 5637c478bd9Sstevel@tonic-gate { 56427f7c583Smyers ACPI_OBJECT_COMMON Common; 56527f7c583Smyers ACPI_OBJECT_INTEGER Integer; 56627f7c583Smyers ACPI_OBJECT_STRING String; 56727f7c583Smyers ACPI_OBJECT_BUFFER Buffer; 56827f7c583Smyers ACPI_OBJECT_PACKAGE Package; 56927f7c583Smyers ACPI_OBJECT_EVENT Event; 57027f7c583Smyers ACPI_OBJECT_METHOD Method; 57127f7c583Smyers ACPI_OBJECT_MUTEX Mutex; 57227f7c583Smyers ACPI_OBJECT_REGION Region; 57327f7c583Smyers ACPI_OBJECT_NOTIFY_COMMON CommonNotify; 57427f7c583Smyers ACPI_OBJECT_DEVICE Device; 57527f7c583Smyers ACPI_OBJECT_POWER_RESOURCE PowerResource; 57627f7c583Smyers ACPI_OBJECT_PROCESSOR Processor; 57727f7c583Smyers ACPI_OBJECT_THERMAL_ZONE ThermalZone; 57827f7c583Smyers ACPI_OBJECT_FIELD_COMMON CommonField; 57927f7c583Smyers ACPI_OBJECT_REGION_FIELD Field; 58027f7c583Smyers ACPI_OBJECT_BUFFER_FIELD BufferField; 58127f7c583Smyers ACPI_OBJECT_BANK_FIELD BankField; 58227f7c583Smyers ACPI_OBJECT_INDEX_FIELD IndexField; 58327f7c583Smyers ACPI_OBJECT_NOTIFY_HANDLER Notify; 58427f7c583Smyers ACPI_OBJECT_ADDR_HANDLER AddressSpace; 58527f7c583Smyers ACPI_OBJECT_REFERENCE Reference; 58627f7c583Smyers ACPI_OBJECT_EXTRA Extra; 58727f7c583Smyers ACPI_OBJECT_DATA Data; 58827f7c583Smyers ACPI_OBJECT_CACHE_LIST Cache; 5897c478bd9Sstevel@tonic-gate 590*db2bae30SDana Myers /* 591*db2bae30SDana Myers * Add namespace node to union in order to simplify code that accepts both 592*db2bae30SDana Myers * ACPI_OPERAND_OBJECTs and ACPI_NAMESPACE_NODEs. The structures share 593*db2bae30SDana Myers * a common DescriptorType field in order to differentiate them. 594*db2bae30SDana Myers */ 595*db2bae30SDana Myers ACPI_NAMESPACE_NODE Node; 596*db2bae30SDana Myers 5977c478bd9Sstevel@tonic-gate } ACPI_OPERAND_OBJECT; 5987c478bd9Sstevel@tonic-gate 5997c478bd9Sstevel@tonic-gate 6007c478bd9Sstevel@tonic-gate /****************************************************************************** 6017c478bd9Sstevel@tonic-gate * 6027c478bd9Sstevel@tonic-gate * ACPI_DESCRIPTOR - objects that share a common descriptor identifier 6037c478bd9Sstevel@tonic-gate * 6047c478bd9Sstevel@tonic-gate *****************************************************************************/ 6057c478bd9Sstevel@tonic-gate 6067c478bd9Sstevel@tonic-gate /* Object descriptor types */ 6077c478bd9Sstevel@tonic-gate 6087c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_CACHED 0x01 /* Used only when object is cached */ 6097c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_STATE 0x02 6107c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_STATE_UPDATE 0x03 6117c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_STATE_PACKAGE 0x04 6127c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_STATE_CONTROL 0x05 6137c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_STATE_RPSCOPE 0x06 6147c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_STATE_PSCOPE 0x07 6157c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_STATE_WSCOPE 0x08 6167c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_STATE_RESULT 0x09 6177c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_STATE_NOTIFY 0x0A 6187c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_STATE_THREAD 0x0B 6197c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_WALK 0x0C 6207c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_PARSER 0x0D 6217c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_OPERAND 0x0E 6227c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_NAMED 0x0F 6237c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_MAX 0x0F 6247c478bd9Sstevel@tonic-gate 6257c478bd9Sstevel@tonic-gate 62627f7c583Smyers typedef struct acpi_common_descriptor 62727f7c583Smyers { 62827f7c583Smyers void *CommonPointer; 62927f7c583Smyers UINT8 DescriptorType; /* To differentiate various internal objs */ 63027f7c583Smyers 63127f7c583Smyers } ACPI_COMMON_DESCRIPTOR; 63227f7c583Smyers 6337c478bd9Sstevel@tonic-gate typedef union acpi_descriptor 6347c478bd9Sstevel@tonic-gate { 63527f7c583Smyers ACPI_COMMON_DESCRIPTOR Common; 6367c478bd9Sstevel@tonic-gate ACPI_OPERAND_OBJECT Object; 6377c478bd9Sstevel@tonic-gate ACPI_NAMESPACE_NODE Node; 6387c478bd9Sstevel@tonic-gate ACPI_PARSE_OBJECT Op; 6397c478bd9Sstevel@tonic-gate 6407c478bd9Sstevel@tonic-gate } ACPI_DESCRIPTOR; 6417c478bd9Sstevel@tonic-gate 642*db2bae30SDana Myers #pragma pack() 6437c478bd9Sstevel@tonic-gate 6447c478bd9Sstevel@tonic-gate #endif /* _ACOBJECT_H */ 645