Deleted Added
full compact
dmresrc.c (241973) dmresrc.c (243347)
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
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 (Aml, &ResourceIndex);
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 *
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: Op - Buffer Op to be examined
369 * PARAMETERS: WalkState - Current walk info
370 * Op - Buffer Op to be examined
370 *
371 * RETURN: Status. AE_OK if valid template
372 *
373 * DESCRIPTION: Walk a byte list to determine if it consists of a valid set
374 * of resource descriptors. Nothing is output.
375 *
376 ******************************************************************************/
377
378ACPI_STATUS
379AcpiDmIsResourceTemplate (
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,
380 ACPI_PARSE_OBJECT *Op)
381{
382 ACPI_STATUS Status;
383 ACPI_PARSE_OBJECT *NextOp;
384 UINT8 *Aml;
385 UINT8 *EndAml;
386 ACPI_SIZE Length;
387
388
389 /* This op must be a buffer */
390
391 if (Op->Common.AmlOpcode != AML_BUFFER_OP)
392 {
393 return (AE_TYPE);
394 }
395
396 /* Get the ByteData list and length */
397
398 NextOp = Op->Common.Value.Arg;
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
399 NextOp = NextOp->Common.Next;
400 if (!NextOp)
401 {
402 return (AE_TYPE);
403 }
404
405 Aml = NextOp->Named.Data;
406 Length = (ACPI_SIZE) NextOp->Common.Value.Integer;
407
408 /* Walk the byte list, abort on any invalid descriptor type or length */
409
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
410 Status = AcpiUtWalkAmlResources (Aml, Length, NULL, &EndAml);
418 Status = AcpiUtWalkAmlResources (WalkState, Aml, Length, NULL, &EndAml);
411 if (ACPI_FAILURE (Status))
412 {
413 return (AE_TYPE);
414 }
415
416 /*
417 * For the resource template to be valid, one EndTag must appear
418 * at the very end of the ByteList, not before. (For proper disassembly

--- 16 unchanged lines hidden ---
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 ---