Deleted Added
full compact
dsinit.c (151937) dsinit.c (167802)
1/******************************************************************************
2 *
3 * Module Name: dsinit - Object initialization namespace walk
1/******************************************************************************
2 *
3 * Module Name: dsinit - Object initialization namespace walk
4 * $Revision: 1.17 $
4 * $Revision: 1.28 $
5 *
6 *****************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
5 *
6 *****************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
12 * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp.
13 * All rights reserved.
14 *
15 * 2. License
16 *
17 * 2.1. This is your license from Intel Corp. under its intellectual property
18 * rights. You may have additional license terms from the party that provided
19 * you this software, covering your right to use that party's intellectual
20 * property rights.

--- 93 unchanged lines hidden (view full) ---

114 *
115 *****************************************************************************/
116
117#define __DSINIT_C__
118
119#include <contrib/dev/acpica/acpi.h>
120#include <contrib/dev/acpica/acdispat.h>
121#include <contrib/dev/acpica/acnamesp.h>
13 * All rights reserved.
14 *
15 * 2. License
16 *
17 * 2.1. This is your license from Intel Corp. under its intellectual property
18 * rights. You may have additional license terms from the party that provided
19 * you this software, covering your right to use that party's intellectual
20 * property rights.

--- 93 unchanged lines hidden (view full) ---

114 *
115 *****************************************************************************/
116
117#define __DSINIT_C__
118
119#include <contrib/dev/acpica/acpi.h>
120#include <contrib/dev/acpica/acdispat.h>
121#include <contrib/dev/acpica/acnamesp.h>
122#include <contrib/dev/acpica/actables.h>
122
123#define _COMPONENT ACPI_DISPATCHER
124 ACPI_MODULE_NAME ("dsinit")
125
126/* Local prototypes */
127
128static ACPI_STATUS
129AcpiDsInitOneObject (

--- 31 unchanged lines hidden (view full) ---

161 void **ReturnValue)
162{
163 ACPI_INIT_WALK_INFO *Info = (ACPI_INIT_WALK_INFO *) Context;
164 ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
165 ACPI_OBJECT_TYPE Type;
166 ACPI_STATUS Status;
167
168
123
124#define _COMPONENT ACPI_DISPATCHER
125 ACPI_MODULE_NAME ("dsinit")
126
127/* Local prototypes */
128
129static ACPI_STATUS
130AcpiDsInitOneObject (

--- 31 unchanged lines hidden (view full) ---

162 void **ReturnValue)
163{
164 ACPI_INIT_WALK_INFO *Info = (ACPI_INIT_WALK_INFO *) Context;
165 ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
166 ACPI_OBJECT_TYPE Type;
167 ACPI_STATUS Status;
168
169
169 ACPI_FUNCTION_NAME ("DsInitOneObject");
170 ACPI_FUNCTION_ENTRY ();
170
171
172 /*
173 * We are only interested in NS nodes owned by the table that
174 * was just loaded
175 */
171
172
173 /*
174 * We are only interested in NS nodes owned by the table that
175 * was just loaded
176 */
176 if (Node->OwnerId != Info->TableDesc->OwnerId)
177 if (Node->OwnerId != Info->OwnerId)
177 {
178 return (AE_OK);
179 }
180
181 Info->ObjectCount++;
182
183 /* And even then, we are only interested in a few object types */
184
185 Type = AcpiNsGetType (ObjHandle);
186
187 switch (Type)
188 {
189 case ACPI_TYPE_REGION:
190
191 Status = AcpiDsInitializeRegion (ObjHandle);
192 if (ACPI_FAILURE (Status))
193 {
178 {
179 return (AE_OK);
180 }
181
182 Info->ObjectCount++;
183
184 /* And even then, we are only interested in a few object types */
185
186 Type = AcpiNsGetType (ObjHandle);
187
188 switch (Type)
189 {
190 case ACPI_TYPE_REGION:
191
192 Status = AcpiDsInitializeRegion (ObjHandle);
193 if (ACPI_FAILURE (Status))
194 {
194 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
195 "Region %p [%4.4s] - Init failure, %s\n",
196 ObjHandle, AcpiUtGetNodeName (ObjHandle),
197 AcpiFormatException (Status)));
195 ACPI_EXCEPTION ((AE_INFO, Status,
196 "During Region initialization %p [%4.4s]",
197 ObjHandle, AcpiUtGetNodeName (ObjHandle)));
198 }
199
200 Info->OpRegionCount++;
201 break;
202
203
204 case ACPI_TYPE_METHOD:
205
198 }
199
200 Info->OpRegionCount++;
201 break;
202
203
204 case ACPI_TYPE_METHOD:
205
206 /*
207 * Print a dot for each method unless we are going to print
208 * the entire pathname
209 */
210 if (!(AcpiDbgLevel & ACPI_LV_INIT_NAMES))
211 {
212 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "."));
213 }
214
215 /*
216 * Set the execution data width (32 or 64) based upon the
217 * revision number of the parent ACPI table.
218 * TBD: This is really for possible future support of integer width
219 * on a per-table basis. Currently, we just use a global for the width.
220 */
221 if (Info->TableDesc->Pointer->Revision == 1)
222 {
223 Node->Flags |= ANOBJ_DATA_WIDTH_32;
224 }
225
226 /*
227 * Always parse methods to detect errors, we will delete
228 * the parse tree below
229 */
230 Status = AcpiDsParseMethod (ObjHandle);
231 if (ACPI_FAILURE (Status))
232 {
233 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
234 "\n+Method %p [%4.4s] - parse failure, %s\n",
235 ObjHandle, AcpiUtGetNodeName (ObjHandle),
236 AcpiFormatException (Status)));
237
238 /* This parse failed, but we will continue parsing more methods */
239 }
240
241 Info->MethodCount++;
242 break;
243
244
245 case ACPI_TYPE_DEVICE:
246
247 Info->DeviceCount++;
248 break;

