1
2
3
4
5
6
7
8
9
10#define EXPORT_ACPI_INTERFACES
11
12#include <acpi/acpi.h>
13#include "accommon.h"
14#include "acevents.h"
15#include "acnamesp.h"
16#include "acdebug.h"
17#include "actables.h"
18
19#define _COMPONENT ACPI_UTILITIES
20ACPI_MODULE_NAME("utxfinit")
21
22
23void ae_do_object_overrides(void);
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38acpi_status ACPI_INIT_FUNCTION acpi_initialize_subsystem(void)
39{
40 acpi_status status;
41
42 ACPI_FUNCTION_TRACE(acpi_initialize_subsystem);
43
44 acpi_gbl_startup_flags = ACPI_SUBSYSTEM_INITIALIZE;
45 ACPI_DEBUG_EXEC(acpi_ut_init_stack_ptr_trace());
46
47
48
49 status = acpi_os_initialize();
50 if (ACPI_FAILURE(status)) {
51 ACPI_EXCEPTION((AE_INFO, status, "During OSL initialization"));
52 return_ACPI_STATUS(status);
53 }
54
55
56
57 status = acpi_ut_init_globals();
58 if (ACPI_FAILURE(status)) {
59 ACPI_EXCEPTION((AE_INFO, status,
60 "During initialization of globals"));
61 return_ACPI_STATUS(status);
62 }
63
64
65
66 status = acpi_ut_mutex_initialize();
67 if (ACPI_FAILURE(status)) {
68 ACPI_EXCEPTION((AE_INFO, status,
69 "During Global Mutex creation"));
70 return_ACPI_STATUS(status);
71 }
72
73
74
75
76
77 status = acpi_ns_root_initialize();
78 if (ACPI_FAILURE(status)) {
79 ACPI_EXCEPTION((AE_INFO, status,
80 "During Namespace initialization"));
81 return_ACPI_STATUS(status);
82 }
83
84
85
86 status = acpi_ut_initialize_interfaces();
87 if (ACPI_FAILURE(status)) {
88 ACPI_EXCEPTION((AE_INFO, status,
89 "During OSI interfaces initialization"));
90 return_ACPI_STATUS(status);
91 }
92
93 return_ACPI_STATUS(AE_OK);
94}
95
96ACPI_EXPORT_SYMBOL_INIT(acpi_initialize_subsystem)
97
98
99
100
101
102
103
104
105
106
107
108
109
110acpi_status ACPI_INIT_FUNCTION acpi_enable_subsystem(u32 flags)
111{
112 acpi_status status = AE_OK;
113
114 ACPI_FUNCTION_TRACE(acpi_enable_subsystem);
115
116
117
118
119
120
121 acpi_gbl_early_initialization = FALSE;
122
123#if (!ACPI_REDUCED_HARDWARE)
124
125
126
127 if (!(flags & ACPI_NO_ACPI_ENABLE)) {
128 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
129 "[Init] Going into ACPI mode\n"));
130
131 acpi_gbl_original_mode = acpi_hw_get_mode();
132
133 status = acpi_enable();
134 if (ACPI_FAILURE(status)) {
135 ACPI_WARNING((AE_INFO, "AcpiEnable failed"));
136 return_ACPI_STATUS(status);
137 }
138 }
139
140
141
142
143
144 if (!(flags & ACPI_NO_FACS_INIT)) {
145 status = acpi_tb_initialize_facs();
146 if (ACPI_FAILURE(status)) {
147 ACPI_WARNING((AE_INFO, "Could not map the FACS table"));
148 return_ACPI_STATUS(status);
149 }
150 }
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166 if (!(flags & ACPI_NO_EVENT_INIT)) {
167 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
168 "[Init] Initializing ACPI events\n"));
169
170 status = acpi_ev_initialize_events();
171 if (ACPI_FAILURE(status)) {
172 return_ACPI_STATUS(status);
173 }
174 }
175
176
177
178
179
180 if (!(flags & ACPI_NO_HANDLER_INIT)) {
181 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
182 "[Init] Installing SCI/GL handlers\n"));
183
184 status = acpi_ev_install_xrupt_handlers();
185 if (ACPI_FAILURE(status)) {
186 return_ACPI_STATUS(status);
187 }
188 }
189#endif
190
191 return_ACPI_STATUS(status);
192}
193
194ACPI_EXPORT_SYMBOL_INIT(acpi_enable_subsystem)
195
196
197
198
199
200
201
202
203
204
205
206
207
208acpi_status ACPI_INIT_FUNCTION acpi_initialize_objects(u32 flags)
209{
210 acpi_status status = AE_OK;
211
212 ACPI_FUNCTION_TRACE(acpi_initialize_objects);
213
214
215
216
217
218
219
220
221
222
223
224
225 acpi_ns_exec_module_code_list();
226
227
228
229
230
231
232
233 if (!(flags & ACPI_NO_OBJECT_INIT)) {
234 status = acpi_ns_initialize_objects();
235 if (ACPI_FAILURE(status)) {
236 return_ACPI_STATUS(status);
237 }
238 }
239
240
241
242
243
244 if (!(flags & (ACPI_NO_DEVICE_INIT | ACPI_NO_ADDRESS_SPACE_INIT))) {
245 status = acpi_ns_initialize_devices(flags);
246 if (ACPI_FAILURE(status)) {
247 return_ACPI_STATUS(status);
248 }
249 }
250
251
252
253
254
255
256 status = acpi_purge_cached_objects();
257
258 acpi_gbl_startup_flags |= ACPI_INITIALIZED_OK;
259 return_ACPI_STATUS(status);
260}
261
262ACPI_EXPORT_SYMBOL_INIT(acpi_initialize_objects)
263