Sat May 5 00:12:16 2018 UTC ()
merge acpica 20180427


(christos)
diff -r1.11 -r1.12 src/sys/external/bsd/acpica/dist/compiler/aslcompiler.h
diff -r1.11 -r1.12 src/sys/external/bsd/acpica/dist/compiler/aslxref.c
diff -r1.10 -r1.11 src/sys/external/bsd/acpica/dist/compiler/aslload.c
diff -r1.20 -r1.21 src/sys/external/bsd/acpica/dist/compiler/aslutils.c
diff -r1.9 -r1.10 src/sys/external/bsd/acpica/dist/debugger/dbnames.c
diff -r1.7 -r1.8 src/sys/external/bsd/acpica/dist/debugger/dbtest.c
diff -r1.13 -r1.14 src/sys/external/bsd/acpica/dist/include/acapps.h
diff -r1.18 -r1.19 src/sys/external/bsd/acpica/dist/include/acpixf.h
diff -r1.11 -r1.12 src/sys/external/bsd/acpica/dist/resources/rsdump.c
diff -r1.12 -r1.13 src/sys/external/bsd/acpica/dist/tables/tbinstal.c
diff -r1.5 -r1.6 src/sys/external/bsd/acpica/dist/utilities/utprint.c

cvs diff -r1.11 -r1.12 src/sys/external/bsd/acpica/dist/compiler/aslcompiler.h (expand / switch to unified diff)

--- src/sys/external/bsd/acpica/dist/compiler/aslcompiler.h 2018/04/07 15:49:50 1.11
+++ src/sys/external/bsd/acpica/dist/compiler/aslcompiler.h 2018/05/05 00:12:15 1.12
@@ -1069,26 +1069,35 @@ UtDumpStringOp ( @@ -1069,26 +1069,35 @@ UtDumpStringOp (
1069 UINT32 Level); 1069 UINT32 Level);
1070 1070
1071void 1071void
1072UtDumpIntegerOp ( 1072UtDumpIntegerOp (
1073 ACPI_PARSE_OBJECT *Op, 1073 ACPI_PARSE_OBJECT *Op,
1074 UINT32 Level, 1074 UINT32 Level,
1075 UINT32 IntegerLength); 1075 UINT32 IntegerLength);
1076 1076
1077void 1077void
1078UtDumpBasicOp ( 1078UtDumpBasicOp (
1079 ACPI_PARSE_OBJECT *Op, 1079 ACPI_PARSE_OBJECT *Op,
1080 UINT32 Level); 1080 UINT32 Level);
1081 1081
 1082void *
 1083UtGetParentMethod (
 1084 ACPI_NAMESPACE_NODE *Node);
 1085
 1086BOOLEAN
 1087UtNodeIsDescendantOf (
 1088 ACPI_NAMESPACE_NODE *Node1,
 1089 ACPI_NAMESPACE_NODE *Node2);
 1090
1082void 1091void
1083UtDisplaySupportedTables ( 1092UtDisplaySupportedTables (
1084 void); 1093 void);
1085 1094
1086void 1095void
1087UtDisplayConstantOpcodes ( 1096UtDisplayConstantOpcodes (
1088 void); 1097 void);
1089 1098
1090UINT8 1099UINT8
1091UtBeginEvent ( 1100UtBeginEvent (
1092 char *Name); 1101 char *Name);
1093 1102
1094void 1103void

cvs diff -r1.11 -r1.12 src/sys/external/bsd/acpica/dist/compiler/aslxref.c (expand / switch to unified diff)

--- src/sys/external/bsd/acpica/dist/compiler/aslxref.c 2018/04/07 15:49:50 1.11
+++ src/sys/external/bsd/acpica/dist/compiler/aslxref.c 2018/05/05 00:12:15 1.12
@@ -79,42 +79,26 @@ XfCompareOneNamespaceObject ( @@ -79,42 +79,26 @@ XfCompareOneNamespaceObject (
79 ACPI_HANDLE ObjHandle, 79 ACPI_HANDLE ObjHandle,
80 UINT32 Level, 80 UINT32 Level,
81 void *Context, 81 void *Context,
82 void **ReturnValue); 82 void **ReturnValue);
83 83
84static void 84static void
85XfCheckFieldRange ( 85XfCheckFieldRange (
86 ACPI_PARSE_OBJECT *Op, 86 ACPI_PARSE_OBJECT *Op,
87 UINT32 RegionBitLength, 87 UINT32 RegionBitLength,
88 UINT32 FieldBitOffset, 88 UINT32 FieldBitOffset,
89 UINT32 FieldBitLength, 89 UINT32 FieldBitLength,
90 UINT32 AccessBitWidth); 90 UINT32 AccessBitWidth);
91 91
92#ifdef __UNDER_DEVELOPMENT 
93static ACPI_PARSE_OBJECT * 
94XfGetParentMethod ( 
95 ACPI_PARSE_OBJECT *Op); 
96 
97static void 
98XfCheckIllegalReference ( 
99 ACPI_PARSE_OBJECT *Op, 
100 ACPI_NAMESPACE_NODE *Node); 
101 
102static BOOLEAN 
103XfIsObjectParental ( 
104 ACPI_PARSE_OBJECT *MethodOp1, 
105 ACPI_PARSE_OBJECT *MethodOp2); 
106#endif 
107 
108 92
109/******************************************************************************* 93/*******************************************************************************
110 * 94 *
111 * FUNCTION: XfCrossReferenceNamespace 95 * FUNCTION: XfCrossReferenceNamespace
112 * 96 *
113 * PARAMETERS: None 97 * PARAMETERS: None
114 * 98 *
115 * RETURN: Status 99 * RETURN: Status
116 * 100 *
117 * DESCRIPTION: Perform a cross reference check of the parse tree against the 101 * DESCRIPTION: Perform a cross reference check of the parse tree against the
118 * namespace. Every named referenced within the parse tree 102 * namespace. Every named referenced within the parse tree
119 * should be get resolved with a namespace lookup. If not, the 103 * should be get resolved with a namespace lookup. If not, the
120 * original reference in the ASL code is invalid -- i.e., refers 104 * original reference in the ASL code is invalid -- i.e., refers
@@ -584,27 +568,27 @@ XfNamespaceLocateBegin ( @@ -584,27 +568,27 @@ XfNamespaceLocateBegin (
584 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, 568 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
585 "Type=%s\n", AcpiUtGetTypeName (ObjectType))); 569 "Type=%s\n", AcpiUtGetTypeName (ObjectType)));
586 570
587 /* 571 /*
588 * Lookup the name in the namespace. Name must exist at this point, or it 572 * Lookup the name in the namespace. Name must exist at this point, or it
589 * is an invalid reference. 573 * is an invalid reference.
590 * 574 *
591 * The namespace is also used as a lookup table for references to resource 575 * The namespace is also used as a lookup table for references to resource
592 * descriptors and the fields within them. 576 * descriptors and the fields within them.
593 */ 577 */
594 Gbl_NsLookupCount++; 578 Gbl_NsLookupCount++;
595 579
596 Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType, 580 Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
597 ACPI_IMODE_EXECUTE, Flags, WalkState, &(Node)); 581 ACPI_IMODE_EXECUTE, Flags, WalkState, &Node);
598 if (ACPI_FAILURE (Status)) 582 if (ACPI_FAILURE (Status))
599 { 583 {
600 if (Status == AE_NOT_FOUND) 584 if (Status == AE_NOT_FOUND)
601 { 585 {
602 /* 586 /*
603 * We didn't find the name reference by path -- we can qualify this 587 * We didn't find the name reference by path -- we can qualify this
604 * a little better before we print an error message 588 * a little better before we print an error message
605 */ 589 */
606 if (strlen (Path) == ACPI_NAME_SIZE) 590 if (strlen (Path) == ACPI_NAME_SIZE)
607 { 591 {
608 /* A simple, one-segment ACPI name */ 592 /* A simple, one-segment ACPI name */
609 593
610 if (XfObjectExists (Path)) 594 if (XfObjectExists (Path))
@@ -642,41 +626,54 @@ XfNamespaceLocateBegin ( @@ -642,41 +626,54 @@ XfNamespaceLocateBegin (
642 * can't be reached. 626 * can't be reached.
643 */ 627 */
644 AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op, 628 AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op,
645 Op->Asl.ExternalName); 629 Op->Asl.ExternalName);
646 } 630 }
647 } 631 }
648 632
649 Status = AE_OK; 633 Status = AE_OK;
650 } 634 }
651 635
652 return_ACPI_STATUS (Status); 636 return_ACPI_STATUS (Status);
653 } 637 }
654 638
 639 /* Object was found above, check for an illegal forward reference */
 640
 641 if (Op->Asl.CompileFlags & OP_NOT_FOUND_DURING_LOAD)
 642 {
 643 /*
 644 * During the load phase, this Op was flagged as a possible
 645 * illegal forward reference
 646 *
 647 * Note: Allow "forward references" from within a method to an
 648 * object that is not within any method (module-level code)
 649 */
 650 if (!WalkState->ScopeInfo || (UtGetParentMethod (Node) &&
 651 !UtNodeIsDescendantOf (WalkState->ScopeInfo->Scope.Node,
 652 UtGetParentMethod (Node))))
 653 {
 654 AslError (ASL_ERROR, ASL_MSG_ILLEGAL_FORWARD_REF, Op,
 655 Op->Asl.ExternalName);
 656 }
 657 }
 658
