iASL: Fix some VarPackage issues.

1) properly handle constants like One,Ones,Zero. Do not make a
var_package when these are used as a package length.
2) Allow VAR_PACKAGE (in addition to PACKAGE) opcode when validating
object types for predifined names.
This commit is contained in:
Robert Moore 2011-09-16 13:11:24 -07:00
parent 5e40c31ec4
commit 858f7beecf
2 changed files with 7 additions and 2 deletions

View File

@ -833,6 +833,7 @@ OpnDoPackage (
if ((PackageLengthOp->Asl.ParseOpcode == PARSEOP_INTEGER) ||
(PackageLengthOp->Asl.ParseOpcode == PARSEOP_QWORDCONST) ||
(PackageLengthOp->Asl.ParseOpcode == PARSEOP_ZERO) ||
(PackageLengthOp->Asl.ParseOpcode == PARSEOP_DEFAULT_ARG))
{
if (!PackageLength)
@ -850,8 +851,11 @@ OpnDoPackage (
* If the PackageLength is a constant <= 255, we can change the
* AML opcode from VarPackage to a simple (ACPI 1.0) Package opcode.
*/
if ((Op->Asl.Child->Asl.ParseOpcode == PARSEOP_INTEGER) &&
(Op->Asl.Child->Asl.Value.Integer <= 255))
if (((Op->Asl.Child->Asl.ParseOpcode == PARSEOP_INTEGER) &&
(Op->Asl.Child->Asl.Value.Integer <= 255)) ||
(Op->Asl.Child->Asl.ParseOpcode == PARSEOP_ONE) ||
(Op->Asl.Child->Asl.ParseOpcode == PARSEOP_ONES)||
(Op->Asl.Child->Asl.ParseOpcode == PARSEOP_ZERO))
{
Op->Asl.AmlOpcode = AML_PACKAGE_OP;
Op->Asl.ParseOpcode = PARSEOP_PACKAGE;

View File

@ -730,6 +730,7 @@ ApCheckObjectType (
break;
case PARSEOP_PACKAGE:
case PARSEOP_VAR_PACKAGE:
ReturnBtype = ACPI_RTYPE_PACKAGE;
break;