^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Name: acenv.h - Host and compiler configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Copyright (C) 2000 - 2020, Intel Corp.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) *****************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #ifndef __ACENV_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #define __ACENV_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * Environment configuration. The purpose of this file is to interface ACPICA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) * to the local environment. This includes compiler-specific, OS-specific,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * and machine-specific configuration.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) /* Types for ACPI_MUTEX_TYPE */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define ACPI_BINARY_SEMAPHORE 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #define ACPI_OSL_MUTEX 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) /* Types for DEBUGGER_THREADING */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #define DEBUGGER_SINGLE_THREADED 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #define DEBUGGER_MULTI_THREADED 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) /******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) * Configuration for ACPI tools and utilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) *****************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) /* Common application configuration. All single threaded except for acpi_exec. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) #if (defined ACPI_ASL_COMPILER) || \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) (defined ACPI_BIN_APP) || \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) (defined ACPI_DUMP_APP) || \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) (defined ACPI_HELP_APP) || \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) (defined ACPI_NAMES_APP) || \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) (defined ACPI_SRC_APP) || \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) (defined ACPI_XTRACT_APP) || \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) (defined ACPI_EXAMPLE_APP) || \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) (defined ACPI_EFI_HELLO)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) #define ACPI_APPLICATION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #define ACPI_SINGLE_THREADED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) #define USE_NATIVE_ALLOCATE_ZEROED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) /* iASL configuration */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) #ifdef ACPI_ASL_COMPILER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) #define ACPI_DEBUG_OUTPUT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) #define ACPI_CONSTANT_EVAL_ONLY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) #define ACPI_LARGE_NAMESPACE_NODE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #define ACPI_DATA_TABLE_DISASSEMBLY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) #define ACPI_32BIT_PHYSICAL_ADDRESS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) #define ACPI_DISASSEMBLER 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) /* acpi_exec configuration. Multithreaded with full AML debugger */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) #ifdef ACPI_EXEC_APP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) #define ACPI_APPLICATION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) #define ACPI_FULL_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) #define ACPI_MUTEX_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) #define ACPI_DBG_TRACK_ALLOCATIONS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) /* acpi_help configuration. Error messages disabled. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) #ifdef ACPI_HELP_APP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) #define ACPI_NO_ERROR_MESSAGES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) /* acpi_names configuration. Debug output enabled. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) #ifdef ACPI_NAMES_APP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) #define ACPI_DEBUG_OUTPUT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) /* acpi_exec/acpi_names/Example configuration. Native RSDP used. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) #if (defined ACPI_EXEC_APP) || \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) (defined ACPI_EXAMPLE_APP) || \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) (defined ACPI_NAMES_APP)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) #define ACPI_USE_NATIVE_RSDP_POINTER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) /* acpi_dump configuration. Native mapping used if provided by the host */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) #ifdef ACPI_DUMP_APP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) #define ACPI_USE_NATIVE_MEMORY_MAPPING
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) /* acpi_names/Example configuration. Hardware disabled */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) #if (defined ACPI_EXAMPLE_APP) || \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) (defined ACPI_NAMES_APP)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) #define ACPI_REDUCED_HARDWARE 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) /* Linkable ACPICA library. Two versions, one with full debug. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) #ifdef ACPI_LIBRARY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) #define ACPI_USE_LOCAL_CACHE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) #define ACPI_DEBUGGER 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) #define ACPI_DISASSEMBLER 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) #ifdef _DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) #define ACPI_DEBUG_OUTPUT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) /* Common for all ACPICA applications */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) #ifdef ACPI_APPLICATION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) #define ACPI_USE_LOCAL_CACHE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) /* Common debug/disassembler support */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) #ifdef ACPI_FULL_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) #define ACPI_DEBUG_OUTPUT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) #define ACPI_DEBUGGER 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) #define ACPI_DISASSEMBLER 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) * acpisrc CR\LF support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) * Unix file line endings do not include the carriage return.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) * If the acpisrc utility is being built using a microsoft compiler, it means
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) * that it will be running on a windows machine which means that the output is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) * expected to have CR/LF newlines. If the acpisrc utility is built with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) * anything else, it will likely run on a system with LF newlines. This flag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) * tells the acpisrc utility that newlines will be in the LF format.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) #define ACPI_SRC_OS_LF_ONLY 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) /*! [Begin] no source code translation */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) /******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) * Host configuration files. The compiler configuration files are included
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) * first.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) *****************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) #include <acpi/platform/acgcc.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) #elif defined(_MSC_VER)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) #include "acmsvc.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) #elif defined(__INTEL_COMPILER)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) #include <acpi/platform/acintel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) #if defined(_LINUX) || defined(__linux__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) #include <acpi/platform/aclinux.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) #elif defined(_APPLE) || defined(__APPLE__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) #include "acmacosx.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) #elif defined(__DragonFly__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) #include "acdragonfly.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) #include "acfreebsd.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) #elif defined(__NetBSD__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) #include "acnetbsd.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) #elif defined(__sun)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) #include "acsolaris.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) #elif defined(MODESTO)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) #include "acmodesto.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) #elif defined(NETWARE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) #include "acnetware.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) #elif defined(_CYGWIN)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) #include "accygwin.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) #elif defined(WIN32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) #include "acwin.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) #elif defined(WIN64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) #include "acwin64.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) #elif defined(_WRS_LIB_BUILD)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) #include "acvxworks.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) #elif defined(__OS2__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) #include "acos2.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) #elif defined(__HAIKU__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) #include "achaiku.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) #elif defined(__QNX__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) #include "acqnx.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) * EFI applications can be built with -nostdlib, in this case, it must be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) * included after including all other host environmental definitions, in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) * order to override the definitions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) #elif defined(_AED_EFI) || defined(_GNU_EFI) || defined(_EDK2_EFI)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) #include "acefi.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) /* Unknown environment */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) #error Unknown target environment
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) /*! [End] no source code translation !*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) /******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) * Setup defaults for the required symbols that were not defined in one of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) * the host/compiler files above.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) *****************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) /* 64-bit data types */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) #ifndef COMPILER_DEPENDENT_INT64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) #define COMPILER_DEPENDENT_INT64 long long
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) #ifndef COMPILER_DEPENDENT_UINT64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) #define COMPILER_DEPENDENT_UINT64 unsigned long long
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) /* Type of mutex supported by host. Default is binary semaphores. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) #ifndef ACPI_MUTEX_TYPE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) #define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) /* Global Lock acquire/release */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) #ifndef ACPI_ACQUIRE_GLOBAL_LOCK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) #define ACPI_ACQUIRE_GLOBAL_LOCK(Glptr, acquired) acquired = 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) #ifndef ACPI_RELEASE_GLOBAL_LOCK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) #define ACPI_RELEASE_GLOBAL_LOCK(Glptr, pending) pending = 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) /* Flush CPU cache - used when going to sleep. Wbinvd or similar. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) #ifndef ACPI_FLUSH_CPU_CACHE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) #define ACPI_FLUSH_CPU_CACHE()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) /* "inline" keywords - configurable since inline is not standardized */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) #ifndef ACPI_INLINE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) #define ACPI_INLINE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) /* Use ordered initialization if compiler doesn't support designated. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) #ifndef ACPI_STRUCT_INIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) #define ACPI_STRUCT_INIT(field, value) value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) * Configurable calling conventions:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) * ACPI_EXTERNAL_XFACE - External ACPI interfaces
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) * ACPI_INTERNAL_XFACE - Internal ACPI interfaces
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) #ifndef ACPI_SYSTEM_XFACE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) #define ACPI_SYSTEM_XFACE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) #ifndef ACPI_EXTERNAL_XFACE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) #define ACPI_EXTERNAL_XFACE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) #ifndef ACPI_INTERNAL_XFACE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) #define ACPI_INTERNAL_XFACE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) #ifndef ACPI_INTERNAL_VAR_XFACE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) #define ACPI_INTERNAL_VAR_XFACE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) * Debugger threading model
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) * Use single threaded if the entire subsystem is contained in an application
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) * Use multiple threaded when the subsystem is running in the kernel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) * By default the model is single threaded if ACPI_APPLICATION is set,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) * multi-threaded if ACPI_APPLICATION is not set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) #ifndef DEBUGGER_THREADING
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) #if !defined (ACPI_APPLICATION) || defined (ACPI_EXEC_APP)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) #define DEBUGGER_THREADING DEBUGGER_MULTI_THREADED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) #endif /* !DEBUGGER_THREADING */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) /******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) * C library configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) *****************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) * ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) * Otherwise, local versions of string/memory functions will be used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) * ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) * the standard header files may be used. Defining this implies that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) * ACPI_USE_SYSTEM_CLIBRARY has been defined.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) * The ACPICA subsystem only uses low level C library functions that do not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) * call operating system services and may therefore be inlined in the code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) * It may be necessary to tailor these include files to the target
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) * generation environment.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) /* Use the standard C library headers. We want to keep these to a minimum. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) #ifdef ACPI_USE_STANDARD_HEADERS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) /* Use the standard headers from the standard locations */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) #include <stdlib.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) #include <string.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) #include <ctype.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) #if defined (ACPI_APPLICATION) || defined(ACPI_LIBRARY)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) #include <stdio.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) #include <fcntl.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) #include <errno.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) #include <time.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) #include <signal.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) #endif /* ACPI_USE_STANDARD_HEADERS */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) #ifdef ACPI_APPLICATION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) #define ACPI_FILE FILE *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) #define ACPI_FILE_OUT stdout
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) #define ACPI_FILE_ERR stderr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) #define ACPI_FILE void *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) #define ACPI_FILE_OUT NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) #define ACPI_FILE_ERR NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) #endif /* ACPI_APPLICATION */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) #ifndef ACPI_INIT_FUNCTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) #define ACPI_INIT_FUNCTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) #endif /* __ACENV_H__ */