655 /* Check for a reference vs. name declaration */ 659 /* Check for a reference vs. name declaration */
656 660
657 if (!(OpInfo->Flags & AML_NAMED) && 661 if (!(OpInfo->Flags & AML_NAMED) &&
658 !(OpInfo->Flags & AML_CREATE)) 662 !(OpInfo->Flags & AML_CREATE))
659 { 663 {
660 /* This node has been referenced, mark it for reference check */ 664 /* This node has been referenced, mark it for reference check */
661 665
662 Node->Flags |= ANOBJ_IS_REFERENCED; 666 Node->Flags |= ANOBJ_IS_REFERENCED;
663 
664#ifdef __UNDER_DEVELOPMENT 
665 
666 /* Check for an illegal reference */ 
667 
668 XfCheckIllegalReference (Op, Node); 
669#endif 
670 } 667 }
671 668
672 /* Attempt to optimize the NamePath */ 669 /* Attempt to optimize the NamePath */
673 670
674 OptOptimizeNamePath (Op, OpInfo->Flags, WalkState, Path, Node); 671 OptOptimizeNamePath (Op, OpInfo->Flags, WalkState, Path, Node);
675 672
676 /* 673 /*
677 * 1) Dereference an alias (A name reference that is an alias) 674 * 1) Dereference an alias (A name reference that is an alias)
678 * Aliases are not nested, the alias always points to the final object 675 * Aliases are not nested, the alias always points to the final object
679 */ 676 */
680 if ((Op->Asl.ParseOpcode != PARSEOP_ALIAS) && 677 if ((Op->Asl.ParseOpcode != PARSEOP_ALIAS) &&
681 (Node->Type == ACPI_TYPE_LOCAL_ALIAS)) 678 (Node->Type == ACPI_TYPE_LOCAL_ALIAS))
682 { 679 {
@@ -1087,188 +1084,13 @@ XfNamespaceLocateEnd ( @@ -1087,188 +1084,13 @@ XfNamespaceLocateEnd (
1087 1084
1088 if (AcpiNsOpensScope (AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode))) 1085 if (AcpiNsOpensScope (AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode)))
1089 { 1086 {
1090 1087
1091 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, 1088 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
1092 "%s: Popping scope for Op %p\n", 1089 "%s: Popping scope for Op %p\n",
1093 AcpiUtGetTypeName (OpInfo->ObjectType), Op)); 1090 AcpiUtGetTypeName (OpInfo->ObjectType), Op));
1094 1091
1095 (void) AcpiDsScopeStackPop (WalkState); 1092 (void) AcpiDsScopeStackPop (WalkState);
1096 } 1093 }
1097 1094
1098 return_ACPI_STATUS (AE_OK); 1095 return_ACPI_STATUS (AE_OK);
1099} 1096}
1100 
1101 
1102#ifdef __UNDER_DEVELOPMENT 
1103/******************************************************************************* 
1104 * 
1105 * FUNCTION: XfIsObjectParental 
1106 * 
1107 * PARAMETERS: ChildOp - Op to be checked 
1108 * PossibleParentOp - Determine if this op is in the family 
1109 * 
1110 * RETURN: TRUE if ChildOp is a descendent of PossibleParentOp 
1111 * 
1112 * DESCRIPTION: Determine if an Op is a descendent of another Op. Used to 
1113 * detect if a method is declared within another method. 
1114 * 
1115 ******************************************************************************/ 
1116 
1117static BOOLEAN 
1118XfIsObjectParental ( 
1119 ACPI_PARSE_OBJECT *ChildOp, 
1120 ACPI_PARSE_OBJECT *PossibleParentOp) 
1121{ 
1122 ACPI_PARSE_OBJECT *ParentOp; 
1123 
1124 
1125 /* Search upwards through the tree for possible parent */ 
1126 
1127 ParentOp = ChildOp; 
1128 while (ParentOp) 
1129 { 
1130 if (ParentOp == PossibleParentOp) 
1131 { 
1132 return (TRUE); 
1133 } 
1134 
1135 ParentOp = ParentOp->Asl.Parent; 
1136 } 
1137 
1138 return (FALSE); 
1139} 
1140 
1141 
1142/******************************************************************************* 
1143 * 
1144 * FUNCTION: XfGetParentMethod 
1145 * 
1146 * PARAMETERS: Op - Op to be checked 
1147 * 
1148 * RETURN: Op for parent method. NULL if object is not within a method. 
1149 * 
1150 * DESCRIPTION: Determine if an object is within a control method. Used to 
1151 * implement special rules for named references from within a 
1152 * control method. 
1153 * 
1154 * NOTE: It would be better to have the parser set a flag in the Op if possible. 
1155 * 
1156 ******************************************************************************/ 
1157 
1158static ACPI_PARSE_OBJECT * 
1159XfGetParentMethod ( 
1160 ACPI_PARSE_OBJECT *Op) 
1161{ 
1162 ACPI_PARSE_OBJECT *ParentOp; 
1163 
1164 
1165 if (!Op) 
1166 { 
1167 return (NULL); 
1168 } 
1169 
1170 if (Op->Asl.ParseOpcode == PARSEOP_METHOD) 
1171 { 
1172 return (NULL); 
1173 } 
1174 
1175 /* Walk upwards through the parse tree, up to the root if necessary */ 
1176 
1177 ParentOp = Op; 
1178 while (ParentOp) 
1179 { 
1180 if (ParentOp->Asl.ParseOpcode == PARSEOP_METHOD) 
1181 { 
1182 return (ParentOp); 
1183 } 
1184 
1185 ParentOp = ParentOp->Asl.Parent; 
1186 } 
1187 
1188 /* Object is not within a method */ 
1189 
1190 return (NULL); 
1191} 
1192 
1193 
1194/******************************************************************************* 
1195 * 
1196 * FUNCTION: XfCheckIllegalReference 
1197 * 
1198 * PARAMETERS: Op - Op referring to the target 
1199 * TargetNode - Target of the reference 
1200 * 
1201 * RETURN: None. Emits error message for an illegal reference 
1202 * 
1203 * DESCRIPTION: Determine if a named reference is legal. A "named" reference 
1204 * is something like: Store(ABCD, ...), where ABCD is an AML 
1205 * Nameseg or Namepath. 
1206 * 
1207 * NOTE: Caller must ensure that the name Op is in fact a reference, and not 
1208 * an actual name declaration (creation of a named object). 
1209 * 
1210 ******************************************************************************/ 
1211 
1212static void 
1213XfCheckIllegalReference ( 
1214 ACPI_PARSE_OBJECT *Op, 
1215 ACPI_NAMESPACE_NODE *TargetNode) 
1216{ 
1217 ACPI_PARSE_OBJECT *MethodOp1; 
1218 ACPI_PARSE_OBJECT *MethodOp2; 
1219 ACPI_PARSE_OBJECT *TargetOp; 
1220 
1221 
1222 /* 
1223 * Check for an illegal reference to a named object: 
1224 * 
1225 * 1) References from one control method to another, non-parent 
1226 * method are not allowed, they will fail at runtime. 
1227 * 
1228 * 2) Forward references within a control method are not allowed. 
1229 * AML interpreters use a one-pass parse of control methods 
1230 * so these forward references will fail at runtime. 
1231 */ 
1232 TargetOp = TargetNode->Op; 
1233 
1234 MethodOp1 = XfGetParentMethod (Op); 
1235 MethodOp2 = XfGetParentMethod (TargetOp); 
1236 
1237 /* Are both objects within control method(s)? */ 
1238 
1239 if (!MethodOp1 || !MethodOp2) 
1240 { 
1241 return; 
1242 } 
1243 
1244 /* Objects not in the same method? */ 
1245 
1246 if (MethodOp1 != MethodOp2) 
1247 { 
1248 /* 
1249 * 1) Cross-method named reference 
1250 * 
1251 * This is OK if and only if the target reference is within in a 
1252 * method that is a parent of current method 
1253 */ 
1254 if (!XfIsObjectParental (MethodOp1, MethodOp2)) 
1255 { 
1256 AslError (ASL_ERROR, ASL_MSG_ILLEGAL_METHOD_REF, Op, 
1257 Op->Asl.ExternalName); 
1258 } 
1259 } 
1260 
1261 /* 
1262 * 2) Both reference and target are in the same method. Check if this is 
1263 * an (illegal) forward reference by examining the exact source code 
1264 * location of each (the referenced object and the object declaration). 
1265 * This is a bit nasty, yet effective. 
1266 */ 
1267 else if (Op->Asl.LogicalByteOffset < TargetOp->Asl.LogicalByteOffset) 
1268 { 
1269 AslError (ASL_ERROR, ASL_MSG_ILLEGAL_FORWARD_REF, Op, 
1270 Op->Asl.ExternalName); 
1271 } 
1272 
1273} 
1274#endif 

