diff options
author | Dana Myers <Dana.Myers@Sun.COM> | 2008-10-15 19:26:19 -0400 |
---|---|---|
committer | Dana Myers <Dana.Myers@Sun.COM> | 2008-10-15 19:26:19 -0400 |
commit | db2bae3047e71d795bde12e3baa621f4b6cc8930 (patch) | |
tree | 6f7ced35318bced4805171292ec76a5229f3e78a /usr/src/uts/intel/io/acpica/resources/rscreate.c | |
parent | 25351652d920ae27c5a56c199da581033ce763f6 (diff) | |
download | illumos-joyent-db2bae3047e71d795bde12e3baa621f4b6cc8930.tar.gz |
6464695 acpica: update to Intel ACPI CA 20080829
6747548 acpica: must check size of buffers returned from AcpiEvaluateObject()
--HG--
rename : usr/src/uts/intel/io/acpica/interpreter/dispatcher/dsfield.c => usr/src/uts/intel/io/acpica/dispatcher/dsfield.c
rename : usr/src/uts/intel/io/acpica/interpreter/dispatcher/dsinit.c => usr/src/uts/intel/io/acpica/dispatcher/dsinit.c
rename : usr/src/uts/intel/io/acpica/interpreter/dispatcher/dsmethod.c => usr/src/uts/intel/io/acpica/dispatcher/dsmethod.c
rename : usr/src/uts/intel/io/acpica/interpreter/dispatcher/dsmthdat.c => usr/src/uts/intel/io/acpica/dispatcher/dsmthdat.c
rename : usr/src/uts/intel/io/acpica/interpreter/dispatcher/dsobject.c => usr/src/uts/intel/io/acpica/dispatcher/dsobject.c
rename : usr/src/uts/intel/io/acpica/interpreter/dispatcher/dsopcode.c => usr/src/uts/intel/io/acpica/dispatcher/dsopcode.c
rename : usr/src/uts/intel/io/acpica/interpreter/dispatcher/dsutils.c => usr/src/uts/intel/io/acpica/dispatcher/dsutils.c
rename : usr/src/uts/intel/io/acpica/interpreter/dispatcher/dswexec.c => usr/src/uts/intel/io/acpica/dispatcher/dswexec.c
rename : usr/src/uts/intel/io/acpica/interpreter/dispatcher/dswload.c => usr/src/uts/intel/io/acpica/dispatcher/dswload.c
rename : usr/src/uts/intel/io/acpica/interpreter/dispatcher/dswscope.c => usr/src/uts/intel/io/acpica/dispatcher/dswscope.c
rename : usr/src/uts/intel/io/acpica/interpreter/dispatcher/dswstate.c => usr/src/uts/intel/io/acpica/dispatcher/dswstate.c
rename : usr/src/uts/intel/io/acpica/interpreter/executer/exconfig.c => usr/src/uts/intel/io/acpica/executer/exconfig.c
rename : usr/src/uts/intel/io/acpica/interpreter/executer/exconvrt.c => usr/src/uts/intel/io/acpica/executer/exconvrt.c
rename : usr/src/uts/intel/io/acpica/interpreter/executer/excreate.c => usr/src/uts/intel/io/acpica/executer/excreate.c
rename : usr/src/uts/intel/io/acpica/interpreter/executer/exdump.c => usr/src/uts/intel/io/acpica/executer/exdump.c
rename : usr/src/uts/intel/io/acpica/interpreter/executer/exfield.c => usr/src/uts/intel/io/acpica/executer/exfield.c
rename : usr/src/uts/intel/io/acpica/interpreter/executer/exfldio.c => usr/src/uts/intel/io/acpica/executer/exfldio.c
rename : usr/src/uts/intel/io/acpica/interpreter/executer/exmisc.c => usr/src/uts/intel/io/acpica/executer/exmisc.c
rename : usr/src/uts/intel/io/acpica/interpreter/executer/exmutex.c => usr/src/uts/intel/io/acpica/executer/exmutex.c
rename : usr/src/uts/intel/io/acpica/interpreter/executer/exnames.c => usr/src/uts/intel/io/acpica/executer/exnames.c
rename : usr/src/uts/intel/io/acpica/interpreter/executer/exoparg1.c => usr/src/uts/intel/io/acpica/executer/exoparg1.c
rename : usr/src/uts/intel/io/acpica/interpreter/executer/exoparg2.c => usr/src/uts/intel/io/acpica/executer/exoparg2.c
rename : usr/src/uts/intel/io/acpica/interpreter/executer/exoparg3.c => usr/src/uts/intel/io/acpica/executer/exoparg3.c
rename : usr/src/uts/intel/io/acpica/interpreter/executer/exoparg6.c => usr/src/uts/intel/io/acpica/executer/exoparg6.c
rename : usr/src/uts/intel/io/acpica/interpreter/executer/exprep.c => usr/src/uts/intel/io/acpica/executer/exprep.c
rename : usr/src/uts/intel/io/acpica/interpreter/executer/exregion.c => usr/src/uts/intel/io/acpica/executer/exregion.c
rename : usr/src/uts/intel/io/acpica/interpreter/executer/exresnte.c => usr/src/uts/intel/io/acpica/executer/exresnte.c
rename : usr/src/uts/intel/io/acpica/interpreter/executer/exresolv.c => usr/src/uts/intel/io/acpica/executer/exresolv.c
rename : usr/src/uts/intel/io/acpica/interpreter/executer/exresop.c => usr/src/uts/intel/io/acpica/executer/exresop.c
rename : usr/src/uts/intel/io/acpica/interpreter/executer/exstore.c => usr/src/uts/intel/io/acpica/executer/exstore.c
rename : usr/src/uts/intel/io/acpica/interpreter/executer/exstoren.c => usr/src/uts/intel/io/acpica/executer/exstoren.c
rename : usr/src/uts/intel/io/acpica/interpreter/executer/exstorob.c => usr/src/uts/intel/io/acpica/executer/exstorob.c
rename : usr/src/uts/intel/io/acpica/interpreter/executer/exsystem.c => usr/src/uts/intel/io/acpica/executer/exsystem.c
rename : usr/src/uts/intel/io/acpica/interpreter/executer/exutils.c => usr/src/uts/intel/io/acpica/executer/exutils.c
rename : usr/src/uts/intel/io/acpica/interpreter/parser/psargs.c => usr/src/uts/intel/io/acpica/parser/psargs.c
rename : usr/src/uts/intel/io/acpica/interpreter/parser/psloop.c => usr/src/uts/intel/io/acpica/parser/psloop.c
rename : usr/src/uts/intel/io/acpica/interpreter/parser/psopcode.c => usr/src/uts/intel/io/acpica/parser/psopcode.c
rename : usr/src/uts/intel/io/acpica/interpreter/parser/psparse.c => usr/src/uts/intel/io/acpica/parser/psparse.c
rename : usr/src/uts/intel/io/acpica/interpreter/parser/psscope.c => usr/src/uts/intel/io/acpica/parser/psscope.c
rename : usr/src/uts/intel/io/acpica/interpreter/parser/pstree.c => usr/src/uts/intel/io/acpica/parser/pstree.c
rename : usr/src/uts/intel/io/acpica/interpreter/parser/psutils.c => usr/src/uts/intel/io/acpica/parser/psutils.c
rename : usr/src/uts/intel/io/acpica/interpreter/parser/pswalk.c => usr/src/uts/intel/io/acpica/parser/pswalk.c
rename : usr/src/uts/intel/io/acpica/interpreter/parser/psxface.c => usr/src/uts/intel/io/acpica/parser/psxface.c
Diffstat (limited to 'usr/src/uts/intel/io/acpica/resources/rscreate.c')
-rw-r--r-- | usr/src/uts/intel/io/acpica/resources/rscreate.c | 65 |
1 files changed, 36 insertions, 29 deletions
diff --git a/usr/src/uts/intel/io/acpica/resources/rscreate.c b/usr/src/uts/intel/io/acpica/resources/rscreate.c index 1cb836adc7..9665fbadd6 100644 --- a/usr/src/uts/intel/io/acpica/resources/rscreate.c +++ b/usr/src/uts/intel/io/acpica/resources/rscreate.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: rscreate - Create resource lists/tables - * $Revision: 1.77 $ + * $Revision: 1.79 $ * ******************************************************************************/ @@ -9,7 +9,7 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2006, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2008, Intel Corp. * All rights reserved. * * 2. License @@ -114,12 +114,10 @@ * *****************************************************************************/ - #define __RSCREATE_C__ #include "acpi.h" #include "acresrc.h" -#include "amlcode.h" #include "acnamesp.h" #define _COMPONENT ACPI_RESOURCES @@ -271,9 +269,9 @@ AcpiRsCreatePciRoutingTable ( } /* - * Loop through the ACPI_INTERNAL_OBJECTS - Each object - * should be a package that in turn contains an - * ACPI_INTEGER Address, a UINT8 Pin, a Name and a UINT8 SourceIndex. + * Loop through the ACPI_INTERNAL_OBJECTS - Each object should be a + * package that in turn contains an ACPI_INTEGER Address, a UINT8 Pin, + * a Name, and a UINT8 SourceIndex. */ TopObjectList = PackageObject->Package.Elements; NumberOfElements = PackageObject->Package.Count; @@ -328,33 +326,44 @@ AcpiRsCreatePciRoutingTable ( /* 1) First subobject: Dereference the PRT.Address */ ObjDesc = SubObjectList[0]; - if (ACPI_GET_OBJECT_TYPE (ObjDesc) == ACPI_TYPE_INTEGER) - { - UserPrt->Address = ObjDesc->Integer.Value; - } - else + if (ACPI_GET_OBJECT_TYPE (ObjDesc) != ACPI_TYPE_INTEGER) { - ACPI_ERROR ((AE_INFO, - "(PRT[%X].Address) Need Integer, found %s", + ACPI_ERROR ((AE_INFO, "(PRT[%X].Address) Need Integer, found %s", Index, AcpiUtGetObjectTypeName (ObjDesc))); return_ACPI_STATUS (AE_BAD_DATA); } + UserPrt->Address = ObjDesc->Integer.Value; + /* 2) Second subobject: Dereference the PRT.Pin */ ObjDesc = SubObjectList[1]; - if (ACPI_GET_OBJECT_TYPE (ObjDesc) == ACPI_TYPE_INTEGER) + if (ACPI_GET_OBJECT_TYPE (ObjDesc) != ACPI_TYPE_INTEGER) { - UserPrt->Pin = (UINT32) ObjDesc->Integer.Value; - } - else - { - ACPI_ERROR ((AE_INFO, - "(PRT[%X].Pin) Need Integer, found %s", + ACPI_ERROR ((AE_INFO, "(PRT[%X].Pin) Need Integer, found %s", Index, AcpiUtGetObjectTypeName (ObjDesc))); return_ACPI_STATUS (AE_BAD_DATA); } + UserPrt->Pin = (UINT32) ObjDesc->Integer.Value; + + /* + * If the BIOS has erroneously reversed the _PRT SourceName (index 2) + * and the SourceIndex (index 3), fix it. _PRT is important enough to + * workaround this BIOS error. This also provides compatibility with + * other ACPI implementations. + */ + ObjDesc = SubObjectList[3]; + if (!ObjDesc || (ACPI_GET_OBJECT_TYPE (ObjDesc) != ACPI_TYPE_INTEGER)) + { + SubObjectList[3] = SubObjectList[2]; + SubObjectList[2] = ObjDesc; + + ACPI_WARNING ((AE_INFO, + "(PRT[%X].Source) SourceName and SourceIndex are reversed, fixed", + Index)); + } + /* * 3) Third subobject: Dereference the PRT.SourceName * The name may be unresolved (slack mode), so allow a null object @@ -366,11 +375,11 @@ AcpiRsCreatePciRoutingTable ( { case ACPI_TYPE_LOCAL_REFERENCE: - if (ObjDesc->Reference.Opcode != AML_INT_NAMEPATH_OP) + if (ObjDesc->Reference.Class != ACPI_REFCLASS_NAME) { ACPI_ERROR ((AE_INFO, - "(PRT[%X].Source) Need name, found reference op %X", - Index, ObjDesc->Reference.Opcode)); + "(PRT[%X].Source) Need name, found Reference Class %X", + Index, ObjDesc->Reference.Class)); return_ACPI_STATUS (AE_BAD_DATA); } @@ -430,11 +439,7 @@ AcpiRsCreatePciRoutingTable ( /* 4) Fourth subobject: Dereference the PRT.SourceIndex */ ObjDesc = SubObjectList[3]; - if (ACPI_GET_OBJECT_TYPE (ObjDesc) == ACPI_TYPE_INTEGER) - { - UserPrt->SourceIndex = (UINT32) ObjDesc->Integer.Value; - } - else + if (ACPI_GET_OBJECT_TYPE (ObjDesc) != ACPI_TYPE_INTEGER) { ACPI_ERROR ((AE_INFO, "(PRT[%X].SourceIndex) Need Integer, found %s", @@ -442,6 +447,8 @@ AcpiRsCreatePciRoutingTable ( return_ACPI_STATUS (AE_BAD_DATA); } + UserPrt->SourceIndex = (UINT32) ObjDesc->Integer.Value; + /* Point to the next ACPI_OPERAND_OBJECT in the top level package */ TopObjectList++; |