Deleted Added
sdiff udiff text old ( 241973 ) new ( 243347 )
full compact
1/*******************************************************************************
2 *
3 * Module Name: dmresrc.c - Resource Descriptor disassembly
4 *
5 ******************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2012, Intel Corp.

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

274
275 /* Get the descriptor type and length */
276
277 ResourceType = AcpiUtGetResourceType (Aml);
278 ResourceLength = AcpiUtGetResourceLength (Aml);
279
280 /* Validate the Resource Type and Resource Length */
281
282 Status = AcpiUtValidateResource (NULL, Aml, &ResourceIndex);
283 if (ACPI_FAILURE (Status))
284 {
285 AcpiOsPrintf ("/*** Could not validate Resource, type (%X) %s***/\n",
286 ResourceType, AcpiFormatException (Status));
287 return;
288 }
289
290 /* Point to next descriptor */

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

361 }
362}
363
364
365/*******************************************************************************
366 *
367 * FUNCTION: AcpiDmIsResourceTemplate
368 *
369 * PARAMETERS: WalkState - Current walk info
370 * Op - Buffer Op to be examined
371 *
372 * RETURN: Status. AE_OK if valid template
373 *
374 * DESCRIPTION: Walk a byte list to determine if it consists of a valid set
375 * of resource descriptors. Nothing is output.
376 *
377 ******************************************************************************/
378
379ACPI_STATUS
380AcpiDmIsResourceTemplate (
381 ACPI_WALK_STATE *WalkState,
382 ACPI_PARSE_OBJECT *Op)
383{
384 ACPI_STATUS Status;
385 ACPI_PARSE_OBJECT *NextOp;
386 UINT8 *Aml;
387 UINT8 *EndAml;
388 ACPI_SIZE Length;
389
390
391 /* This op must be a buffer */
392
393 if (Op->Common.AmlOpcode != AML_BUFFER_OP)
394 {
395 return (AE_TYPE);
396 }
397
398 /* Get the ByteData list and length */
399
400 NextOp = Op->Common.Value.Arg;
401 if (!NextOp)
402 {
403 AcpiOsPrintf ("NULL byte list in buffer\n");
404 return (AE_TYPE);
405 }
406
407 NextOp = NextOp->Common.Next;
408 if (!NextOp)
409 {
410 return (AE_TYPE);
411 }
412
413 Aml = NextOp->Named.Data;
414 Length = (ACPI_SIZE) NextOp->Common.Value.Integer;
415
416 /* Walk the byte list, abort on any invalid descriptor type or length */
417
418 Status = AcpiUtWalkAmlResources (WalkState, Aml, Length, NULL, &EndAml);
419 if (ACPI_FAILURE (Status))
420 {
421 return (AE_TYPE);
422 }
423
424 /*
425 * For the resource template to be valid, one EndTag must appear
426 * at the very end of the ByteList, not before. (For proper disassembly

--- 16 unchanged lines hidden ---