cvs diff -r1.10 -r1.11 src/sys/external/bsd/acpica/dist/compiler/aslload.c (expand / switch to unified diff)

--- src/sys/external/bsd/acpica/dist/compiler/aslload.c 2018/04/07 15:49:50 1.10
+++ src/sys/external/bsd/acpica/dist/compiler/aslload.c 2018/05/05 00:12:15 1.11
@@ -35,29 +35,30 @@ @@ -35,29 +35,30 @@
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44#include "aslcompiler.h" 44#include "aslcompiler.h"
45#include "amlcode.h" 45#include "amlcode.h"
46#include "acdispat.h" 46#include "acdispat.h"
47#include "acnamesp.h" 47#include "acnamesp.h"
48 48#include "acparser.h"
49#include "aslcompiler.y.h" 49#include "aslcompiler.y.h"
50 50
 51
51#define _COMPONENT ACPI_COMPILER 52#define _COMPONENT ACPI_COMPILER
52 ACPI_MODULE_NAME ("aslload") 53 ACPI_MODULE_NAME ("aslload")
53 54
54/* Local prototypes */ 55/* Local prototypes */
55 56
56static ACPI_STATUS 57static ACPI_STATUS
57LdLoadFieldElements ( 58LdLoadFieldElements (
58 ACPI_PARSE_OBJECT *Op, 59 ACPI_PARSE_OBJECT *Op,
59 ACPI_WALK_STATE *WalkState); 60 ACPI_WALK_STATE *WalkState);
60 61
61static ACPI_STATUS 62static ACPI_STATUS
62LdLoadResourceElements ( 63LdLoadResourceElements (
63 ACPI_PARSE_OBJECT *Op, 64 ACPI_PARSE_OBJECT *Op,
@@ -352,29 +353,33 @@ LdNamespace1Begin ( @@ -352,29 +353,33 @@ LdNamespace1Begin (
352{ 353{
353 ACPI_WALK_STATE *WalkState = (ACPI_WALK_STATE *) Context; 354 ACPI_WALK_STATE *WalkState = (ACPI_WALK_STATE *) Context;
354 ACPI_NAMESPACE_NODE *Node; 355 ACPI_NAMESPACE_NODE *Node;
355 ACPI_PARSE_OBJECT *MethodOp; 356 ACPI_PARSE_OBJECT *MethodOp;
356 ACPI_STATUS Status; 357 ACPI_STATUS Status;
357 ACPI_OBJECT_TYPE ObjectType; 358 ACPI_OBJECT_TYPE ObjectType;
358 ACPI_OBJECT_TYPE ActualObjectType = ACPI_TYPE_ANY; 359 ACPI_OBJECT_TYPE ActualObjectType = ACPI_TYPE_ANY;
359 char *Path; 360 char *Path;
360 UINT32 Flags = ACPI_NS_NO_UPSEARCH; 361 UINT32 Flags = ACPI_NS_NO_UPSEARCH;
361 ACPI_PARSE_OBJECT *Arg; 362 ACPI_PARSE_OBJECT *Arg;
362 UINT32 i; 363 UINT32 i;
363 BOOLEAN ForceNewScope = FALSE; 364 BOOLEAN ForceNewScope = FALSE;
364 ACPI_OWNER_ID OwnerId = 0; 365 ACPI_OWNER_ID OwnerId = 0;
 366 const ACPI_OPCODE_INFO *OpInfo;
 367 ACPI_PARSE_OBJECT *ParentOp;
365 368
366 369
367 ACPI_FUNCTION_NAME (LdNamespace1Begin); 370 ACPI_FUNCTION_NAME (LdNamespace1Begin);
 371
 372
368 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op %p [%s]\n", 373 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op %p [%s]\n",
369 Op, Op->Asl.ParseOpName)); 374 Op, Op->Asl.ParseOpName));
370 375
371 if (Op->Asl.ParseOpcode == PARSEOP_DEFINITION_BLOCK) 376 if (Op->Asl.ParseOpcode == PARSEOP_DEFINITION_BLOCK)
372 { 377 {
373 /* 378 /*
374 * Allocate an OwnerId for this block. This helps identify the owners 379 * Allocate an OwnerId for this block. This helps identify the owners
375 * of each namespace node. This is used in determining whether if 380 * of each namespace node. This is used in determining whether if
376 * certain external declarations cause redefinition errors. 381 * certain external declarations cause redefinition errors.
377 */ 382 */
378 Status = AcpiUtAllocateOwnerId (&OwnerId); 383 Status = AcpiUtAllocateOwnerId (&OwnerId);
379 WalkState->OwnerId = OwnerId; 384 WalkState->OwnerId = OwnerId;
380 if (ACPI_FAILURE (Status)) 385 if (ACPI_FAILURE (Status))
@@ -430,26 +435,89 @@ LdNamespace1Begin ( @@ -430,26 +435,89 @@ LdNamespace1Begin (
430 435
431 /* All other opcodes go below */ 436 /* All other opcodes go below */
432 437
433 break; 438 break;
434 } 439 }
435 440
436 /* Check if this object has already been installed in the namespace */ 441 /* Check if this object has already been installed in the namespace */
437 442
438 if (Op->Asl.Node) 443 if (Op->Asl.Node)
439 { 444 {
440 return (AE_OK); 445 return (AE_OK);
441 } 446 }
442 447
 448 /* Check for a possible illegal forward reference */
 449
 450 if ((Op->Asl.ParseOpcode == PARSEOP_NAMESEG) ||
 451 (Op->Asl.ParseOpcode == PARSEOP_NAMESTRING))
 452 {
 453 /*
 454 * Op->Asl.Namepath will be NULL for these opcodes.
 455 * These opcodes are guaranteed to have a parent.
 456 * Examine the parent opcode.
 457 */
 458 Status = AE_OK;
 459 ParentOp = Op->Asl.Parent;
 460 OpInfo = AcpiPsGetOpcodeInfo (ParentOp->Asl.AmlOpcode);
 461
 462 /*
 463 * Exclude all operators that actually declare a new name:
 464 * Name (ABCD, 1) -> Ignore (AML_CLASS_NAMED_OBJECT)
 465 * We only want references to named objects:
 466 * Store (2, WXYZ) -> Attempt to resolve the name
 467 */
 468 if (OpInfo->Class == AML_CLASS_NAMED_OBJECT)
 469 {
 470 return (AE_OK);
 471 }
 472
 473 /*
 474 * Check if the referenced object exists at this point during
 475 * the load:
 476 * 1) If it exists, then this cannot be a forward reference.
 477 * 2) If it does not exist, it could be a forward reference or
 478 * it truly does not exist (and no external declaration).
 479 */
 480 Status = AcpiNsLookup (WalkState->ScopeInfo,
 481 Op->Asl.Value.Name, ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
 482 ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
 483 WalkState, &Node);
 484 if (Status == AE_NOT_FOUND)
 485 {
 486 /*
 487 * This is either a foward reference or the object truly
 488 * does not exist. The two cases can only be differentiated
 489 * during the cross-reference stage later. Mark the Op/Name
 490 * as not-found for now to indicate the need for further
 491 * processing.
 492 *
 493 * Special case: Allow forward references from elements of
 494 * Package objects. This provides compatibility with other
 495 * ACPI implementations. To correctly implement this, the
 496 * ACPICA table load defers package resolution until the entire
 497 * namespace has been loaded.
 498 */
 499 if ((ParentOp->Asl.ParseOpcode != PARSEOP_PACKAGE) &&
 500 (ParentOp->Asl.ParseOpcode != PARSEOP_VAR_PACKAGE))
 501 {
 502 Op->Asl.CompileFlags |= OP_NOT_FOUND_DURING_LOAD;
 503 }
 504
 505 return (AE_OK);
 506 }
 507
 508 return (Status);
 509 }
 510
443 Path = Op->Asl.Namepath; 511 Path = Op->Asl.Namepath;
444 if (!Path) 512 if (!Path)
445 { 513 {
446 return (AE_OK); 514 return (AE_OK);
447 } 515 }
448 516
449 /* Map the raw opcode into an internal object type */ 517 /* Map the raw opcode into an internal object type */
450 518
451 switch (Op->Asl.ParseOpcode) 519 switch (Op->Asl.ParseOpcode)
452 { 520 {
453 case PARSEOP_NAME: 521 case PARSEOP_NAME:
454 522
455 Arg = Op->Asl.Child; /* Get the NameSeg/NameString node */ 523 Arg = Op->Asl.Child; /* Get the NameSeg/NameString node */
@@ -466,27 +534,26 @@ LdNamespace1Begin ( @@ -466,27 +534,26 @@ LdNamespace1Begin (
466 } 534 }
467 535
468 /* Get the data type associated with the named object, not the name itself */ 536 /* Get the data type associated with the named object, not the name itself */
469 537
470 /* Log2 loop to convert from Btype (binary) to Etype (encoded) */ 538 /* Log2 loop to convert from Btype (binary) to Etype (encoded) */
471 539
472 ObjectType = 1; 540 ObjectType = 1;
473 for (i = 1; i < Arg->Asl.AcpiBtype; i *= 2) 541 for (i = 1; i < Arg->Asl.AcpiBtype; i *= 2)
474 { 542 {
475 ObjectType++; 543 ObjectType++;
476 } 544 }
477 break; 545 break;
478 546
479 
480 case PARSEOP_EXTERNAL: 547 case PARSEOP_EXTERNAL:
481 /* 548 /*
482 * "External" simply enters a name and type into the namespace. 549 * "External" simply enters a name and type into the namespace.
483 * We must be careful to not open a new scope, however, no matter 550 * We must be careful to not open a new scope, however, no matter
484 * what type the external name refers to (e.g., a method) 551 * what type the external name refers to (e.g., a method)
485 * 552 *
486 * first child is name, next child is ObjectType 553 * first child is name, next child is ObjectType
487 */ 554 */
488 ActualObjectType = (UINT8) Op->Asl.Child->Asl.Next->Asl.Value.Integer; 555 ActualObjectType = (UINT8) Op->Asl.Child->Asl.Next->Asl.Value.Integer;
489 ObjectType = ACPI_TYPE_ANY; 556 ObjectType = ACPI_TYPE_ANY;
490 557
491 /* 558 /*
492 * We will mark every new node along the path as "External". This 559 * We will mark every new node along the path as "External". This
@@ -648,27 +715,26 @@ LdNamespace1Begin ( @@ -648,27 +715,26 @@ LdNamespace1Begin (
648 Node->Type = ACPI_TYPE_LOCAL_SCOPE; 715 Node->Type = ACPI_TYPE_LOCAL_SCOPE;
649 Status = AcpiDsScopeStackPush (Node, ACPI_TYPE_LOCAL_SCOPE, 716 Status = AcpiDsScopeStackPush (Node, ACPI_TYPE_LOCAL_SCOPE,
650 WalkState); 717 WalkState);
651 if (ACPI_FAILURE (Status)) 718 if (ACPI_FAILURE (Status))
652 { 719 {
653 return_ACPI_STATUS (Status); 720 return_ACPI_STATUS (Status);
654 } 721 }
655 break; 722 break;
656 } 723 }
657 724
658 Status = AE_OK; 725 Status = AE_OK;
659 goto FinishNode; 726 goto FinishNode;
660 727
661 
662 default: 728 default:
663 729
664 ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode); 730 ObjectType = AslMapNamedOpcodeToDataType (Op->Asl.AmlOpcode);
665 break; 731 break;
666 } 732 }
667 733
668 734
669 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Loading name: %s, (%s)\n", 735 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Loading name: %s, (%s)\n",
670 Op->Asl.ExternalName, AcpiUtGetTypeName (ObjectType))); 736 Op->Asl.ExternalName, AcpiUtGetTypeName (ObjectType)));
671 737
672 /* The name must not already exist */ 738 /* The name must not already exist */
673 739
674 Flags |= ACPI_NS_ERROR_IF_FOUND; 740 Flags |= ACPI_NS_ERROR_IF_FOUND;

cvs diff -r1.20 -r1.21 src/sys/external/bsd/acpica/dist/compiler/aslutils.c (expand / switch to unified diff)

--- src/sys/external/bsd/acpica/dist/compiler/aslutils.c 2018/04/07 15:49:50 1.20
+++ src/sys/external/bsd/acpica/dist/compiler/aslutils.c 2018/05/05 00:12:15 1.21
@@ -120,26 +120,117 @@ UtQueryForOverwrite ( @@ -120,26 +120,117 @@ UtQueryForOverwrite (
120 120
121 if (getchar () != 'y') 121 if (getchar () != 'y')
122 { 122 {
123 return (FALSE); 123 return (FALSE);
124 } 124 }
125 } 125 }
126 126
127 return (TRUE); 127 return (TRUE);
128} 128}
129 129
130 130
131/******************************************************************************* 131/*******************************************************************************
132 * 132 *
 133 * FUNCTION: UtNodeIsDescendantOf
 134 *
 135 * PARAMETERS: Node1 - Child node
 136 * Node2 - Possible parent node
 137 *
 138 * RETURN: Boolean
 139 *
 140 * DESCRIPTION: Returns TRUE if Node1 is a descendant of Node2. Otherwise,
 141 * return FALSE. Note, we assume a NULL Node2 element to be the
 142 * topmost (root) scope. All nodes are descendants of the root.
 143 * Note: Nodes at the same level (siblings) are not considered
 144 * descendants.
 145 *
 146 ******************************************************************************/
 147
 148BOOLEAN
 149UtNodeIsDescendantOf (
 150 ACPI_NAMESPACE_NODE *Node1,
 151 ACPI_NAMESPACE_NODE *Node2)
 152{
 153
 154 if (Node1 == Node2)
 155 {
 156 return (FALSE);
 157 }
 158
 159 if (!Node2)
 160 {
 161 return (TRUE); /* All nodes descend from the root */
 162 }
 163
 164 /* Walk upward until the root is reached or parent is found */
 165
 166 while (Node1)
 167 {
 168 if (Node1 == Node2)
 169 {
 170 return (TRUE);
 171 }
 172
 173 Node1 = Node1->Parent;
 174 }
 175
 176 return (FALSE);
 177}
 178
 179
 180/*******************************************************************************
 181 *
 182 * FUNCTION: UtGetParentMethod
 183 *
 184 * PARAMETERS: Node - Namespace node for any object
 185 *
 186 * RETURN: Namespace node for the parent method
 187 * NULL - object is not within a method
 188 *
 189 * DESCRIPTION: Find the parent (owning) method node for a namespace object
 190 *
 191 ******************************************************************************/
 192
 193void *
 194UtGetParentMethod (
 195 ACPI_NAMESPACE_NODE *Node)
 196{
 197 ACPI_NAMESPACE_NODE *ParentNode;
 198
 199
 200 if (!Node)
 201 {
 202 return (NULL);
 203 }
 204
 205 /* Walk upward until a method is found, or the root is reached */
 206
 207 ParentNode = Node->Parent;
 208 while (ParentNode)
 209 {
 210 if (ParentNode->Type == ACPI_TYPE_METHOD)
 211 {
 212 return (ParentNode);
 213 }
 214
 215 ParentNode = ParentNode->Parent;
 216 }
 217
 218 return (NULL); /* Object is not within a control method */
 219}
 220
 221
 222/*******************************************************************************
 223 *
133 * FUNCTION: UtDisplaySupportedTables 224 * FUNCTION: UtDisplaySupportedTables
134 * 225 *
135 * PARAMETERS: None 226 * PARAMETERS: None
136 * 227 *
137 * RETURN: None 228 * RETURN: None
138 * 229 *
139 * DESCRIPTION: Print all supported ACPI table names. 230 * DESCRIPTION: Print all supported ACPI table names.
140 * 231 *
141 ******************************************************************************/ 232 ******************************************************************************/
142 233
143void 234void
144UtDisplaySupportedTables ( 235UtDisplaySupportedTables (
145 void) 236 void)

cvs diff -r1.9 -r1.10 src/sys/external/bsd/acpica/dist/debugger/dbnames.c (expand / switch to unified diff)

--- src/sys/external/bsd/acpica/dist/debugger/dbnames.c 2018/04/07 15:49:50 1.9
+++ src/sys/external/bsd/acpica/dist/debugger/dbnames.c 2018/05/05 00:12:15 1.10
@@ -254,28 +254,37 @@ AcpiDbDumpNamespace ( @@ -254,28 +254,37 @@ AcpiDbDumpNamespace (
254 { 254 {
255 return; 255 return;
256 } 256 }
257 257
258 /* Now we can check for the depth argument */ 258 /* Now we can check for the depth argument */
259 259
260 if (DepthArg) 260 if (DepthArg)
261 { 261 {
262 MaxDepth = strtoul (DepthArg, NULL, 0); 262 MaxDepth = strtoul (DepthArg, NULL, 0);
263 } 263 }
264 } 264 }
265 265
266 AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT); 266 AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT);
267 AcpiOsPrintf ("ACPI Namespace (from %4.4s (%p) subtree):\n", 267
268 ((ACPI_NAMESPACE_NODE *) SubtreeEntry)->Name.Ascii, SubtreeEntry); 268 if (((ACPI_NAMESPACE_NODE *) SubtreeEntry)->Parent)
 269 {
 270 AcpiOsPrintf ("ACPI Namespace (from %4.4s (%p) subtree):\n",
 271 ((ACPI_NAMESPACE_NODE *) SubtreeEntry)->Name.Ascii, SubtreeEntry);
 272 }
 273 else
 274 {
 275 AcpiOsPrintf ("ACPI Namespace (from %s):\n",
 276 ACPI_NAMESPACE_ROOT);
 277 }
269 278
270 /* Display the subtree */ 279 /* Display the subtree */
271 280
272 AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT); 281 AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
273 AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, MaxDepth, 282 AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, MaxDepth,
274 ACPI_OWNER_ID_MAX, SubtreeEntry); 283 ACPI_OWNER_ID_MAX, SubtreeEntry);
275 AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT); 284 AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
276} 285}
277 286
278 287
279/******************************************************************************* 288/*******************************************************************************
280 * 289 *
281 * FUNCTION: AcpiDbDumpNamespacePaths 290 * FUNCTION: AcpiDbDumpNamespacePaths

cvs diff -r1.7 -r1.8 src/sys/external/bsd/acpica/dist/debugger/dbtest.c (expand / switch to unified diff)

--- src/sys/external/bsd/acpica/dist/debugger/dbtest.c 2018/04/07 15:49:50 1.7
+++ src/sys/external/bsd/acpica/dist/debugger/dbtest.c 2018/05/05 00:12:15 1.8
@@ -71,26 +71,30 @@ AcpiDbTestIntegerType ( @@ -71,26 +71,30 @@ AcpiDbTestIntegerType (
71 UINT32 BitLength); 71 UINT32 BitLength);
72 72
73static ACPI_STATUS 73static ACPI_STATUS
74AcpiDbTestBufferType ( 74AcpiDbTestBufferType (
75 ACPI_NAMESPACE_NODE *Node, 75 ACPI_NAMESPACE_NODE *Node,
76 UINT32 BitLength); 76 UINT32 BitLength);
77 77
78static ACPI_STATUS 78static ACPI_STATUS
79AcpiDbTestStringType ( 79AcpiDbTestStringType (
80 ACPI_NAMESPACE_NODE *Node, 80 ACPI_NAMESPACE_NODE *Node,
81 UINT32 ByteLength); 81 UINT32 ByteLength);
82 82
83static ACPI_STATUS 83static ACPI_STATUS
 84AcpiDbTestPackageType (
 85 ACPI_NAMESPACE_NODE *Node);
 86
 87static ACPI_STATUS
84AcpiDbReadFromObject ( 88AcpiDbReadFromObject (
85 ACPI_NAMESPACE_NODE *Node, 89 ACPI_NAMESPACE_NODE *Node,
86 ACPI_OBJECT_TYPE ExpectedType, 90 ACPI_OBJECT_TYPE ExpectedType,
87 ACPI_OBJECT **Value); 91 ACPI_OBJECT **Value);
88 92
89static ACPI_STATUS 93static ACPI_STATUS
90AcpiDbWriteToObject ( 94AcpiDbWriteToObject (
91 ACPI_NAMESPACE_NODE *Node, 95 ACPI_NAMESPACE_NODE *Node,
92 ACPI_OBJECT *Value); 96 ACPI_OBJECT *Value);
93 97
94static void 98static void
95AcpiDbEvaluateAllPredefinedNames ( 99AcpiDbEvaluateAllPredefinedNames (
96 char *CountArg); 100 char *CountArg);
@@ -338,26 +342,31 @@ AcpiDbTestOneObject ( @@ -338,26 +342,31 @@ AcpiDbTestOneObject (
338 case ACPI_TYPE_STRING: 342 case ACPI_TYPE_STRING:
339 343
340 LocalType = ACPI_TYPE_STRING; 344 LocalType = ACPI_TYPE_STRING;
341 ByteLength = ObjDesc->String.Length; 345 ByteLength = ObjDesc->String.Length;
342 break; 346 break;
343 347
344 case ACPI_TYPE_BUFFER: 348 case ACPI_TYPE_BUFFER:
345 349
346 LocalType = ACPI_TYPE_BUFFER; 350 LocalType = ACPI_TYPE_BUFFER;
347 ByteLength = ObjDesc->Buffer.Length; 351 ByteLength = ObjDesc->Buffer.Length;
348 BitLength = ByteLength * 8; 352 BitLength = ByteLength * 8;
349 break; 353 break;
350 354
 355 case ACPI_TYPE_PACKAGE:
 356
 357 LocalType = ACPI_TYPE_PACKAGE;
 358 break;
 359
351 case ACPI_TYPE_FIELD_UNIT: 360 case ACPI_TYPE_FIELD_UNIT:
352 case ACPI_TYPE_BUFFER_FIELD: 361 case ACPI_TYPE_BUFFER_FIELD:
353 case ACPI_TYPE_LOCAL_REGION_FIELD: 362 case ACPI_TYPE_LOCAL_REGION_FIELD:
354 case ACPI_TYPE_LOCAL_INDEX_FIELD: 363 case ACPI_TYPE_LOCAL_INDEX_FIELD:
355 case ACPI_TYPE_LOCAL_BANK_FIELD: 364 case ACPI_TYPE_LOCAL_BANK_FIELD:
356 365
357 LocalType = ACPI_TYPE_INTEGER; 366 LocalType = ACPI_TYPE_INTEGER;
358 if (ObjDesc) 367 if (ObjDesc)
359 { 368 {
360 /* 369 /*
361 * Returned object will be a Buffer if the field length 370 * Returned object will be a Buffer if the field length
362 * is larger than the size of an Integer (32 or 64 bits 371 * is larger than the size of an Integer (32 or 64 bits
363 * depending on the DSDT version). 372 * depending on the DSDT version).
@@ -372,53 +381,53 @@ AcpiDbTestOneObject ( @@ -372,53 +381,53 @@ AcpiDbTestOneObject (
372 break; 381 break;
373 382
374 default: 383 default:
375 384
376 /* Ignore all other types */ 385 /* Ignore all other types */
377 386
378 return (AE_OK); 387 return (AE_OK);
379 } 388 }
380 389
381 /* Emit the common prefix: Type:Name */ 390 /* Emit the common prefix: Type:Name */
382 391
383 AcpiOsPrintf ("%14s: %4.4s", 392 AcpiOsPrintf ("%14s: %4.4s",
384 AcpiUtGetTypeName (Node->Type), Node->Name.Ascii); 393 AcpiUtGetTypeName (Node->Type), Node->Name.Ascii);
 394
