1149703c7Sjruoho /******************************************************************************
2149703c7Sjruoho  *
3149703c7Sjruoho  * Name: acconfig.h - Global configuration constants
4149703c7Sjruoho  *
5149703c7Sjruoho  *****************************************************************************/
6149703c7Sjruoho 
768471b32Sjruoho /*
8e5631441Schristos  * Copyright (C) 2000 - 2022, Intel Corp.
9149703c7Sjruoho  * All rights reserved.
10149703c7Sjruoho  *
1168471b32Sjruoho  * Redistribution and use in source and binary forms, with or without
1268471b32Sjruoho  * modification, are permitted provided that the following conditions
1368471b32Sjruoho  * are met:
1468471b32Sjruoho  * 1. Redistributions of source code must retain the above copyright
1568471b32Sjruoho  *    notice, this list of conditions, and the following disclaimer,
1668471b32Sjruoho  *    without modification.
1768471b32Sjruoho  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
1868471b32Sjruoho  *    substantially similar to the "NO WARRANTY" disclaimer below
1968471b32Sjruoho  *    ("Disclaimer") and any redistribution must be conditioned upon
2068471b32Sjruoho  *    including a substantially similar Disclaimer requirement for further
2168471b32Sjruoho  *    binary redistribution.
2268471b32Sjruoho  * 3. Neither the names of the above-listed copyright holders nor the names
2368471b32Sjruoho  *    of any contributors may be used to endorse or promote products derived
2468471b32Sjruoho  *    from this software without specific prior written permission.
25149703c7Sjruoho  *
2668471b32Sjruoho  * Alternatively, this software may be distributed under the terms of the
2768471b32Sjruoho  * GNU General Public License ("GPL") version 2 as published by the Free
2868471b32Sjruoho  * Software Foundation.
29149703c7Sjruoho  *
3068471b32Sjruoho  * NO WARRANTY
3168471b32Sjruoho  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3268471b32Sjruoho  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33d4291bf2Schristos  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3468471b32Sjruoho  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3568471b32Sjruoho  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3668471b32Sjruoho  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3768471b32Sjruoho  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3868471b32Sjruoho  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
3968471b32Sjruoho  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
4068471b32Sjruoho  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
4168471b32Sjruoho  * POSSIBILITY OF SUCH DAMAGES.
4268471b32Sjruoho  */
43149703c7Sjruoho 
44149703c7Sjruoho #ifndef _ACCONFIG_H
45149703c7Sjruoho #define _ACCONFIG_H
46149703c7Sjruoho 
47149703c7Sjruoho 
48149703c7Sjruoho /******************************************************************************
49149703c7Sjruoho  *
50149703c7Sjruoho  * Configuration options
51149703c7Sjruoho  *
52149703c7Sjruoho  *****************************************************************************/
53149703c7Sjruoho 
54149703c7Sjruoho /*
55149703c7Sjruoho  * ACPI_DEBUG_OUTPUT    - This switch enables all the debug facilities of the
56149703c7Sjruoho  *                        ACPI subsystem. This includes the DEBUG_PRINT output
57149703c7Sjruoho  *                        statements. When disabled, all DEBUG_PRINT
58149703c7Sjruoho  *                        statements are compiled out.
59149703c7Sjruoho  *
60149703c7Sjruoho  * ACPI_APPLICATION     - Use this switch if the subsystem is going to be run
61149703c7Sjruoho  *                        at the application level.
62149703c7Sjruoho  *
63149703c7Sjruoho  */
64149703c7Sjruoho 
65149703c7Sjruoho /*
66149703c7Sjruoho  * OS name, used for the _OS object. The _OS object is essentially obsolete,
67149703c7Sjruoho  * but there is a large base of ASL/AML code in existing machines that check
68149703c7Sjruoho  * for the string below. The use of this string usually guarantees that
69149703c7Sjruoho  * the ASL will execute down the most tested code path. Also, there is some
70149703c7Sjruoho  * code that will not execute the _OSI method unless _OS matches the string
71149703c7Sjruoho  * below. Therefore, change this string at your own risk.
72149703c7Sjruoho  */
73149703c7Sjruoho #define ACPI_OS_NAME                    "Microsoft Windows NT"
74149703c7Sjruoho 
75149703c7Sjruoho /* Maximum objects in the various object caches */
76149703c7Sjruoho 
77149703c7Sjruoho #define ACPI_MAX_STATE_CACHE_DEPTH      96          /* State objects */
78149703c7Sjruoho #define ACPI_MAX_PARSE_CACHE_DEPTH      96          /* Parse tree objects */
79149703c7Sjruoho #define ACPI_MAX_EXTPARSE_CACHE_DEPTH   96          /* Parse tree objects */
80149703c7Sjruoho #define ACPI_MAX_OBJECT_CACHE_DEPTH     96          /* Interpreter operand objects */
81149703c7Sjruoho #define ACPI_MAX_NAMESPACE_CACHE_DEPTH  96          /* Namespace objects */
821a3716ccSchristos #define ACPI_MAX_COMMENT_CACHE_DEPTH    96          /* Comments for the -ca option */
83149703c7Sjruoho 
84149703c7Sjruoho /*
85149703c7Sjruoho  * Should the subsystem abort the loading of an ACPI table if the
86149703c7Sjruoho  * table checksum is incorrect?
87149703c7Sjruoho  */
8873d4e80bSchristos #ifndef ACPI_CHECKSUM_ABORT
89149703c7Sjruoho #define ACPI_CHECKSUM_ABORT             FALSE
9073d4e80bSchristos #endif
9173d4e80bSchristos 
9273d4e80bSchristos /*
9373d4e80bSchristos  * Generate a version of ACPICA that only supports "reduced hardware"
9473d4e80bSchristos  * platforms (as defined in ACPI 5.0). Set to TRUE to generate a specialized
9573d4e80bSchristos  * version of ACPICA that ONLY supports the ACPI 5.0 "reduced hardware"
9673d4e80bSchristos  * model. In other words, no ACPI hardware is supported.
9773d4e80bSchristos  *
9873d4e80bSchristos  * If TRUE, this means no support for the following:
9973d4e80bSchristos  *      PM Event and Control registers
10073d4e80bSchristos  *      SCI interrupt (and handler)
10173d4e80bSchristos  *      Fixed Events
10273d4e80bSchristos  *      General Purpose Events (GPEs)
10373d4e80bSchristos  *      Global Lock
10473d4e80bSchristos  *      ACPI PM timer
10573d4e80bSchristos  *      FACS table (Waking vectors and Global Lock)
10673d4e80bSchristos  */
10773d4e80bSchristos #ifndef ACPI_REDUCED_HARDWARE
10873d4e80bSchristos #define ACPI_REDUCED_HARDWARE           FALSE
10973d4e80bSchristos #endif
110149703c7Sjruoho 
111149703c7Sjruoho 
112149703c7Sjruoho /******************************************************************************
113149703c7Sjruoho  *
114149703c7Sjruoho  * Subsystem Constants
115149703c7Sjruoho  *
116149703c7Sjruoho  *****************************************************************************/
117149703c7Sjruoho 
118149703c7Sjruoho /* Version of ACPI supported */
119149703c7Sjruoho 
12073d4e80bSchristos #define ACPI_CA_SUPPORT_LEVEL           5
121149703c7Sjruoho 
122149703c7Sjruoho /* Maximum count for a semaphore object */
123149703c7Sjruoho 
124149703c7Sjruoho #define ACPI_MAX_SEMAPHORE_COUNT        256
125149703c7Sjruoho 
126149703c7Sjruoho /* Maximum object reference count (detects object deletion issues) */
127149703c7Sjruoho 
128a82ffdcfSchristos #define ACPI_MAX_REFERENCE_COUNT        0x4000
129149703c7Sjruoho 
130149703c7Sjruoho /* Default page size for use in mapping memory for operation regions */
131149703c7Sjruoho 
132149703c7Sjruoho #define ACPI_DEFAULT_PAGE_SIZE          4096    /* Must be power of 2 */
133149703c7Sjruoho 
134517d1194Schristos /* OwnerId tracking. 128 entries allows for 4095 OwnerIds */
135149703c7Sjruoho 
136517d1194Schristos #define ACPI_NUM_OWNERID_MASKS          128
137149703c7Sjruoho 
138149703c7Sjruoho /* Size of the root table array is increased by this increment */
139149703c7Sjruoho 
140149703c7Sjruoho #define ACPI_ROOT_TABLE_SIZE_INCREMENT  4
141149703c7Sjruoho 
142149703c7Sjruoho /* Maximum sleep allowed via Sleep() operator */
143149703c7Sjruoho 
14473d4e80bSchristos #define ACPI_MAX_SLEEP                  2000    /* 2000 millisec == two seconds */
14573d4e80bSchristos 
14673d4e80bSchristos /* Address Range lists are per-SpaceId (Memory and I/O only) */
14773d4e80bSchristos 
14873d4e80bSchristos #define ACPI_ADDRESS_RANGE_MAX          2
149149703c7Sjruoho 
1502baed015Schristos /* Maximum time (default 30s) of While() loops before abort */
1515b9576aaSchristos 
1522baed015Schristos #define ACPI_MAX_LOOP_TIMEOUT           30
1535b9576aaSchristos 
154149703c7Sjruoho 
155149703c7Sjruoho /******************************************************************************
156149703c7Sjruoho  *
157149703c7Sjruoho  * ACPI Specification constants (Do not change unless the specification changes)
158149703c7Sjruoho  *
159149703c7Sjruoho  *****************************************************************************/
160149703c7Sjruoho 
1617cf8bdb9Schristos /* Method info (in WALK_STATE), containing local variables and arguments */
162149703c7Sjruoho 
163149703c7Sjruoho #define ACPI_METHOD_NUM_LOCALS          8
164149703c7Sjruoho #define ACPI_METHOD_MAX_LOCAL           7
165149703c7Sjruoho 
166149703c7Sjruoho #define ACPI_METHOD_NUM_ARGS            7
167149703c7Sjruoho #define ACPI_METHOD_MAX_ARG             6
168149703c7Sjruoho 
169149703c7Sjruoho /*
170149703c7Sjruoho  * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG
171149703c7Sjruoho  */
172149703c7Sjruoho #define ACPI_OBJ_NUM_OPERANDS           8
173149703c7Sjruoho #define ACPI_OBJ_MAX_OPERAND            7
174149703c7Sjruoho 
175149703c7Sjruoho /* Number of elements in the Result Stack frame, can be an arbitrary value */
176149703c7Sjruoho 
177149703c7Sjruoho #define ACPI_RESULTS_FRAME_OBJ_NUM      8
178149703c7Sjruoho 
179149703c7Sjruoho /*
180149703c7Sjruoho  * Maximal number of elements the Result Stack can contain,
18101bd6626Schristos  * it may be an arbitrary value not exceeding the types of
182149703c7Sjruoho  * ResultSize and ResultCount (now UINT8).
183149703c7Sjruoho  */
184149703c7Sjruoho #define ACPI_RESULTS_OBJ_NUM_MAX        255
185149703c7Sjruoho 
186149703c7Sjruoho /* Constants used in searching for the RSDP in low memory */
187149703c7Sjruoho 
188149703c7Sjruoho #define ACPI_EBDA_PTR_LOCATION          0x0000040E     /* Physical Address */
189149703c7Sjruoho #define ACPI_EBDA_PTR_LENGTH            2
190149703c7Sjruoho #define ACPI_EBDA_WINDOW_SIZE           1024
191149703c7Sjruoho #define ACPI_HI_RSDP_WINDOW_BASE        0x000E0000     /* Physical Address */
192149703c7Sjruoho #define ACPI_HI_RSDP_WINDOW_SIZE        0x00020000
193149703c7Sjruoho #define ACPI_RSDP_SCAN_STEP             16
194149703c7Sjruoho 
195149703c7Sjruoho /* Operation regions */
196149703c7Sjruoho 
197149703c7Sjruoho #define ACPI_USER_REGION_BEGIN          0x80
198149703c7Sjruoho 
199149703c7Sjruoho /* Maximum SpaceIds for Operation Regions */
200149703c7Sjruoho 
201149703c7Sjruoho #define ACPI_MAX_ADDRESS_SPACE          255
20273d4e80bSchristos #define ACPI_NUM_DEFAULT_SPACES         4
203149703c7Sjruoho 
204149703c7Sjruoho /* Array sizes. Used for range checking also */
205149703c7Sjruoho 
206149703c7Sjruoho #define ACPI_MAX_MATCH_OPCODE           5
207149703c7Sjruoho 
208149703c7Sjruoho /* RSDP checksums */
209149703c7Sjruoho 
210149703c7Sjruoho #define ACPI_RSDP_CHECKSUM_LENGTH       20
211149703c7Sjruoho #define ACPI_RSDP_XCHECKSUM_LENGTH      36
212149703c7Sjruoho 
2134e4e259fSchristos /*
2144e4e259fSchristos  * SMBus, GSBus and IPMI buffer sizes. All have a 2-byte header,
2154e4e259fSchristos  * containing both Status and Length.
2164e4e259fSchristos  */
2174e4e259fSchristos #define ACPI_SERIAL_HEADER_SIZE         2   /* Common for below. Status and Length fields */
218149703c7Sjruoho 
2194e4e259fSchristos #define ACPI_SMBUS_DATA_SIZE            32
2204e4e259fSchristos #define ACPI_SMBUS_BUFFER_SIZE          ACPI_SERIAL_HEADER_SIZE + ACPI_SMBUS_DATA_SIZE
2214e4e259fSchristos 
2224e4e259fSchristos #define ACPI_IPMI_DATA_SIZE             64
2234e4e259fSchristos #define ACPI_IPMI_BUFFER_SIZE           ACPI_SERIAL_HEADER_SIZE + ACPI_IPMI_DATA_SIZE
2244e4e259fSchristos 
2254e4e259fSchristos #define ACPI_MAX_GSBUS_DATA_SIZE        255
2264e4e259fSchristos #define ACPI_MAX_GSBUS_BUFFER_SIZE      ACPI_SERIAL_HEADER_SIZE + ACPI_MAX_GSBUS_DATA_SIZE
2274e4e259fSchristos 
2289d132428Schristos #define ACPI_PRM_INPUT_BUFFER_SIZE      26
229149703c7Sjruoho 
230*ae04e23cSchristos #define ACPI_FFH_INPUT_BUFFER_SIZE      256
231*ae04e23cSchristos 
232149703c7Sjruoho /* _SxD and _SxW control methods */
233149703c7Sjruoho 
234149703c7Sjruoho #define ACPI_NUM_SxD_METHODS            4
235149703c7Sjruoho #define ACPI_NUM_SxW_METHODS            5
236149703c7Sjruoho 
237149703c7Sjruoho 
238149703c7Sjruoho /******************************************************************************
239149703c7Sjruoho  *
240038c9182Schristos  * Miscellaneous constants
241038c9182Schristos  *
242038c9182Schristos  *****************************************************************************/
243038c9182Schristos 
244038c9182Schristos /* UUID constants */
245038c9182Schristos 
246038c9182Schristos #define UUID_BUFFER_LENGTH          16 /* Length of UUID in memory */
247038c9182Schristos #define UUID_STRING_LENGTH          36 /* Total length of a UUID string */
248038c9182Schristos 
249038c9182Schristos /* Positions for required hyphens (dashes) in UUID strings */
250038c9182Schristos 
251038c9182Schristos #define UUID_HYPHEN1_OFFSET         8
252038c9182Schristos #define UUID_HYPHEN2_OFFSET         13
253038c9182Schristos #define UUID_HYPHEN3_OFFSET         18
254038c9182Schristos #define UUID_HYPHEN4_OFFSET         23
255038c9182Schristos 
256038c9182Schristos 
257038c9182Schristos /******************************************************************************
258038c9182Schristos  *
259149703c7Sjruoho  * ACPI AML Debugger
260149703c7Sjruoho  *
261149703c7Sjruoho  *****************************************************************************/
262149703c7Sjruoho 
26373d4e80bSchristos #define ACPI_DEBUGGER_MAX_ARGS          ACPI_METHOD_NUM_ARGS + 4 /* Max command line arguments */
26432903b12Sjruoho #define ACPI_DB_LINE_BUFFER_SIZE        512
265149703c7Sjruoho 
266149703c7Sjruoho #define ACPI_DEBUGGER_COMMAND_PROMPT    '-'
267149703c7Sjruoho #define ACPI_DEBUGGER_EXECUTE_PROMPT    '%'
268149703c7Sjruoho 
269149703c7Sjruoho 
270149703c7Sjruoho #endif /* _ACCONFIG_H */
271