Deleted Added
full compact
dsinit.c (151600) dsinit.c (151937)
1/******************************************************************************
2 *
3 * Module Name: dsinit - Object initialization namespace walk
1/******************************************************************************
2 *
3 * Module Name: dsinit - Object initialization namespace walk
4 * $Revision: 10 $
4 * $Revision: 1.17 $
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 - 2004, Intel Corp.
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.

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

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
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.

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

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 */
126
127
128static ACPI_STATUS
129AcpiDsInitOneObject (
130 ACPI_HANDLE ObjHandle,
131 UINT32 Level,
132 void *Context,
133 void **ReturnValue);
134
135
127/*******************************************************************************
128 *
129 * FUNCTION: AcpiDsInitOneObject
130 *
136/*******************************************************************************
137 *
138 * FUNCTION: AcpiDsInitOneObject
139 *
131 * PARAMETERS: ObjHandle - Node
140 * PARAMETERS: ObjHandle - Node for the object
132 * Level - Current nesting level
133 * Context - Points to a init info struct
134 * ReturnValue - Not used
135 *
136 * RETURN: Status
137 *
138 * DESCRIPTION: Callback from AcpiWalkNamespace. Invoked for every object
139 * within the namespace.
140 *
141 * Currently, the only objects that require initialization are:
142 * 1) Methods
143 * 2) Operation Regions
144 *
145 ******************************************************************************/
146
141 * Level - Current nesting level
142 * Context - Points to a init info struct
143 * ReturnValue - Not used
144 *
145 * RETURN: Status
146 *
147 * DESCRIPTION: Callback from AcpiWalkNamespace. Invoked for every object
148 * within the namespace.
149 *
150 * Currently, the only objects that require initialization are:
151 * 1) Methods
152 * 2) Operation Regions
153 *
154 ******************************************************************************/
155
147ACPI_STATUS
156static ACPI_STATUS
148AcpiDsInitOneObject (
149 ACPI_HANDLE ObjHandle,
150 UINT32 Level,
151 void *Context,
152 void **ReturnValue)
153{
157AcpiDsInitOneObject (
158 ACPI_HANDLE ObjHandle,
159 UINT32 Level,
160 void *Context,
161 void **ReturnValue)
162{
163 ACPI_INIT_WALK_INFO *Info = (ACPI_INIT_WALK_INFO *) Context;
164 ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
154 ACPI_OBJECT_TYPE Type;
155 ACPI_STATUS Status;
165 ACPI_OBJECT_TYPE Type;
166 ACPI_STATUS Status;
156 ACPI_INIT_WALK_INFO *Info = (ACPI_INIT_WALK_INFO *) Context;
157
158
159 ACPI_FUNCTION_NAME ("DsInitOneObject");
160
161
162 /*
167
168
169 ACPI_FUNCTION_NAME ("DsInitOneObject");
170
171
172 /*
163 * We are only interested in objects owned by the table that
173 * We are only interested in NS nodes owned by the table that
164 * was just loaded
165 */
174 * was just loaded
175 */
166 if (((ACPI_NAMESPACE_NODE *) ObjHandle)->OwnerId !=
167 Info->TableDesc->TableId)
176 if (Node->OwnerId != Info->TableDesc->OwnerId)
168 {
169 return (AE_OK);
170 }
171
172 Info->ObjectCount++;
173
174 /* And even then, we are only interested in a few object types */
175
176 Type = AcpiNsGetType (ObjHandle);
177
178 switch (Type)
179 {
180 case ACPI_TYPE_REGION:
181
182 Status = AcpiDsInitializeRegion (ObjHandle);
183 if (ACPI_FAILURE (Status))
184 {
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 {
185 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Region %p [%4.4s] - Init failure, %s\n",
194 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
195 "Region %p [%4.4s] - Init failure, %s\n",
186 ObjHandle, AcpiUtGetNodeName (ObjHandle),
187 AcpiFormatException (Status)));
188 }
189
190 Info->OpRegionCount++;
191 break;
192
193
194 case ACPI_TYPE_METHOD:
195
196 ObjHandle, AcpiUtGetNodeName (ObjHandle),
197 AcpiFormatException (Status)));
198 }
199
200 Info->OpRegionCount++;
201 break;
202
203
204 case ACPI_TYPE_METHOD:
205
196 Info->MethodCount++;
197
198 /* Print a dot for each method unless we are going to print the entire pathname */
199
206 /*
207 * Print a dot for each method unless we are going to print
208 * the entire pathname
209 */
200 if (!(AcpiDbgLevel & ACPI_LV_INIT_NAMES))
201 {
202 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "."));
203 }
204
205 /*
206 * Set the execution data width (32 or 64) based upon the
207 * revision number of the parent ACPI table.
208 * TBD: This is really for possible future support of integer width
209 * on a per-table basis. Currently, we just use a global for the width.
210 */
211 if (Info->TableDesc->Pointer->Revision == 1)
212 {
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 {
213 ((ACPI_NAMESPACE_NODE *) ObjHandle)->Flags |= ANOBJ_DATA_WIDTH_32;
223 Node->Flags |= ANOBJ_DATA_WIDTH_32;
214 }
215
216 /*
217 * Always parse methods to detect errors, we will delete
218 * the parse tree below
219 */
220 Status = AcpiDsParseMethod (ObjHandle);
221 if (ACPI_FAILURE (Status))
222 {
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 {
223 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Method %p [%4.4s] - parse failure, %s\n",
233 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
234 "\n+Method %p [%4.4s] - parse failure, %s\n",
224 ObjHandle, AcpiUtGetNodeName (ObjHandle),
225 AcpiFormatException (Status)));
226
227 /* This parse failed, but we will continue parsing more methods */
235 ObjHandle, AcpiUtGetNodeName (ObjHandle),
236 AcpiFormatException (Status)));
237
238 /* This parse failed, but we will continue parsing more methods */
228
229 break;
230 }
231
239 }
240
232 /*
233 * Delete the parse tree. We simply re-parse the method
234 * for every execution since there isn't much overhead
235 */
236 AcpiNsDeleteNamespaceSubtree (ObjHandle);
237 AcpiNsDeleteNamespaceByOwner (((ACPI_NAMESPACE_NODE *) ObjHandle)->Object->Method.OwningId);
241 Info->MethodCount++;
238 break;
239
240
241 case ACPI_TYPE_DEVICE:
242
243 Info->DeviceCount++;
244 break;
245

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

299 if (ACPI_FAILURE (Status))
300 {
301 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "WalkNamespace failed, %s\n",
302 AcpiFormatException (Status)));
303 }
304
305 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
306 "\nTable [%4.4s](id %4.4X) - %hd Objects with %hd Devices %hd Methods %hd Regions\n",
242 break;
243
244
245 case ACPI_TYPE_DEVICE:
246
247 Info->DeviceCount++;
248 break;
249

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

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",
307 TableDesc->Pointer->Signature, TableDesc->TableId, Info.ObjectCount,
311 TableDesc->Pointer->Signature, TableDesc->OwnerId, Info.ObjectCount,
308 Info.DeviceCount, Info.MethodCount, Info.OpRegionCount));
309
310 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
311 "%hd Methods, %hd Regions\n", Info.MethodCount, Info.OpRegionCount));
312
313 return_ACPI_STATUS (AE_OK);
314}
315
316
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