385 if (!ObjDesc) 395 if (!ObjDesc)
386 { 396 {
387 AcpiOsPrintf (" Ignoring, no attached object\n"); 397 AcpiOsPrintf (" Ignoring, no attached object\n");
388 return (AE_OK); 398 return (AE_OK);
389 } 399 }
390 400
391 /* 401 /*
392 * Check for unsupported region types. Note: AcpiExec simulates 402 * Check for unsupported region types. Note: AcpiExec simulates
393 * access to SystemMemory, SystemIO, PCI_Config, and EC. 403 * access to SystemMemory, SystemIO, PCI_Config, and EC.
394 */ 404 */
395 switch (Node->Type) 405 switch (Node->Type)
396 { 406 {
397 case ACPI_TYPE_LOCAL_REGION_FIELD: 407 case ACPI_TYPE_LOCAL_REGION_FIELD:
398 408
399 RegionObj = ObjDesc->Field.RegionObj; 409 RegionObj = ObjDesc->Field.RegionObj;
400 switch (RegionObj->Region.SpaceId) 410 switch (RegionObj->Region.SpaceId)
401 { 411 {
402 case ACPI_ADR_SPACE_SYSTEM_MEMORY: 412 case ACPI_ADR_SPACE_SYSTEM_MEMORY:
403 case ACPI_ADR_SPACE_SYSTEM_IO: 413 case ACPI_ADR_SPACE_SYSTEM_IO:
404 case ACPI_ADR_SPACE_PCI_CONFIG: 414 case ACPI_ADR_SPACE_PCI_CONFIG:
405 case ACPI_ADR_SPACE_EC: 
406 415
407 break; 416 break;
408 417
409 default: 418 default:
410 419
411 AcpiOsPrintf (" %s space is not supported [%4.4s]\n", 420 AcpiOsPrintf (" %s space is not supported in this command [%4.4s]\n",
412 AcpiUtGetRegionName (RegionObj->Region.SpaceId), 421 AcpiUtGetRegionName (RegionObj->Region.SpaceId),
413 RegionObj->Region.Node->Name.Ascii); 422 RegionObj->Region.Node->Name.Ascii);
414 return (AE_OK); 423 return (AE_OK);
415 } 424 }
416 break; 425 break;
417 426
418 default: 427 default:
419 break; 428 break;
420 } 429 }
421 430
422 /* At this point, we have resolved the object to one of the major types */ 431 /* At this point, we have resolved the object to one of the major types */
423 432
424 switch (LocalType) 433 switch (LocalType)
@@ -428,46 +437,61 @@ AcpiDbTestOneObject ( @@ -428,46 +437,61 @@ AcpiDbTestOneObject (
428 Status = AcpiDbTestIntegerType (Node, BitLength); 437 Status = AcpiDbTestIntegerType (Node, BitLength);
429 break; 438 break;
430 439
431 case ACPI_TYPE_STRING: 440 case ACPI_TYPE_STRING:
432 441
433 Status = AcpiDbTestStringType (Node, ByteLength); 442 Status = AcpiDbTestStringType (Node, ByteLength);
434 break; 443 break;
435 444
436 case ACPI_TYPE_BUFFER: 445 case ACPI_TYPE_BUFFER:
437 446
438 Status = AcpiDbTestBufferType (Node, BitLength); 447 Status = AcpiDbTestBufferType (Node, BitLength);
439 break; 448 break;
440 449
 450 case ACPI_TYPE_PACKAGE:
 451
 452 Status = AcpiDbTestPackageType (Node);
 453 break;
 454
441 default: 455 default:
442 456
443 AcpiOsPrintf (" Ignoring, type not implemented (%2.2X)", 457 AcpiOsPrintf (" Ignoring, type not implemented (%2.2X)",
444 LocalType); 458 LocalType);
445 break; 459 break;
446 } 460 }
447 461
 462 /* Exit on error, but don't abort the namespace walk */
 463
 464 if (ACPI_FAILURE (Status))
 465 {
 466 Status = AE_OK;
 467 goto Exit;
 468 }
 469