--- 22 unchanged lines hidden (view full) ---

271 *
272 * DESCRIPTION: Walk the namespace starting at "StartNode" and perform any
273 * necessary initialization on the objects found therein
274 *
275 ******************************************************************************/
276
277ACPI_STATUS
278AcpiDsInitializeObjects (
206 Info->MethodCount++;
207 break;
208
209
210 case ACPI_TYPE_DEVICE:
211
212 Info->DeviceCount++;
213 break;

--- 22 unchanged lines hidden (view full) ---

236 *
237 * DESCRIPTION: Walk the namespace starting at "StartNode" and perform any
238 * necessary initialization on the objects found therein
239 *
240 ******************************************************************************/
241
242ACPI_STATUS
243AcpiDsInitializeObjects (
279 ACPI_TABLE_DESC *TableDesc,
244 ACPI_NATIVE_UINT TableIndex,
280 ACPI_NAMESPACE_NODE *StartNode)
281{
282 ACPI_STATUS Status;
283 ACPI_INIT_WALK_INFO Info;
245 ACPI_NAMESPACE_NODE *StartNode)
246{
247 ACPI_STATUS Status;
248 ACPI_INIT_WALK_INFO Info;
249 ACPI_TABLE_HEADER *Table;
250 ACPI_OWNER_ID OwnerId;
284
285
251
252
286 ACPI_FUNCTION_TRACE ("DsInitializeObjects");
253 ACPI_FUNCTION_TRACE (DsInitializeObjects);
287
288
254
255
256 Status = AcpiTbGetOwnerId (TableIndex, &OwnerId);
257 if (ACPI_FAILURE (Status))
258 {
259 return_ACPI_STATUS (Status);
260 }
261
289 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
290 "**** Starting initialization of namespace objects ****\n"));
291 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "Parsing all Control Methods:"));
292
293 Info.MethodCount = 0;
294 Info.OpRegionCount = 0;
295 Info.ObjectCount = 0;
296 Info.DeviceCount = 0;
262 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
263 "**** Starting initialization of namespace objects ****\n"));
264 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "Parsing all Control Methods:"));
265
266 Info.MethodCount = 0;
267 Info.OpRegionCount = 0;
268 Info.ObjectCount = 0;
269 Info.DeviceCount = 0;
297 Info.TableDesc = TableDesc;
270 Info.TableIndex = TableIndex;
271 Info.OwnerId = OwnerId;
298
299 /* Walk entire namespace from the supplied root */
300
301 Status = AcpiWalkNamespace (ACPI_TYPE_ANY, StartNode, ACPI_UINT32_MAX,
302 AcpiDsInitOneObject, &Info, NULL);
303 if (ACPI_FAILURE (Status))
304 {
272
273 /* Walk entire namespace from the supplied root */
274
275 Status = AcpiWalkNamespace (ACPI_TYPE_ANY, StartNode, ACPI_UINT32_MAX,
276 AcpiDsInitOneObject, &Info, NULL);
277 if (ACPI_FAILURE (Status))
278 {
305 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "WalkNamespace failed, %s\n",
306 AcpiFormatException (Status)));
279 ACPI_EXCEPTION ((AE_INFO, Status, "During WalkNamespace"));
307 }
308
280 }
281
282 Status = AcpiGetTableByIndex (TableIndex, &Table);
283 if (ACPI_FAILURE (Status))
284 {
285 return_ACPI_STATUS (Status);
286 }
287
309 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
310 "\nTable [%4.4s](id %4.4X) - %hd Objects with %hd Devices %hd Methods %hd Regions\n",
288 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
289 "\nTable [%4.4s](id %4.4X) - %hd Objects with %hd Devices %hd Methods %hd Regions\n",
311 TableDesc->Pointer->Signature, TableDesc->OwnerId, Info.ObjectCount,
290 Table->Signature, OwnerId, Info.ObjectCount,
312 Info.DeviceCount, Info.MethodCount, Info.OpRegionCount));
313
314 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
315 "%hd Methods, %hd Regions\n", Info.MethodCount, Info.OpRegionCount));
316
317 return_ACPI_STATUS (AE_OK);
318}
319
320
291 Info.DeviceCount, Info.MethodCount, Info.OpRegionCount));
292
293 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
294 "%hd Methods, %hd Regions\n", Info.MethodCount, Info.OpRegionCount));
295
296 return_ACPI_STATUS (AE_OK);
297}
298
299