1/*******************************************************************************
2 *
3 * Module Name: nsaccess - Top-level functions for accessing ACPI namespace
4 * $Revision: 177 $
5 *
6 ******************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp.
--- 164 unchanged lines hidden (view full) ---
177
178 /* Enter the pre-defined names in the name table */
179
180 ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
181 "Entering predefined entries into namespace\n"));
182
183 for (InitVal = AcpiGbl_PreDefinedNames; InitVal->Name; InitVal++)
184 {
185 Status = AcpiNsLookup (NULL, InitVal->Name, InitVal->Type,
186 ACPI_IMODE_LOAD_PASS2, ACPI_NS_NO_UPSEARCH, NULL, &NewNode);
187
188 if (ACPI_FAILURE (Status) || (!NewNode)) /* Must be on same line for code converter */
189 {
190 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
191 "Could not create predefined name %s, %s\n",
192 InitVal->Name, AcpiFormatException (Status)));
193 }
194
195 /*
196 * Name entered successfully.
197 * If entry in PreDefinedNames[] specifies an
198 * initial value, create the initial value.
199 */
200 if (InitVal->Val)
201 {
202 Status = AcpiOsPredefinedOverride (InitVal, &Val);
203 if (ACPI_FAILURE (Status))
204 {
205 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not override predefined %s\n",
206 InitVal->Name));
207 }
208
209 if (!Val)
210 {
211 Val = InitVal->Val;
212 }
213
--- 11 unchanged lines hidden (view full) ---
225 /*
226 * Convert value string from table entry to
227 * internal representation. Only types actually
228 * used for initial values are implemented here.
229 */
230 switch (InitVal->Type)
231 {
232 case ACPI_TYPE_METHOD:
233 ObjDesc->Method.ParamCount =
234 (UINT8) ACPI_STRTOUL (Val, NULL, 10);
235 ObjDesc->Common.Flags |= AOPOBJ_DATA_VALID;
236
237#if defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
238
239 /* Compiler cheats by putting parameter count in the OwnerID */
240
241 NewNode->OwnerId = ObjDesc->Method.ParamCount;
242#endif
243 break;
244
245 case ACPI_TYPE_INTEGER:
246
247 ObjDesc->Integer.Value =
248 (ACPI_INTEGER) ACPI_STRTOUL (Val, NULL, 10);
249 break;
--- 8 unchanged lines hidden (view full) ---
258 ObjDesc->String.Pointer = Val;
259 ObjDesc->Common.Flags |= AOPOBJ_STATIC_POINTER;
260 break;
261
262
263 case ACPI_TYPE_MUTEX:
264
265 ObjDesc->Mutex.Node = NewNode;
266 ObjDesc->Mutex.SyncLevel =
267 (UINT16) ACPI_STRTOUL (Val, NULL, 10);
268
269 if (ACPI_STRCMP (InitVal->Name, "_GL_") == 0)
270 {
271 /*
272 * Create a counting semaphore for the
273 * global lock
274 */
275 Status = AcpiOsCreateSemaphore (ACPI_NO_UNIT_LIMIT,
--- 19 unchanged lines hidden (view full) ---
295 {
296 goto UnlockAndExit;
297 }
298 }
299 break;
300
301
302 default:
303 ACPI_REPORT_ERROR (("Unsupported initial type value %X\n",
304 InitVal->Type));
305 AcpiUtRemoveReference (ObjDesc);
306 ObjDesc = NULL;
307 continue;
308 }
309
310 /* Store pointer to value descriptor in the Node */
--- 413 unchanged lines hidden ---
2 *
3 * Module Name: nsaccess - Top-level functions for accessing ACPI namespace
4 * $Revision: 177 $
5 *
6 ******************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp.
--- 164 unchanged lines hidden (view full) ---
177
178 /* Enter the pre-defined names in the name table */
179
180 ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
181 "Entering predefined entries into namespace\n"));
182
183 for (InitVal = AcpiGbl_PreDefinedNames; InitVal->Name; InitVal++)
184 {
185 Status = AcpiNsLookup (NULL, InitVal->Name, InitVal->Type,
186 ACPI_IMODE_LOAD_PASS2, ACPI_NS_NO_UPSEARCH, NULL, &NewNode);
187
188 if (ACPI_FAILURE (Status) || (!NewNode)) /* Must be on same line for code converter */
189 {
190 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
191 "Could not create predefined name %s, %s\n",
192 InitVal->Name, AcpiFormatException (Status)));
193 }
194
195 /*
196 * Name entered successfully.
197 * If entry in PreDefinedNames[] specifies an
198 * initial value, create the initial value.
199 */
200 if (InitVal->Val)
201 {
202 Status = AcpiOsPredefinedOverride (InitVal, &Val);
203 if (ACPI_FAILURE (Status))
204 {
205 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not override predefined %s\n",
206 InitVal->Name));
207 }
208
209 if (!Val)
210 {
211 Val = InitVal->Val;
212 }
213
--- 11 unchanged lines hidden (view full) ---
225 /*
226 * Convert value string from table entry to
227 * internal representation. Only types actually
228 * used for initial values are implemented here.
229 */
230 switch (InitVal->Type)
231 {
232 case ACPI_TYPE_METHOD:
233 ObjDesc->Method.ParamCount =
234 (UINT8) ACPI_STRTOUL (Val, NULL, 10);
235 ObjDesc->Common.Flags |= AOPOBJ_DATA_VALID;
236
237#if defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
238
239 /* Compiler cheats by putting parameter count in the OwnerID */
240
241 NewNode->OwnerId = ObjDesc->Method.ParamCount;
242#endif
243 break;
244
245 case ACPI_TYPE_INTEGER:
246
247 ObjDesc->Integer.Value =
248 (ACPI_INTEGER) ACPI_STRTOUL (Val, NULL, 10);
249 break;
--- 8 unchanged lines hidden (view full) ---
258 ObjDesc->String.Pointer = Val;
259 ObjDesc->Common.Flags |= AOPOBJ_STATIC_POINTER;
260 break;
261
262
263 case ACPI_TYPE_MUTEX:
264
265 ObjDesc->Mutex.Node = NewNode;
266 ObjDesc->Mutex.SyncLevel =
267 (UINT16) ACPI_STRTOUL (Val, NULL, 10);
268
269 if (ACPI_STRCMP (InitVal->Name, "_GL_") == 0)
270 {
271 /*
272 * Create a counting semaphore for the
273 * global lock
274 */
275 Status = AcpiOsCreateSemaphore (ACPI_NO_UNIT_LIMIT,
--- 19 unchanged lines hidden (view full) ---
295 {
296 goto UnlockAndExit;
297 }
298 }
299 break;
300
301
302 default:
303 ACPI_REPORT_ERROR (("Unsupported initial type value %X\n",
304 InitVal->Type));
305 AcpiUtRemoveReference (ObjDesc);
306 ObjDesc = NULL;
307 continue;
308 }
309
310 /* Store pointer to value descriptor in the Node */
--- 413 unchanged lines hidden ---