448 switch (Node->Type) 470 switch (Node->Type)
449 { 471 {
450 case ACPI_TYPE_LOCAL_REGION_FIELD: 472 case ACPI_TYPE_LOCAL_REGION_FIELD:
451 473
452 RegionObj = ObjDesc->Field.RegionObj; 474 RegionObj = ObjDesc->Field.RegionObj;
453 AcpiOsPrintf (" (%s)", 475 AcpiOsPrintf (" (%s)",
454 AcpiUtGetRegionName (RegionObj->Region.SpaceId)); 476 AcpiUtGetRegionName (RegionObj->Region.SpaceId));
 477
455 break; 478 break;
456 479
457 default: 480 default:
458 break; 481 break;
459 } 482 }
460 483
 484Exit:
461 AcpiOsPrintf ("\n"); 485 AcpiOsPrintf ("\n");
462 return (Status); 486 return (Status);
463} 487}
464 488
465 489
466/******************************************************************************* 490/*******************************************************************************
467 * 491 *
468 * FUNCTION: AcpiDbTestIntegerType 492 * FUNCTION: AcpiDbTestIntegerType
469 * 493 *
470 * PARAMETERS: Node - Parent NS node for the object 494 * PARAMETERS: Node - Parent NS node for the object
471 * BitLength - Actual length of the object. Used for 495 * BitLength - Actual length of the object. Used for
472 * support of arbitrary length FieldUnit 496 * support of arbitrary length FieldUnit
473 * and BufferField objects. 497 * and BufferField objects.
@@ -506,27 +530,26 @@ AcpiDbTestIntegerType ( @@ -506,27 +530,26 @@ AcpiDbTestIntegerType (
506 { 530 {
507 return (Status); 531 return (Status);
508 } 532 }
509 533
510 AcpiOsPrintf (" (%4.4X/%3.3X) %8.8X%8.8X", 534 AcpiOsPrintf (" (%4.4X/%3.3X) %8.8X%8.8X",
511 BitLength, ACPI_ROUND_BITS_UP_TO_BYTES (BitLength), 535 BitLength, ACPI_ROUND_BITS_UP_TO_BYTES (BitLength),
512 ACPI_FORMAT_UINT64 (Temp1->Integer.Value)); 536 ACPI_FORMAT_UINT64 (Temp1->Integer.Value));
513 537
514 ValueToWrite = ACPI_UINT64_MAX >> (64 - BitLength); 538 ValueToWrite = ACPI_UINT64_MAX >> (64 - BitLength);
515 if (Temp1->Integer.Value == ValueToWrite) 539 if (Temp1->Integer.Value == ValueToWrite)
516 { 540 {
517 ValueToWrite = 0; 541 ValueToWrite = 0;
518 } 542 }
519 
520 /* Write a new value */ 543 /* Write a new value */
521 544
522 WriteValue.Type = ACPI_TYPE_INTEGER; 545 WriteValue.Type = ACPI_TYPE_INTEGER;
523 WriteValue.Integer.Value = ValueToWrite; 546 WriteValue.Integer.Value = ValueToWrite;
524 Status = AcpiDbWriteToObject (Node, &WriteValue); 547 Status = AcpiDbWriteToObject (Node, &WriteValue);
525 if (ACPI_FAILURE (Status)) 548 if (ACPI_FAILURE (Status))
526 { 549 {
527 goto Exit; 550 goto Exit;
528 } 551 }
529 552
530 /* Ensure that we can read back the new value */ 553 /* Ensure that we can read back the new value */
531 554
532 Status = AcpiDbReadFromObject (Node, ACPI_TYPE_INTEGER, &Temp2); 555 Status = AcpiDbReadFromObject (Node, ACPI_TYPE_INTEGER, &Temp2);
@@ -799,26 +822,60 @@ AcpiDbTestStringType ( @@ -799,26 +822,60 @@ AcpiDbTestStringType (
799 Temp3->String.Pointer, Temp1->String.Pointer); 822 Temp3->String.Pointer, Temp1->String.Pointer);
800 } 823 }
801 824
802Exit: 825Exit:
803 if (Temp1) {AcpiOsFree (Temp1);} 826 if (Temp1) {AcpiOsFree (Temp1);}
804 if (Temp2) {AcpiOsFree (Temp2);} 827 if (Temp2) {AcpiOsFree (Temp2);}
805 if (Temp3) {AcpiOsFree (Temp3);} 828 if (Temp3) {AcpiOsFree (Temp3);}
806 return (Status); 829 return (Status);
807} 830}
808 831
809 832
810/******************************************************************************* 833/*******************************************************************************
811 * 834 *
 835 * FUNCTION: AcpiDbTestPackageType
 836 *
 837 * PARAMETERS: Node - Parent NS node for the object
 838 *
 839 * RETURN: Status
 840 *
 841 * DESCRIPTION: Test read for a Package object.
 842 *
 843 ******************************************************************************/
 844
 845static ACPI_STATUS
 846AcpiDbTestPackageType (
 847 ACPI_NAMESPACE_NODE *Node)
 848{
 849 ACPI_OBJECT *Temp1 = NULL;
 850 ACPI_STATUS Status;
 851
 852
 853 /* Read the original value */
 854
 855 Status = AcpiDbReadFromObject (Node, ACPI_TYPE_PACKAGE, &Temp1);
 856 if (ACPI_FAILURE (Status))
 857 {
 858 return (Status);
 859 }
 860
 861 AcpiOsPrintf (" %8.8X Elements", Temp1->Package.Count);
 862 AcpiOsFree (Temp1);
 863 return (Status);
 864}
 865
 866
 867/*******************************************************************************
 868 *
812 * FUNCTION: AcpiDbReadFromObject 869 * FUNCTION: AcpiDbReadFromObject
813 * 870 *
814 * PARAMETERS: Node - Parent NS node for the object 871 * PARAMETERS: Node - Parent NS node for the object
815 * ExpectedType - Object type expected from the read 872 * ExpectedType - Object type expected from the read
816 * Value - Where the value read is returned 873 * Value - Where the value read is returned
817 * 874 *
818 * RETURN: Status 875 * RETURN: Status
819 * 876 *
820 * DESCRIPTION: Performs a read from the specified object by invoking the 877 * DESCRIPTION: Performs a read from the specified object by invoking the
821 * special debugger control method that reads the object. Thus, 878 * special debugger control method that reads the object. Thus,
822 * the AML interpreter is doing all of the work, increasing the 879 * the AML interpreter is doing all of the work, increasing the
823 * validity of the test. 880 * validity of the test.
824 * 881 *
@@ -839,53 +896,55 @@ AcpiDbReadFromObject ( @@ -839,53 +896,55 @@ AcpiDbReadFromObject (
839 896
840 Params[0].Type = ACPI_TYPE_LOCAL_REFERENCE; 897 Params[0].Type = ACPI_TYPE_LOCAL_REFERENCE;
841 Params[0].Reference.ActualType = Node->Type; 898 Params[0].Reference.ActualType = Node->Type;
842 Params[0].Reference.Handle = ACPI_CAST_PTR (ACPI_HANDLE, Node); 899 Params[0].Reference.Handle = ACPI_CAST_PTR (ACPI_HANDLE, Node);
843 900
844 ParamObjects.Count = 1; 901 ParamObjects.Count = 1;
845 ParamObjects.Pointer = Params; 902 ParamObjects.Pointer = Params;
846 903
847 ReturnObj.Length = ACPI_ALLOCATE_BUFFER; 904 ReturnObj.Length = ACPI_ALLOCATE_BUFFER;
848 905
849 AcpiGbl_MethodExecuting = TRUE; 906 AcpiGbl_MethodExecuting = TRUE;
850 Status = AcpiEvaluateObject (ReadHandle, NULL, 907 Status = AcpiEvaluateObject (ReadHandle, NULL,
851 &ParamObjects, &ReturnObj); 908 &ParamObjects, &ReturnObj);
852 AcpiGbl_MethodExecuting = FALSE; 
853 909
 910 AcpiGbl_MethodExecuting = FALSE;
854 if (ACPI_FAILURE (Status)) 911 if (ACPI_FAILURE (Status))
855 { 912 {
856 AcpiOsPrintf ("Could not read from object, %s", 913 AcpiOsPrintf ("Could not read from object, %s",
857 AcpiFormatException (Status)); 914 AcpiFormatException (Status));
858 return (Status); 915 return (Status);
859 } 916 }
860 917
861 RetValue = (ACPI_OBJECT *) ReturnObj.Pointer; 918 RetValue = (ACPI_OBJECT *) ReturnObj.Pointer;
862 919
863 switch (RetValue->Type) 920 switch (RetValue->Type)
864 { 921 {
865 case ACPI_TYPE_INTEGER: 922 case ACPI_TYPE_INTEGER:
866 case ACPI_TYPE_BUFFER: 923 case ACPI_TYPE_BUFFER:
867 case ACPI_TYPE_STRING: 924 case ACPI_TYPE_STRING:
 925 case ACPI_TYPE_PACKAGE:
868 /* 926 /*
869 * Did we receive the type we wanted? Most important for the 927 * Did we receive the type we wanted? Most important for the
870 * Integer/Buffer case (when a field is larger than an Integer, 928 * Integer/Buffer case (when a field is larger than an Integer,
871 * it should return a Buffer). 929 * it should return a Buffer).
872 */ 930 */
873 if (RetValue->Type != ExpectedType) 931 if (RetValue->Type != ExpectedType)
874 { 932 {
875 AcpiOsPrintf (" Type mismatch: Expected %s, Received %s", 933 AcpiOsPrintf (" Type mismatch: Expected %s, Received %s",
876 AcpiUtGetTypeName (ExpectedType), 934 AcpiUtGetTypeName (ExpectedType),
877 AcpiUtGetTypeName (RetValue->Type)); 935 AcpiUtGetTypeName (RetValue->Type));
878 936
 937 AcpiOsFree (ReturnObj.Pointer);
879 return (AE_TYPE); 938 return (AE_TYPE);
880 } 939 }
881 940
882 *Value = RetValue; 941 *Value = RetValue;
883 break; 942 break;
884 943
885 default: 944 default:
886 945
887 AcpiOsPrintf (" Unsupported return object type, %s", 946 AcpiOsPrintf (" Unsupported return object type, %s",
888 AcpiUtGetTypeName (RetValue->Type)); 947 AcpiUtGetTypeName (RetValue->Type));
889 948
890 AcpiOsFree (ReturnObj.Pointer); 949 AcpiOsFree (ReturnObj.Pointer);
891 return (AE_TYPE); 950 return (AE_TYPE);

