ReactOS 0.4.17-dev-684-ga6524ef
config.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef UACPI_OVERRIDE_CONFIG
4#include "uacpi_config.h"
5#else
6
7#include <uacpi/helpers.h>
8#include <uacpi/log.h>
9
10/*
11 * =======================
12 * Context-related options
13 * =======================
14 */
15
16/*
17 * Optional string to prefix all uACPI log messages with.
18 */
19// #define UACPI_START_OF_LOG_MSG
20
21/*
22 * Optional string to suffix all uACPI log messages with.
23 */
24#ifndef UACPI_END_OF_LOG_MSG
25 #define UACPI_END_OF_LOG_MSG "\n"
26#endif
27
28#ifndef UACPI_DEFAULT_LOG_LEVEL
29 #define UACPI_DEFAULT_LOG_LEVEL UACPI_LOG_INFO
30#endif
31
35 "configured default log level is invalid"
36);
37
38#ifndef UACPI_DEFAULT_LOOP_TIMEOUT_SECONDS
39 #define UACPI_DEFAULT_LOOP_TIMEOUT_SECONDS 30
40#endif
41
44 "configured default loop timeout is invalid (expecting at least 1 second)"
45);
46
47#ifndef UACPI_DEFAULT_MAX_CALL_STACK_DEPTH
48 #define UACPI_DEFAULT_MAX_CALL_STACK_DEPTH 256
49#endif
50
53 "configured default max call stack depth is invalid "
54 "(expecting at least 4 frames)"
55);
56
57/*
58 * ===================
59 * Kernel-api options
60 * ===================
61 */
62
63/*
64 * Convenience initialization/deinitialization hooks that will be called by
65 * uACPI automatically when appropriate if compiled-in.
66 */
67// #define UACPI_KERNEL_INITIALIZATION
68
69/*
70 * Makes kernel api logging callbacks work with unformatted printf-style
71 * strings and va_args instead of a pre-formatted string. Can be useful if
72 * your native logging is implemented in terms of this format as well.
73 */
74// #define UACPI_FORMATTED_LOGGING
75
76/*
77 * Makes uacpi_kernel_free take in an additional 'size_hint' parameter, which
78 * contains the size of the original allocation. Note that this comes with a
79 * performance penalty in some cases.
80 */
81// #define UACPI_SIZED_FREES
82
83/*
84 * Makes uacpi_kernel_mmio_read{8,16,32,64} and
85 * uacpi_kernel_mmio_write{8,16,32,64} mandatory to implement by the host,
86 * uACPI will not provide a default implementation if this is enabled.
87 * By default, uACPI ships with simple builtin MMIO helpers that use volatile
88 * loads and stores.
89 */
90// #define UACPI_NATIVE_MMIO
91
92/*
93 * Makes uacpi_kernel_alloc_zeroed mandatory to implement by the host, uACPI
94 * will not provide a default implementation if this is enabled.
95 */
96// #define UACPI_NATIVE_ALLOC_ZEROED
97
98/*
99 * =========================
100 * Platform-specific options
101 * =========================
102 */
103
104/*
105 * Makes uACPI use the internal versions of mem{cpy,move,set,cmp} instead of
106 * relying on the host to provide them. Note that compilers like clang and GCC
107 * rely on these being available by default, even in freestanding mode, so
108 * compiling uACPI may theoretically generate implicit dependencies on them
109 * even if this option is defined.
110 */
111// #define UACPI_USE_BUILTIN_STRING
112
113/*
114 * Turns uacpi_phys_addr and uacpi_io_addr into a 32-bit type, and adds extra
115 * code for address truncation. Needed for e.g. i686 platforms without PAE
116 * support.
117 */
118// #define UACPI_PHYS_ADDR_IS_32BITS
119
120/*
121 * Switches uACPI into reduced-hardware-only mode. Strips all full-hardware
122 * ACPI support code at compile-time, including the event subsystem, the global
123 * lock, and other full-hardware features.
124 */
125// #define UACPI_REDUCED_HARDWARE
126
127/*
128 * Switches uACPI into tables-subsystem-only mode and strips all other code.
129 * This means only the table API will be usable, no other subsystems are
130 * compiled in. In this mode, uACPI only depends on the following kernel APIs:
131 * - uacpi_kernel_get_rsdp
132 * - uacpi_kernel_{map,unmap}
133 * - uacpi_kernel_log
134 *
135 * Use uacpi_setup_early_table_access to initialize, uacpi_state_reset to
136 * deinitialize.
137 *
138 * This mode is primarily designed for these three use-cases:
139 * - Bootloader/pre-kernel environments that need to parse ACPI tables, but
140 * don't actually need a fully-featured AML interpreter, and everything else
141 * that a full APCI implementation entails.
142 * - A micro-kernel that has the full AML interpreter running in userspace, but
143 * still needs to parse ACPI tables to bootstrap allocators, timers, SMP etc.
144 * - A WIP kernel that needs to parse ACPI tables for bootrapping SMP/timers,
145 * ECAM, etc., but doesn't yet have enough subsystems implemented in order
146 * to run a fully-featured AML interpreter.
147 */
148// #define UACPI_BAREBONES_MODE
149
150/*
151 * =============
152 * Misc. options
153 * =============
154 */
155
156/*
157 * If UACPI_FORMATTED_LOGGING is not enabled, this is the maximum length of the
158 * pre-formatted message that is passed to the logging callback.
159 */
160#ifndef UACPI_PLAIN_LOG_BUFFER_SIZE
161 #define UACPI_PLAIN_LOG_BUFFER_SIZE 128
162#endif
163
166 "configured log buffer size is too small (expecting at least 16 bytes)"
167);
168
169/*
170 * The size of the table descriptor inline storage. All table descriptors past
171 * this length will be stored in a dynamically allocated heap array. The size
172 * of one table descriptor is approximately 56 bytes.
173 */
174#ifndef UACPI_STATIC_TABLE_ARRAY_LEN
175 #define UACPI_STATIC_TABLE_ARRAY_LEN 16
176#endif
177
180 "configured static table array length is too small (expecting at least 1)"
181);
182
183#endif
@ UACPI_LOG_DEBUG
Definition: log.h:12
@ UACPI_LOG_ERROR
Definition: log.h:35
#define UACPI_PLAIN_LOG_BUFFER_SIZE
Definition: config.h:161
#define UACPI_STATIC_TABLE_ARRAY_LEN
Definition: config.h:175
UACPI_BUILD_BUG_ON_WITH_MSG(UACPI_DEFAULT_LOOP_TIMEOUT_SECONDS< 1, "configured default loop timeout is invalid (expecting at least 1 second)")
#define UACPI_DEFAULT_LOG_LEVEL
Definition: config.h:29
#define UACPI_DEFAULT_MAX_CALL_STACK_DEPTH
Definition: config.h:48
#define UACPI_DEFAULT_LOOP_TIMEOUT_SECONDS
Definition: config.h:39