Deleted Added
sdiff udiff text old ( 151937 ) new ( 167802 )
full compact
1/******************************************************************************
2 *
3 * Module Name: dsinit - Object initialization namespace walk
4 * $Revision: 1.17 $
5 *
6 *****************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999 - 2005, 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>
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
169 ACPI_FUNCTION_NAME ("DsInitOneObject");
170
171
172 /*
173 * We are only interested in NS nodes owned by the table that
174 * was just loaded
175 */
176 if (Node->OwnerId != Info->TableDesc->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 {
194 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
195 "Region %p [%4.4s] - Init failure, %s\n",
196 ObjHandle, AcpiUtGetNodeName (ObjHandle),
197 AcpiFormatException (Status)));
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 (
279 ACPI_TABLE_DESC *TableDesc,
280 ACPI_NAMESPACE_NODE *StartNode)
281{
282 ACPI_STATUS Status;
283 ACPI_INIT_WALK_INFO Info;
284
285
286 ACPI_FUNCTION_TRACE ("DsInitializeObjects");
287
288
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;
297 Info.TableDesc = TableDesc;
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 {
305 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "WalkNamespace failed, %s\n",
306 AcpiFormatException (Status)));
307 }
308
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",
311 TableDesc->Pointer->Signature, TableDesc->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