cvs diff -r1.13 -r1.14 src/sys/external/bsd/acpica/dist/include/acapps.h (expand / switch to unified diff)

--- src/sys/external/bsd/acpica/dist/include/acapps.h 2018/04/07 15:49:51 1.13
+++ src/sys/external/bsd/acpica/dist/include/acapps.h 2018/05/05 00:12:15 1.14
@@ -214,25 +214,29 @@ AdInitialize ( @@ -214,25 +214,29 @@ AdInitialize (
214 214
215char * 215char *
216FlGenerateFilename ( 216FlGenerateFilename (
217 char *InputFilename, 217 char *InputFilename,
218 char *Suffix); 218 char *Suffix);
219 219
220ACPI_STATUS 220ACPI_STATUS
221FlSplitInputPathname ( 221FlSplitInputPathname (
222 char *InputPath, 222 char *InputPath,
223 char **OutDirectoryPath, 223 char **OutDirectoryPath,
224 char **OutFilename); 224 char **OutFilename);
225 225
226char * 226char *
 227FlGetFileBasename (
 228 char *FilePathname);
 229
 230char *
227AdGenerateFilename ( 231AdGenerateFilename (
228 char *Prefix, 232 char *Prefix,
229 char *TableId); 233 char *TableId);
230 234
231void 235void
232AdWriteTable ( 236AdWriteTable (
233 ACPI_TABLE_HEADER *Table, 237 ACPI_TABLE_HEADER *Table,
234 UINT32 Length, 238 UINT32 Length,
235 char *TableName, 239 char *TableName,
236 char *OemTableId); 240 char *OemTableId);
237 241
238#endif /* _ACAPPS */ 242#endif /* _ACAPPS */

cvs diff -r1.18 -r1.19 src/sys/external/bsd/acpica/dist/include/acpixf.h (expand / switch to unified diff)

--- src/sys/external/bsd/acpica/dist/include/acpixf.h 2018/04/07 15:49:51 1.18
+++ src/sys/external/bsd/acpica/dist/include/acpixf.h 2018/05/05 00:12:15 1.19
@@ -36,27 +36,27 @@ @@ -36,27 +36,27 @@
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44#ifndef __ACXFACE_H__ 44#ifndef __ACXFACE_H__
45#define __ACXFACE_H__ 45#define __ACXFACE_H__
46 46
47/* Current ACPICA subsystem version in YYYYMMDD format */ 47/* Current ACPICA subsystem version in YYYYMMDD format */
48 48
49#define ACPI_CA_VERSION 0x20180313 49#define ACPI_CA_VERSION 0x20180427
50 50
51#include "acconfig.h" 51#include "acconfig.h"
52#include "actypes.h" 52#include "actypes.h"
53#include "actbl.h" 53#include "actbl.h"
54#include "acbuffer.h" 54#include "acbuffer.h"
55 55
56 56
57/***************************************************************************** 57/*****************************************************************************
58 * 58 *
59 * Macros used for ACPICA globals and configuration 59 * Macros used for ACPICA globals and configuration
60 * 60 *
61 ****************************************************************************/ 61 ****************************************************************************/
62 62

cvs diff -r1.11 -r1.12 src/sys/external/bsd/acpica/dist/resources/rsdump.c (expand / switch to unified diff)

--- src/sys/external/bsd/acpica/dist/resources/rsdump.c 2018/04/07 15:49:51 1.11
+++ src/sys/external/bsd/acpica/dist/resources/rsdump.c 2018/05/05 00:12:15 1.12
@@ -650,27 +650,27 @@ AcpiRsOutTitle ( @@ -650,27 +650,27 @@ AcpiRsOutTitle (
650 * Data - Start of the list 650 * Data - Start of the list
651 * 651 *
652 * RETURN: None 652 * RETURN: None
653 * 653 *
654 * DESCRIPTION: Miscellaneous functions to dump lists of raw data 654 * DESCRIPTION: Miscellaneous functions to dump lists of raw data
655 * 655 *
656 ******************************************************************************/ 656 ******************************************************************************/
657 657
658static void 658static void
659AcpiRsDumpByteList ( 659AcpiRsDumpByteList (
660 UINT16 Length, 660 UINT16 Length,
661 UINT8 *Data) 661 UINT8 *Data)
662{ 662{
663 UINT8 i; 663 UINT16 i;
664 664
665 665
666 for (i = 0; i < Length; i++) 666 for (i = 0; i < Length; i++)
667 { 667 {
668 AcpiOsPrintf ("%25s%2.2X : %2.2X\n", "Byte", i, Data[i]); 668 AcpiOsPrintf ("%25s%2.2X : %2.2X\n", "Byte", i, Data[i]);
669 } 669 }
670} 670}
671 671
672static void 672static void
673AcpiRsDumpShortByteList ( 673AcpiRsDumpShortByteList (
674 UINT8 Length, 674 UINT8 Length,
675 UINT8 *Data) 675 UINT8 *Data)
676{ 676{

cvs diff -r1.12 -r1.13 src/sys/external/bsd/acpica/dist/tables/tbinstal.c (expand / switch to unified diff)

--- src/sys/external/bsd/acpica/dist/tables/tbinstal.c 2018/04/07 15:49:51 1.12
+++ src/sys/external/bsd/acpica/dist/tables/tbinstal.c 2018/05/05 00:12:16 1.13
@@ -118,27 +118,27 @@ AcpiTbInstallTableWithOverride ( @@ -118,27 +118,27 @@ AcpiTbInstallTableWithOverride (
118 * 118 *
119 * PARAMETERS: Address - Address of the table (might be a virtual 119 * PARAMETERS: Address - Address of the table (might be a virtual
120 * address depending on the TableFlags) 120 * address depending on the TableFlags)
121 * Flags - Flags for the table 121 * Flags - Flags for the table
122 * Reload - Whether reload should be performed 122 * Reload - Whether reload should be performed
123 * Override - Whether override should be performed 123 * Override - Whether override should be performed
124 * TableIndex - Where the table index is returned 124 * TableIndex - Where the table index is returned
125 * 125 *
126 * RETURN: Status 126 * RETURN: Status
127 * 127 *
128 * DESCRIPTION: This function is called to verify and install an ACPI table. 128 * DESCRIPTION: This function is called to verify and install an ACPI table.
129 * When this function is called by "Load" or "LoadTable" opcodes, 129 * When this function is called by "Load" or "LoadTable" opcodes,
130 * or by AcpiLoadTable() API, the "Reload" parameter is set. 130 * or by AcpiLoadTable() API, the "Reload" parameter is set.
131 * After sucessfully returning from this function, table is 131 * After successfully returning from this function, table is
132 * "INSTALLED" but not "VALIDATED". 132 * "INSTALLED" but not "VALIDATED".
133 * 133 *
134 ******************************************************************************/ 134 ******************************************************************************/
135 135
136ACPI_STATUS 136ACPI_STATUS
137AcpiTbInstallStandardTable ( 137AcpiTbInstallStandardTable (
138 ACPI_PHYSICAL_ADDRESS Address, 138 ACPI_PHYSICAL_ADDRESS Address,
139 UINT8 Flags, 139 UINT8 Flags,
140 BOOLEAN Reload, 140 BOOLEAN Reload,
141 BOOLEAN Override, 141 BOOLEAN Override,
142 UINT32 *TableIndex) 142 UINT32 *TableIndex)
143{ 143{
144 UINT32 i; 144 UINT32 i;

cvs diff -r1.5 -r1.6 src/sys/external/bsd/acpica/dist/utilities/utprint.c (expand / switch to unified diff)

--- src/sys/external/bsd/acpica/dist/utilities/utprint.c 2018/04/07 15:49:52 1.5
+++ src/sys/external/bsd/acpica/dist/utilities/utprint.c 2018/05/05 00:12:16 1.6
@@ -607,26 +607,27 @@ vsnprintf ( @@ -607,26 +607,27 @@ vsnprintf (
607 { 607 {
608 Pos = AcpiUtBoundStringOutput (Pos, End, ' '); 608 Pos = AcpiUtBoundStringOutput (Pos, End, ' ');
609 } 609 }
610 continue; 610 continue;
611 611
612 case 'o': 612 case 'o':
613 613
614 Base = 8; 614 Base = 8;
615 break; 615 break;
616 616
617 case 'X': 617 case 'X':
618 618
619 Type |= ACPI_FORMAT_UPPER; 619 Type |= ACPI_FORMAT_UPPER;
 620 /* FALLTHROUGH */
620 621
621 case 'x': 622 case 'x':
622 623
623 Base = 16; 624 Base = 16;
624 break; 625 break;
625 626
626 case 'd': 627 case 'd':
627 case 'i': 628 case 'i':
628 629
629 Type |= ACPI_FORMAT_SIGN; 630 Type |= ACPI_FORMAT_SIGN;
630 631
631 case 'u': 632 case 'u':
632 633