Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Jul 2019 01:47:53 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Scott Long <scottl@samsco.org>
Cc:        Bruce Evans <brde@optusnet.com.au>, Doug Moore <dougm@freebsd.org>,  src-committers@freebsd.org, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r349791 - head/sys/vm
Message-ID:  <20190709235218.N1412@besplex.bde.org>
In-Reply-To: <4BC14FB0-F79B-48DA-98E1-40B20552EA11@samsco.org>
References:  <201907061555.x66FtGsg025314@repo.freebsd.org> <20190707023441.B2047@besplex.bde.org> <4BC14FB0-F79B-48DA-98E1-40B20552EA11@samsco.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 8 Jul 2019, Scott Long wrote:

> This isn=E2=80=99t the first time I=E2=80=99ve witnessed your passion on =
this topic.  It would
> help immensely if there was some documentation, maybe in /sys/sys/param.h=
,
> or maybe even in a manual page, on what a =E2=80=9Cclick=E2=80=9D is, wha=
t a =E2=80=9Cdb=E2=80=9D is, why
> they=E2=80=99re important, and how they should be used.  Do you have any
> documentation tucked away that could be edited and committed?

I don't have any extra documentation.

I learned about clicks because Minix had them and actually used them in a
nontrivial way (1 click =3D 16 bytes =3D real mode segment granularity, and
16-bit ints could could represent the final click address in the real-mode
address space of 1MB but not the size of the whole address space).

Mike Karels gave more details about this.  PDP-11's had 64-bit clicks.  I
think this was also to extend the 16-bit address space in a less bad way
that x86 real mode segments.

Google says that NetBSD has dbtob(9).  This is a link to ctod(9).  This
man page does little more than say "The ctod family of macros can be
used to convert between bytes, pages (''clicks'') and disk blocks" and
expand the abbreviations.  'c' is expanded to 'pages', and there are
no documented macros where 'pages' is abbreviated to 'p'.  The full
list is:
- ctod (spelled ctodb() in FreeBSD),
- dtoc (similarly),
- ctob,
- btoc,
- dbtob (same spelling as in FreeBSD).
- btodb.
One detail is interesting: that the macros make no assumption about
the type of the input parameter (this is clearly wrong since signed
types with negative values don't work when the implementation uses
shifts, floating-point types are further from working, and
non-arithmetic types can't work), and that the caller must ensure that
integer overflow and integer underflow do not occur (here "integer
underflow" is nonsense" -- it means integer overflow to a negative
value).

4.4BSD-Lite2 has these macros with the NetBSD spellings, and also on
i386, tahoe and vax:
- ctos, stoc: core clicks to segments.  All do the identity conversion.
   None are used on any arch.

FreeBSD-1.0 has similar or the same macros as 4.4BSD-Lite2, including
implementation and comments.

FreeBSD-3 doesn't have ctos or stoc, and abbreviates 'disk block' to
'db' consistently, and improves some of the implementations and
comments.

FreeBSD-current is similar to FreeBSD-3, except most of the macros are now
MI and it has lost better comments which were only in the alpha version.

FreeBSD's <sys/param.h> actually documents most of these macros
reasonably well in comments.  It just uses different styles and random
grouping.  Only btodb and dbtob end up without a comment giving a hint
about what b and db are.  The comments for dbtoc and ctodb tell you
that a db is a devblk and a c is a page.  Other comments tell you that
a c is a click.

Bruce
From owner-svn-src-head@freebsd.org  Tue Jul  9 18:02:42 2019
Return-Path: <owner-svn-src-head@freebsd.org>
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC07715E08B0;
 Tue,  9 Jul 2019 18:02:42 +0000 (UTC)
 (envelope-from jkim@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 server-signature RSA-PSS (4096 bits)
 client-signature RSA-PSS (4096 bits) client-digest SHA256)
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 579E775326;
 Tue,  9 Jul 2019 18:02:42 +0000 (UTC)
 (envelope-from jkim@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DCFD4339D;
 Tue,  9 Jul 2019 18:02:41 +0000 (UTC)
 (envelope-from jkim@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x69I2fxR076817;
 Tue, 9 Jul 2019 18:02:41 GMT (envelope-from jkim@FreeBSD.org)
Received: (from jkim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id x69I2bWv076792;
 Tue, 9 Jul 2019 18:02:37 GMT (envelope-from jkim@FreeBSD.org)
Message-Id: <201907091802.x69I2bWv076792@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jkim set sender to
 jkim@FreeBSD.org using -f
From: Jung-uk Kim <jkim@FreeBSD.org>
Date: Tue, 9 Jul 2019 18:02:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r349863 - in head/sys/contrib/dev/acpica: . compiler
 components/dispatcher components/events components/executer
 components/namespace components/tables components/utilities include
X-SVN-Group: head
X-SVN-Commit-Author: jkim
X-SVN-Commit-Paths: in head/sys/contrib/dev/acpica: . compiler
 components/dispatcher components/events components/executer
 components/namespace components/tables components/utilities include
X-SVN-Commit-Revision: 349863
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 579E775326
X-Spamd-Bar: --
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-2.95 / 15.00];
 local_wl_from(0.00)[FreeBSD.org];
 NEURAL_HAM_MEDIUM(-1.00)[-0.999,0];
 NEURAL_HAM_SHORT(-0.95)[-0.949,0];
 ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US];
 NEURAL_HAM_LONG(-1.00)[-1.000,0]
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 <svn-src-head.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-head>,
 <mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head/>;
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-head>,
 <mailto:svn-src-head-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 09 Jul 2019 18:02:43 -0000

Author: jkim
Date: Tue Jul  9 18:02:36 2019
New Revision: 349863
URL: https://svnweb.freebsd.org/changeset/base/349863

Log:
  MFV:	r349861
  
  Import ACPICA 20190703.

Modified:
  head/sys/contrib/dev/acpica/changes.txt
  head/sys/contrib/dev/acpica/compiler/asldefine.h
  head/sys/contrib/dev/acpica/compiler/aslglobal.h
  head/sys/contrib/dev/acpica/compiler/aslload.c
  head/sys/contrib/dev/acpica/compiler/aslmessages.c
  head/sys/contrib/dev/acpica/compiler/aslmessages.h
  head/sys/contrib/dev/acpica/compiler/aslstubs.c
  head/sys/contrib/dev/acpica/compiler/aslsupport.l
  head/sys/contrib/dev/acpica/components/dispatcher/dsinit.c
  head/sys/contrib/dev/acpica/components/events/evgpe.c
  head/sys/contrib/dev/acpica/components/events/evgpeblk.c
  head/sys/contrib/dev/acpica/components/events/evxface.c
  head/sys/contrib/dev/acpica/components/events/evxfgpe.c
  head/sys/contrib/dev/acpica/components/executer/exconfig.c
  head/sys/contrib/dev/acpica/components/namespace/nsaccess.c
  head/sys/contrib/dev/acpica/components/namespace/nseval.c
  head/sys/contrib/dev/acpica/components/namespace/nsinit.c
  head/sys/contrib/dev/acpica/components/namespace/nsload.c
  head/sys/contrib/dev/acpica/components/namespace/nsutils.c
  head/sys/contrib/dev/acpica/components/tables/tbdata.c
  head/sys/contrib/dev/acpica/components/tables/tbxfload.c
  head/sys/contrib/dev/acpica/components/utilities/utinit.c
  head/sys/contrib/dev/acpica/components/utilities/utxfinit.c
  head/sys/contrib/dev/acpica/include/acevents.h
  head/sys/contrib/dev/acpica/include/acglobal.h
  head/sys/contrib/dev/acpica/include/acnamesp.h
  head/sys/contrib/dev/acpica/include/acpixf.h
Directory Properties:
  head/sys/contrib/dev/acpica/   (props changed)

Modified: head/sys/contrib/dev/acpica/changes.txt
==============================================================================
--- head/sys/contrib/dev/acpica/changes.txt	Tue Jul  9 17:18:24 2019	(r349862)
+++ head/sys/contrib/dev/acpica/changes.txt	Tue Jul  9 18:02:36 2019	(r349863)
@@ -1,4 +1,53 @@
 ----------------------------------------
+03 July 2019. Summary of changes for version 20190703:
+
+
+1) ACPICA kernel-resident subsystem:
+
+Remove legacy module-level support code. There were still some remnants 
+of the legacy module-level code executions. Since we no longer support 
+this option, this is essentially dead code and has been removed from the 
+ACPICA source.
+
+iASL: ensure that _WAK, _PTS, _TTS, and _Sx are declared only at the root 
+scope. If these named objects are declared outside the root scope, they 
+will not be invoked by any host Operating System.
+
+Clear status of GPEs on first direct enable. ACPI GPEs (other than the EC 
+one) can be enabled in two situations. First, the GPEs with existing _Lxx 
+and _Exx methods are enabled implicitly by ACPICA during system 
+initialization.  Second, the GPEs without these methods (like GPEs listed 
+by _PRW objects for wakeup devices) need to be enabled directly by the 
+code that is going to use them (e.g. ACPI power management or device 
+drivers).
+
+In the former case, if the status of a given GPE is set to start with, 
+its handler method (either _Lxx or _Exx) needs to be invoked to take care 
+of the events (possibly) signaled before the GPE was enabled. In the 
+latter case, however, the first caller of AcpiEnableGpe() for a given GPE 
+should not be expected to care about any events that might be signaled 
+through it earlier.  In that case, it is better to clear the status of 
+the GPE before enabling it, to prevent stale events from triggering 
+unwanted actions (like spurious system resume, for example).
+
+For this reason, modify AcpiEvAddGpeReference() to take an additional 
+boolean argument indicating whether or not the GPE status needs to be 
+cleared when its reference counter changes from zero to one and make 
+AcpiEnableGpe() pass TRUE to it through that new argument.
+
+
+2) iASL Compiler/Disassembler and ACPICA tools:
+
+The tool generation process has been migrated to MSVC 2017, and all 
+project files have been upgraded. The new project files appear in the 
+directory \acpica\generate\msvc2017. This change effectively deprecates 
+the older project files in \acpica\generate\msvc9.
+
+iASL: ensure that _WAK, _PTS, _TTS, and _Sx are declared only at the root 
+scope. If these named objects are declared outside the root scope, they 
+will not be invoked by any host Operating System
+
+----------------------------------------
 09 May 2019. Summary of changes for version 20190509:
 
 

Modified: head/sys/contrib/dev/acpica/compiler/asldefine.h
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/asldefine.h	Tue Jul  9 17:18:24 2019	(r349862)
+++ head/sys/contrib/dev/acpica/compiler/asldefine.h	Tue Jul  9 18:02:36 2019	(r349863)
@@ -298,4 +298,20 @@
 #define COMMENT_CAPTURE_ON    AslGbl_CommentState.CaptureComments = TRUE;
 #define COMMENT_CAPTURE_OFF   AslGbl_CommentState.CaptureComments = FALSE;
 
+/*
+ * Special name segments - these must only be declared at the root scope
+ */
+#define NAMESEG__PTS    "_PTS"
+#define NAMESEG__WAK    "_WAK"
+#define NAMESEG__S0     "_S0_"
+#define NAMESEG__S1     "_S1_"
+#define NAMESEG__S2     "_S2_"
+#define NAMESEG__S3     "_S3_"
+#define NAMESEG__S4     "_S4_"
+#define NAMESEG__S5     "_S5_"
+#define NAMESEG__TTS    "_TTS"
+
+#define MAX_SPECIAL_NAMES      9
+
+
 #endif /* ASLDEFINE.H */

Modified: head/sys/contrib/dev/acpica/compiler/aslglobal.h
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslglobal.h	Tue Jul  9 17:18:24 2019	(r349862)
+++ head/sys/contrib/dev/acpica/compiler/aslglobal.h	Tue Jul  9 18:02:36 2019	(r349863)
@@ -223,11 +223,26 @@ const char                          *AslGbl_OpFlagName
     "OP_NOT_FOUND_DURING_LOAD"
 };
 
+const char                          *AslGbl_SpecialNamedObjects [MAX_SPECIAL_NAMES] =
+{
+    NAMESEG__PTS,
+    NAMESEG__WAK,
+    NAMESEG__S0,
+    NAMESEG__S1,
+    NAMESEG__S2,
+    NAMESEG__S3,
+    NAMESEG__S4,
+    NAMESEG__S5,
+    NAMESEG__TTS
+};
+
 #else
 extern ASL_FILE_DESC                AslGbl_FileDescs [ASL_NUM_FILES];
 extern UINT32                       AslGbl_ExceptionCount[ASL_NUM_REPORT_LEVELS];
 extern const char                   *AslGbl_OpFlagNames[ACPI_NUM_OP_FLAGS];
+extern const char                   *AslGbl_SpecialNamedObjects[MAX_SPECIAL_NAMES];
 #endif
+
 
 
 /*

Modified: head/sys/contrib/dev/acpica/compiler/aslload.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslload.c	Tue Jul  9 17:18:24 2019	(r349862)
+++ head/sys/contrib/dev/acpica/compiler/aslload.c	Tue Jul  9 18:02:36 2019	(r349863)
@@ -164,6 +164,7 @@
 
 static ACPI_STATUS
 LdLoadFieldElements (
+    UINT32                  AmlType,
     ACPI_PARSE_OBJECT       *Op,
     ACPI_WALK_STATE         *WalkState);
 
@@ -190,6 +191,10 @@ LdCommonNamespaceEnd (
     UINT32                  Level,
     void                    *Context);
 
+static void
+LdCheckSpecialNames (
+    ACPI_NAMESPACE_NODE     *Node,
+    ACPI_PARSE_OBJECT       *Op);
 
 /*******************************************************************************
  *
@@ -247,7 +252,8 @@ LdLoadNamespace (
  *
  * FUNCTION:    LdLoadFieldElements
  *
- * PARAMETERS:  Op              - Parent node (Field)
+ * PARAMETERS:  AmlType         - Type to search
+ *              Op              - Parent node (Field)
  *              WalkState       - Current walk state
  *
  * RETURN:      Status
@@ -259,6 +265,7 @@ LdLoadNamespace (
 
 static ACPI_STATUS
 LdLoadFieldElements (
+    UINT32                  AmlType,
     ACPI_PARSE_OBJECT       *Op,
     ACPI_WALK_STATE         *WalkState)
 {
@@ -274,7 +281,7 @@ LdLoadFieldElements (
     {
         Status = AcpiNsLookup (WalkState->ScopeInfo,
             SourceRegion->Asl.Value.String,
-            ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE,
+            AmlType, ACPI_IMODE_EXECUTE,
             ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node);
         if (Status == AE_NOT_FOUND)
         {
@@ -507,11 +514,15 @@ LdNamespace1Begin (
      */
     switch (Op->Asl.AmlOpcode)
     {
-    case AML_BANK_FIELD_OP:
     case AML_INDEX_FIELD_OP:
+
+        Status = LdLoadFieldElements (ACPI_TYPE_LOCAL_REGION_FIELD, Op, WalkState);
+        return (Status);
+
+    case AML_BANK_FIELD_OP:
     case AML_FIELD_OP:
 
-        Status = LdLoadFieldElements (Op, WalkState);
+        Status = LdLoadFieldElements (ACPI_TYPE_REGION, Op, WalkState);
         return (Status);
 
     case AML_INT_CONNECTION_OP:
@@ -966,6 +977,10 @@ LdNamespace1Begin (
         }
     }
 
+    /* Check special names like _WAK and _PTS */
+
+    LdCheckSpecialNames (Node, Op);
+
     if (ForceNewScope)
     {
         Status = AcpiDsScopeStackPush (Node, ObjectType, WalkState);
@@ -1001,6 +1016,42 @@ FinishNode:
     }
 
     return_ACPI_STATUS (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    LdCheckSpecialNames
+ *
+ * PARAMETERS:  Node        - Node that represents the named object
+ *              Op          - Named object declaring this named object
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Check if certain named objects are declared in the incorrect
+ *              scope. Special named objects are listed in
+ *              AslGbl_SpecialNamedObjects and can only be declared at the root
+ *              scope.
+ *
+ ******************************************************************************/
+
+static void
+LdCheckSpecialNames (
+    ACPI_NAMESPACE_NODE     *Node,
+    ACPI_PARSE_OBJECT       *Op)
+{
+    UINT32                  i;
+
+
+    for (i = 0; i < MAX_SPECIAL_NAMES; i++)
+    {
+        if (ACPI_COMPARE_NAMESEG(Node->Name.Ascii, AslGbl_SpecialNamedObjects[i]) &&
+            Node->Parent != AcpiGbl_RootNode)
+        {
+            AslError (ASL_ERROR, ASL_MSG_INVALID_SPECIAL_NAME, Op, Op->Asl.ExternalName);
+            return;
+        }
+    }
 }
 
 

Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslmessages.c	Tue Jul  9 17:18:24 2019	(r349862)
+++ head/sys/contrib/dev/acpica/compiler/aslmessages.c	Tue Jul  9 18:02:36 2019	(r349863)
@@ -365,7 +365,8 @@ const char                      *AslCompilerMsgs [] =
 /*    ASL_MSG_REGION_LENGTH */              "Operation Region declared with zero length",
 /*    ASL_MSG_TEMPORARY_OBJECT */           "Object is created temporarily in another method and cannot be accessed",
 /*    ASL_MSG_UNDEFINED_EXTERNAL */         "Named object was declared external but the actual definition does not exist",
-/*    ASL_MSG_BUFFER_FIELD_OVERFLOW */        "Buffer field extends beyond end of target buffer"
+/*    ASL_MSG_BUFFER_FIELD_OVERFLOW */      "Buffer field extends beyond end of target buffer",
+/*    ASL_MSG_INVALID_SPECIAL_NAME */       "declaration of this named object outside root scope is illegal"
 };
 
 /* Table compiler */

Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.h
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslmessages.h	Tue Jul  9 17:18:24 2019	(r349862)
+++ head/sys/contrib/dev/acpica/compiler/aslmessages.h	Tue Jul  9 18:02:36 2019	(r349863)
@@ -368,6 +368,7 @@ typedef enum
     ASL_MSG_TEMPORARY_OBJECT,
     ASL_MSG_UNDEFINED_EXTERNAL,
     ASL_MSG_BUFFER_FIELD_OVERFLOW,
+    ASL_MSG_INVALID_SPECIAL_NAME,
 
     /* These messages are used by the Data Table compiler only */
 

Modified: head/sys/contrib/dev/acpica/compiler/aslstubs.c
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslstubs.c	Tue Jul  9 17:18:24 2019	(r349862)
+++ head/sys/contrib/dev/acpica/compiler/aslstubs.c	Tue Jul  9 18:02:36 2019	(r349863)
@@ -166,12 +166,6 @@
  * Things like Events, Global Lock, etc. are not used
  * by the compiler, so they are stubbed out here.
  */
-void
-AcpiNsExecModuleCodeList (
-    void)
-{
-}
-
 ACPI_STATUS
 AcpiNsInitializeObjects (
     void)

Modified: head/sys/contrib/dev/acpica/compiler/aslsupport.l
==============================================================================
--- head/sys/contrib/dev/acpica/compiler/aslsupport.l	Tue Jul  9 17:18:24 2019	(r349862)
+++ head/sys/contrib/dev/acpica/compiler/aslsupport.l	Tue Jul  9 18:02:36 2019	(r349863)
@@ -220,7 +220,7 @@ AslDoLineDirective (
 
     while ((c = input()) != '\n' && c != EOF)
     {
-        *AslGbl_LineBufPtr = c;
+        *AslGbl_LineBufPtr = (char) c;
         AslGbl_LineBufPtr++;
     }
     *AslGbl_LineBufPtr = 0;
@@ -498,7 +498,7 @@ AslInsertLineBuffer (
 
         if (AcpiGbl_CaptureComments)
         {
-            CvProcessCommentState (SourceChar);
+            CvProcessCommentState ((char) SourceChar);
         }
     }
 }
@@ -601,7 +601,7 @@ loop:
         AslInsertLineBuffer (c);
         if (AcpiGbl_CaptureComments && CurrentState.CaptureComments)
         {
-            *StringBuffer = c;
+            *StringBuffer = (char) c;
             ++StringBuffer;
         }
         c1 = c;
@@ -629,7 +629,7 @@ loop:
     AslInsertLineBuffer (c);
     if (AcpiGbl_CaptureComments && CurrentState.CaptureComments)
     {
-        *StringBuffer = c;
+        *StringBuffer = (char) c;
         ++StringBuffer;
     }
 
@@ -720,7 +720,7 @@ AslDoCommentType2 (
         AslInsertLineBuffer (c);
         if (AcpiGbl_CaptureComments && CurrentState.CaptureComments)
         {
-            *StringBuffer = c;
+            *StringBuffer = (char) c;
             ++StringBuffer;
         }
     }
@@ -878,7 +878,7 @@ DoCharacter:
                 if (ACPI_IS_OCTAL_DIGIT (StringChar))
                 {
                     State = ASL_OCTAL_CONSTANT;
-                    ConvertBuffer[0] = StringChar;
+                    ConvertBuffer[0] = (char) StringChar;
                     i = 1;
                     continue;
                 }
@@ -934,7 +934,7 @@ DoCharacter:
 
             /* Append another digit of the constant */
 
-            ConvertBuffer[i] = StringChar;
+            ConvertBuffer[i] = (char) StringChar;
             i++;
             continue;
 
@@ -978,7 +978,7 @@ DoCharacter:
 
             /* Append another digit of the constant */
 
-            ConvertBuffer[i] = StringChar;
+            ConvertBuffer[i] = (char) StringChar;
             i++;
             continue;
 
@@ -989,7 +989,7 @@ DoCharacter:
 
         /* Save the finished character */
 
-        *StringBuffer = StringChar;
+        *StringBuffer = (char) StringChar;
         StringBuffer++;
         if (StringBuffer >= EndBuffer)
         {

Modified: head/sys/contrib/dev/acpica/components/dispatcher/dsinit.c
==============================================================================
--- head/sys/contrib/dev/acpica/components/dispatcher/dsinit.c	Tue Jul  9 17:18:24 2019	(r349862)
+++ head/sys/contrib/dev/acpica/components/dispatcher/dsinit.c	Tue Jul  9 18:02:36 2019	(r349863)
@@ -362,7 +362,7 @@ AcpiDsInitializeObjects (
     if (ACPI_COMPARE_NAMESEG (Table->Signature, ACPI_SIG_DSDT))
     {
         ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
-            "\nInitializing Namespace objects:\n"));
+            "\nACPI table initialization:\n"));
     }
 
     /* Summary of objects initialized */

Modified: head/sys/contrib/dev/acpica/components/events/evgpe.c
==============================================================================
--- head/sys/contrib/dev/acpica/components/events/evgpe.c	Tue Jul  9 17:18:24 2019	(r349862)
+++ head/sys/contrib/dev/acpica/components/events/evgpe.c	Tue Jul  9 18:02:36 2019	(r349863)
@@ -316,6 +316,7 @@ AcpiEvMaskGpe (
  * FUNCTION:    AcpiEvAddGpeReference
  *
  * PARAMETERS:  GpeEventInfo            - Add a reference to this GPE
+ *              ClearOnEnable           - Clear GPE status before enabling it
  *
  * RETURN:      Status
  *
@@ -326,7 +327,8 @@ AcpiEvMaskGpe (
 
 ACPI_STATUS
 AcpiEvAddGpeReference (
-    ACPI_GPE_EVENT_INFO     *GpeEventInfo)
+    ACPI_GPE_EVENT_INFO     *GpeEventInfo,
+    BOOLEAN                 ClearOnEnable)
 {
     ACPI_STATUS             Status = AE_OK;
 
@@ -343,6 +345,11 @@ AcpiEvAddGpeReference (
     if (GpeEventInfo->RuntimeCount == 1)
     {
         /* Enable on first reference */
+
+        if (ClearOnEnable)
+        {
+            (void) AcpiHwClearGpe (GpeEventInfo);
+        }
 
         Status = AcpiEvUpdateGpeEnableMask (GpeEventInfo);
         if (ACPI_SUCCESS (Status))

Modified: head/sys/contrib/dev/acpica/components/events/evgpeblk.c
==============================================================================
--- head/sys/contrib/dev/acpica/components/events/evgpeblk.c	Tue Jul  9 17:18:24 2019	(r349862)
+++ head/sys/contrib/dev/acpica/components/events/evgpeblk.c	Tue Jul  9 18:02:36 2019	(r349863)
@@ -637,7 +637,7 @@ AcpiEvInitializeGpeBlock (
                 continue;
             }
 
-            Status = AcpiEvAddGpeReference (GpeEventInfo);
+            Status = AcpiEvAddGpeReference (GpeEventInfo, FALSE);
             if (ACPI_FAILURE (Status))
             {
                 ACPI_EXCEPTION ((AE_INFO, Status,

Modified: head/sys/contrib/dev/acpica/components/events/evxface.c
==============================================================================
--- head/sys/contrib/dev/acpica/components/events/evxface.c	Tue Jul  9 17:18:24 2019	(r349862)
+++ head/sys/contrib/dev/acpica/components/events/evxface.c	Tue Jul  9 18:02:36 2019	(r349863)
@@ -1256,7 +1256,7 @@ AcpiRemoveGpeHandler (
             ACPI_GPE_DISPATCH_NOTIFY)) &&
         Handler->OriginallyEnabled)
     {
-        (void) AcpiEvAddGpeReference (GpeEventInfo);
+        (void) AcpiEvAddGpeReference (GpeEventInfo, FALSE);
         if (ACPI_GPE_IS_POLLING_NEEDED (GpeEventInfo))
         {
             /* Poll edge triggered GPEs to handle existing events */

Modified: head/sys/contrib/dev/acpica/components/events/evxfgpe.c
==============================================================================
--- head/sys/contrib/dev/acpica/components/events/evxfgpe.c	Tue Jul  9 17:18:24 2019	(r349862)
+++ head/sys/contrib/dev/acpica/components/events/evxfgpe.c	Tue Jul  9 18:02:36 2019	(r349863)
@@ -267,7 +267,7 @@ AcpiEnableGpe (
         if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) !=
             ACPI_GPE_DISPATCH_NONE)
         {
-            Status = AcpiEvAddGpeReference (GpeEventInfo);
+            Status = AcpiEvAddGpeReference (GpeEventInfo, TRUE);
             if (ACPI_SUCCESS (Status) &&
                 ACPI_GPE_IS_POLLING_NEEDED (GpeEventInfo))
             {

Modified: head/sys/contrib/dev/acpica/components/executer/exconfig.c
==============================================================================
--- head/sys/contrib/dev/acpica/components/executer/exconfig.c	Tue Jul  9 17:18:24 2019	(r349862)
+++ head/sys/contrib/dev/acpica/components/executer/exconfig.c	Tue Jul  9 18:02:36 2019	(r349863)
@@ -342,10 +342,9 @@ AcpiExLoadTableOp (
         return_ACPI_STATUS (Status);
     }
 
-    /* Complete the initialization/resolution of package objects */
+    /* Complete the initialization/resolution of new objects */
 
-    Status = AcpiNsWalkNamespace (ACPI_TYPE_PACKAGE, ACPI_ROOT_OBJECT,
-        ACPI_UINT32_MAX, 0, AcpiNsInitOnePackage, NULL, NULL, NULL);
+    AcpiNsInitializeObjects ();
 
     /* Parameter Data (optional) */
 
@@ -620,10 +619,11 @@ AcpiExLoadOp (
         return_ACPI_STATUS (Status);
     }
 
-    /* Complete the initialization/resolution of package objects */
+    /* Complete the initialization/resolution of new objects */
 
-    Status = AcpiNsWalkNamespace (ACPI_TYPE_PACKAGE, ACPI_ROOT_OBJECT,
-        ACPI_UINT32_MAX, 0, AcpiNsInitOnePackage, NULL, NULL, NULL);
+    AcpiExExitInterpreter ();
+    AcpiNsInitializeObjects ();
+    AcpiExEnterInterpreter ();
 
     /* Store the DdbHandle into the Target operand */
 

Modified: head/sys/contrib/dev/acpica/components/namespace/nsaccess.c
==============================================================================
--- head/sys/contrib/dev/acpica/components/namespace/nsaccess.c	Tue Jul  9 17:18:24 2019	(r349862)
+++ head/sys/contrib/dev/acpica/components/namespace/nsaccess.c	Tue Jul  9 18:02:36 2019	(r349863)
@@ -184,6 +184,7 @@ AcpiNsRootInitialize (
     ACPI_STATUS                 Status;
     const ACPI_PREDEFINED_NAMES *InitVal = NULL;
     ACPI_NAMESPACE_NODE         *NewNode;
+    ACPI_NAMESPACE_NODE         *PrevNode = NULL;
     ACPI_OPERAND_OBJECT         *ObjDesc;
     ACPI_STRING                 Val = NULL;
 
@@ -213,13 +214,30 @@ AcpiNsRootInitialize (
      */
     AcpiGbl_RootNode = &AcpiGbl_RootNodeStruct;
 
-    /* Enter the pre-defined names in the name table */
+    /* Enter the predefined names in the name table */
 
     ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
         "Entering predefined entries into namespace\n"));
 
+    /*
+     * Create the initial (default) namespace.
+     * This namespace looks like something similar to this:
+     *
+     *   ACPI Namespace (from Namespace Root):
+     *    0  _GPE Scope        00203160 00
+     *    0  _PR_ Scope        002031D0 00
+     *    0  _SB_ Device       00203240 00 Notify Object: 0020ADD8
+     *    0  _SI_ Scope        002032B0 00
+     *    0  _TZ_ Device       00203320 00
+     *    0  _REV Integer      00203390 00 = 0000000000000002
+     *    0  _OS_ String       00203488 00 Len 14 "Microsoft Windows NT"
+     *    0  _GL_ Mutex        00203580 00 Object 002035F0
+     *    0  _OSI Method       00203678 00 Args 1 Len 0000 Aml 00000000
+     */
     for (InitVal = AcpiGbl_PreDefinedNames; InitVal->Name; InitVal++)
     {
+        Status = AE_OK;
+
         /* _OSI is optional for now, will be permanent later */
 
         if (!strcmp (InitVal->Name, "_OSI") && !AcpiGbl_CreateOsiMethod)
@@ -227,17 +245,35 @@ AcpiNsRootInitialize (
             continue;
         }
 
-        Status = AcpiNsLookup (NULL, ACPI_CAST_PTR (char, InitVal->Name),
-            InitVal->Type, ACPI_IMODE_LOAD_PASS2, ACPI_NS_NO_UPSEARCH,
-            NULL, &NewNode);
-        if (ACPI_FAILURE (Status))
+        /*
+         * Create, init, and link the new predefined name
+         * Note: No need to use AcpiNsLookup here because all the
+         * predefined names are at the root level. It is much easier to
+         * just create and link the new node(s) here.
+         */
+        NewNode = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_NAMESPACE_NODE));
+        if (!NewNode)
         {
-            ACPI_EXCEPTION ((AE_INFO, Status,
-                "Could not create predefined name %s",
-                InitVal->Name));
-            continue;
+            Status = AE_NO_MEMORY;
+            goto UnlockAndExit;
         }
 
+        ACPI_COPY_NAMESEG (NewNode->Name.Ascii, InitVal->Name);
+        NewNode->DescriptorType = ACPI_DESC_TYPE_NAMED;
+        NewNode->Type = InitVal->Type;
+
+        if (!PrevNode)
+        {
+            AcpiGbl_RootNodeStruct.Child = NewNode;
+        }
+        else
+        {
+            PrevNode->Peer = NewNode;
+        }
+
+        NewNode->Parent = &AcpiGbl_RootNodeStruct;
+        PrevNode = NewNode;
+
         /*
          * Name entered successfully. If entry in PreDefinedNames[] specifies
          * an initial value, create the initial value.
@@ -286,7 +322,7 @@ AcpiNsRootInitialize (
 
                 NewNode->Value = ObjDesc->Method.ParamCount;
 #else
-                /* Mark this as a very SPECIAL method */
+                /* Mark this as a very SPECIAL method (_OSI) */
 
                 ObjDesc->Method.InfoFlags = ACPI_METHOD_INTERNAL_ONLY;
                 ObjDesc->Method.Dispatch.Implementation = AcpiUtOsiImplementation;
@@ -358,7 +394,6 @@ AcpiNsRootInitialize (
             AcpiUtRemoveReference (ObjDesc);
         }
     }
-
 
 UnlockAndExit:
     (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);

Modified: head/sys/contrib/dev/acpica/components/namespace/nseval.c
==============================================================================
--- head/sys/contrib/dev/acpica/components/namespace/nseval.c	Tue Jul  9 17:18:24 2019	(r349862)
+++ head/sys/contrib/dev/acpica/components/namespace/nseval.c	Tue Jul  9 18:02:36 2019	(r349863)
@@ -160,14 +160,7 @@
 #define _COMPONENT          ACPI_NAMESPACE
         ACPI_MODULE_NAME    ("nseval")
 
-/* Local prototypes */
 
-static void
-AcpiNsExecModuleCode (
-    ACPI_OPERAND_OBJECT     *MethodObj,
-    ACPI_EVALUATE_INFO      *Info);
-
-
 /*******************************************************************************
  *
  * FUNCTION:    AcpiNsEvaluate
@@ -464,207 +457,4 @@ Cleanup:
     ACPI_FREE (Info->FullPathname);
     Info->FullPathname = NULL;
     return_ACPI_STATUS (Status);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    AcpiNsExecModuleCodeList
- *
- * PARAMETERS:  None
- *
- * RETURN:      None. Exceptions during method execution are ignored, since
- *              we cannot abort a table load.
- *
- * DESCRIPTION: Execute all elements of the global module-level code list.
- *              Each element is executed as a single control method.
- *
- * NOTE: With this option enabled, each block of detected executable AML
- * code that is outside of any control method is wrapped with a temporary
- * control method object and placed on a global list. The methods on this
- * list are executed below.
- *
- * This function executes the module-level code for all tables only after
- * all of the tables have been loaded. It is a legacy option and is
- * not compatible with other ACPI implementations. See AcpiNsLoadTable.
- *
- * This function will be removed when the legacy option is removed.
- *
- ******************************************************************************/
-
-void
-AcpiNsExecModuleCodeList (
-    void)
-{
-    ACPI_OPERAND_OBJECT     *Prev;
-    ACPI_OPERAND_OBJECT     *Next;
-    ACPI_EVALUATE_INFO      *Info;
-    UINT32                  MethodCount = 0;
-
-
-    ACPI_FUNCTION_TRACE (NsExecModuleCodeList);
-
-
-    /* Exit now if the list is empty */
-
-    Next = AcpiGbl_ModuleCodeList;
-    if (!Next)
-    {
-        ACPI_DEBUG_PRINT ((ACPI_DB_INIT_NAMES,
-            "Legacy MLC block list is empty\n"));
-
-        return_VOID;
-    }
-
-    /* Allocate the evaluation information block */
-
-    Info = ACPI_ALLOCATE (sizeof (ACPI_EVALUATE_INFO));
-    if (!Info)
-    {
-        return_VOID;
-    }
-
-    /* Walk the list, executing each "method" */
-
-    while (Next)
-    {
-        Prev = Next;
-        Next = Next->Method.Mutex;
-
-        /* Clear the link field and execute the method */
-
-        Prev->Method.Mutex = NULL;
-        AcpiNsExecModuleCode (Prev, Info);
-        MethodCount++;
-
-        /* Delete the (temporary) method object */
-
-        AcpiUtRemoveReference (Prev);
-    }
-
-    ACPI_INFO ((
-        "Executed %u blocks of module-level executable AML code",
-        MethodCount));
-
-    ACPI_FREE (Info);
-    AcpiGbl_ModuleCodeList = NULL;
-    return_VOID;
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION:    AcpiNsExecModuleCode
- *
- * PARAMETERS:  MethodObj           - Object container for the module-level code
- *              Info                - Info block for method evaluation
- *
- * RETURN:      None. Exceptions during method execution are ignored, since
- *              we cannot abort a table load.
- *
- * DESCRIPTION: Execute a control method containing a block of module-level
- *              executable AML code. The control method is temporarily
- *              installed to the root node, then evaluated.
- *
- ******************************************************************************/
-
-static void
-AcpiNsExecModuleCode (
-    ACPI_OPERAND_OBJECT     *MethodObj,
-    ACPI_EVALUATE_INFO      *Info)
-{
-    ACPI_OPERAND_OBJECT     *ParentObj;
-    ACPI_NAMESPACE_NODE     *ParentNode;
-    ACPI_OBJECT_TYPE        Type;
-    ACPI_STATUS             Status;
-
-
-    ACPI_FUNCTION_TRACE (NsExecModuleCode);
-
-
-    /*
-     * Get the parent node. We cheat by using the NextObject field
-     * of the method object descriptor.
-     */
-    ParentNode = ACPI_CAST_PTR (
-        ACPI_NAMESPACE_NODE, MethodObj->Method.NextObject);
-    Type = AcpiNsGetType (ParentNode);
-
-    /*
-     * Get the region handler and save it in the method object. We may need
-     * this if an operation region declaration causes a _REG method to be run.
-     *
-     * We can't do this in AcpiPsLinkModuleCode because
-     * AcpiGbl_RootNode->Object is NULL at PASS1.
-     */
-    if ((Type == ACPI_TYPE_DEVICE) && ParentNode->Object)
-    {
-        MethodObj->Method.Dispatch.Handler =
-            ParentNode->Object->Device.Handler;
-    }
-
-    /* Must clear NextObject (AcpiNsAttachObject needs the field) */
-
-    MethodObj->Method.NextObject = NULL;
-
-    /* Initialize the evaluation information block */
-
-    memset (Info, 0, sizeof (ACPI_EVALUATE_INFO));
-    Info->PrefixNode = ParentNode;
-
-    /*
-     * Get the currently attached parent object. Add a reference,
-     * because the ref count will be decreased when the method object
-     * is installed to the parent node.
-     */
-    ParentObj = AcpiNsGetAttachedObject (ParentNode);
-    if (ParentObj)
-    {
-        AcpiUtAddReference (ParentObj);
-    }
-
-    /* Install the method (module-level code) in the parent node */
-
-    Status = AcpiNsAttachObject (ParentNode, MethodObj, ACPI_TYPE_METHOD);
-    if (ACPI_FAILURE (Status))
-    {
-        goto Exit;
-    }
-
-    /* Execute the parent node as a control method */
-
-    Status = AcpiNsEvaluate (Info);
-
-    ACPI_DEBUG_PRINT ((ACPI_DB_INIT_NAMES,
-        "Executed module-level code at %p\n",
-        MethodObj->Method.AmlStart));
-
-    /* Delete a possible implicit return value (in slack mode) */
-
-    if (Info->ReturnObject)
-    {
-        AcpiUtRemoveReference (Info->ReturnObject);
-    }
-
-    /* Detach the temporary method object */
-
-    AcpiNsDetachObject (ParentNode);
-
-    /* Restore the original parent object */
-
-    if (ParentObj)
-    {
-        Status = AcpiNsAttachObject (ParentNode, ParentObj, Type);
-    }
-    else
-    {
-        ParentNode->Type = (UINT8) Type;
-    }
-
-Exit:
-    if (ParentObj)
-    {
-        AcpiUtRemoveReference (ParentObj);
-    }
-    return_VOID;
 }

Modified: head/sys/contrib/dev/acpica/components/namespace/nsinit.c
==============================================================================
--- head/sys/contrib/dev/acpica/components/namespace/nsinit.c	Tue Jul  9 17:18:24 2019	(r349862)
+++ head/sys/contrib/dev/acpica/components/namespace/nsinit.c	Tue Jul  9 18:02:36 2019	(r349863)
@@ -212,29 +212,30 @@ AcpiNsInitializeObjects (
     ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
         "**** Starting initialization of namespace objects ****\n"));
     ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
-        "Completing Region/Field/Buffer/Package initialization:\n"));
+        "Final data object initialization: "));
 
-    /* Set all init info to zero */
+    /* Clear the info block */
 
     memset (&Info, 0, sizeof (ACPI_INIT_WALK_INFO));
 
     /* Walk entire namespace from the supplied root */
 
+    /*
+     * TBD: will become ACPI_TYPE_PACKAGE as this type object
+     * is now the only one that supports deferred initialization
+     * (forward references).
+     */
     Status = AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
-        ACPI_UINT32_MAX, AcpiNsInitOneObject, NULL,
-        &Info, NULL);
+        ACPI_UINT32_MAX, AcpiNsInitOneObject, NULL, &Info, NULL);
     if (ACPI_FAILURE (Status))
     {
         ACPI_EXCEPTION ((AE_INFO, Status, "During WalkNamespace"));
     }
 
     ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
-        "    Initialized %u/%u Regions %u/%u Fields %u/%u "
-        "Buffers %u/%u Packages (%u nodes)\n",
-        Info.OpRegionInit,  Info.OpRegionCount,
-        Info.FieldInit,     Info.FieldCount,
-        Info.BufferInit,    Info.BufferCount,
-        Info.PackageInit,   Info.PackageCount, Info.ObjectCount));
+        "Namespace contains %u (0x%X) objects\n",
+        Info.ObjectCount,
+        Info.ObjectCount));
 
     ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
         "%u Control Methods found\n%u Op Regions found\n",
@@ -561,35 +562,19 @@ AcpiNsInitOneObject (
     AcpiExEnterInterpreter ();
 
     /*
-     * Each of these types can contain executable AML code within the
-     * declaration.
+     * Only initialization of Package objects can be deferred, in order
+     * to support forward references.
      */
     switch (Type)
     {
-    case ACPI_TYPE_REGION:
+    case ACPI_TYPE_LOCAL_BANK_FIELD:
 
-        Info->OpRegionInit++;
-        Status = AcpiDsGetRegionArguments (ObjDesc);
-        break;
+        /* TBD: BankFields do not require deferred init, remove this code */
 
-    case ACPI_TYPE_BUFFER_FIELD:
-
         Info->FieldInit++;
-        Status = AcpiDsGetBufferFieldArguments (ObjDesc);
-        break;
-
-    case ACPI_TYPE_LOCAL_BANK_FIELD:
-
-        Info->FieldInit++;
         Status = AcpiDsGetBankFieldArguments (ObjDesc);
         break;
 
-    case ACPI_TYPE_BUFFER:
-
-        Info->BufferInit++;
-        Status = AcpiDsGetBufferArguments (ObjDesc);
-        break;
-
     case ACPI_TYPE_PACKAGE:
 
         /* Complete the initialization/resolution of the package object */
@@ -600,8 +585,12 @@ AcpiNsInitOneObject (
 
     default:
 
-        /* No other types can get here */
+        /* No other types should get here */
 
+        Status = AE_TYPE;
+        ACPI_EXCEPTION ((AE_INFO, Status,
+            "Opcode is not deferred [%4.4s] (%s)",
+            AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Type)));
         break;
     }
 

Modified: head/sys/contrib/dev/acpica/components/namespace/nsload.c
==============================================================================
--- head/sys/contrib/dev/acpica/components/namespace/nsload.c	Tue Jul  9 17:18:24 2019	(r349862)
+++ head/sys/contrib/dev/acpica/components/namespace/nsload.c	Tue Jul  9 18:02:36 2019	(r349863)
@@ -268,18 +268,6 @@ Unlock:
     ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
         "**** Completed Table Object Initialization\n"));
 
-    /*
-     * This case handles the legacy option that groups all module-level
-     * code blocks together and defers execution until all of the tables
-     * are loaded. Execute all of these blocks at this time.
-     * Execute any module-level code that was detected during the table
-     * load phase.
-     *
-     * Note: this option is deprecated and will be eliminated in the
-     * future. Use of this option can cause problems with AML code that
-     * depends upon in-order immediate execution of module-level code.
-     */
-    AcpiNsExecModuleCodeList ();
     return_ACPI_STATUS (Status);
 }
 

Modified: head/sys/contrib/dev/acpica/components/namespace/nsutils.c
==============================================================================
--- head/sys/contrib/dev/acpica/components/namespace/nsutils.c	Tue Jul  9 17:18:24 2019	(r349862)
+++ head/sys/contrib/dev/acpica/components/namespace/nsutils.c	Tue Jul  9 18:02:36 2019	(r349863)
@@ -802,23 +802,10 @@ AcpiNsTerminate (
     void)
 {
     ACPI_STATUS             Status;
-    ACPI_OPERAND_OBJECT     *Prev;
-    ACPI_OPERAND_OBJECT     *Next;
 
 
     ACPI_FUNCTION_TRACE (NsTerminate);
 
-
-    /* Delete any module-level code blocks */
-
-    Next = AcpiGbl_ModuleCodeList;
-    while (Next)
-    {
-        Prev = Next;
-        Next = Next->Method.Mutex;
-        Prev->Method.Mutex = NULL; /* Clear the Mutex (cheated) field */
-        AcpiUtRemoveReference (Prev);
-    }
 
     /*
      * Free the entire namespace -- all nodes and all objects

Modified: head/sys/contrib/dev/acpica/components/tables/tbdata.c
==============================================================================
--- head/sys/contrib/dev/acpica/components/tables/tbdata.c	Tue Jul  9 17:18:24 2019	(r349862)
+++ head/sys/contrib/dev/acpica/components/tables/tbdata.c	Tue Jul  9 18:02:36 2019	(r349863)
@@ -1191,19 +1191,6 @@ AcpiTbLoadTable (
     Status = AcpiNsLoadTable (TableIndex, ParentNode);
 
     /*
-     * This case handles the legacy option that groups all module-level
-     * code blocks together and defers execution until all of the tables
-     * are loaded. Execute all of these blocks at this time.
-     * Execute any module-level code that was detected during the table
-     * load phase.
-     *
-     * Note: this option is deprecated and will be eliminated in the
-     * future. Use of this option can cause problems with AML code that
-     * depends upon in-order immediate execution of module-level code.
-     */
-    AcpiNsExecModuleCodeList ();
-
-    /*
      * Update GPEs for any new _Lxx/_Exx methods. Ignore errors. The host is
      * responsible for discovering any new wake GPEs by running _PRW methods
      * that may have been loaded by this table.

Modified: head/sys/contrib/dev/acpica/components/tables/tbxfload.c
==============================================================================
--- head/sys/contrib/dev/acpica/components/tables/tbxfload.c	Tue Jul  9 17:18:24 2019	(r349862)
+++ head/sys/contrib/dev/acpica/components/tables/tbxfload.c	Tue Jul  9 18:02:36 2019	(r349863)
@@ -479,6 +479,13 @@ AcpiLoadTable (
     ACPI_INFO (("Host-directed Dynamic ACPI Table Load:"));
     Status = AcpiTbInstallAndLoadTable (ACPI_PTR_TO_PHYSADDR (Table),
         ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, FALSE, &TableIndex);
+    if (ACPI_SUCCESS (Status))
+    {
+        /* Complete the initialization/resolution of new objects */
+
+        AcpiNsInitializeObjects ();
+    }
+
     return_ACPI_STATUS (Status);
 }
 

Modified: head/sys/contrib/dev/acpica/components/utilities/utinit.c
==============================================================================
--- head/sys/contrib/dev/acpica/components/utilities/utinit.c	Tue Jul  9 17:18:24 2019	(r349862)
+++ head/sys/contrib/dev/acpica/components/utilities/utinit.c	Tue Jul  9 18:02:36 2019	(r349863)
@@ -342,7 +342,6 @@ AcpiUtInitGlobals (
 
     /* Namespace */
 
-    AcpiGbl_ModuleCodeList              = NULL;
     AcpiGbl_RootNode                    = NULL;
     AcpiGbl_RootNodeStruct.Name.Integer = ACPI_ROOT_NAME;
     AcpiGbl_RootNodeStruct.DescriptorType = ACPI_DESC_TYPE_NAMED;

Modified: head/sys/contrib/dev/acpica/components/utilities/utxfinit.c
==============================================================================
--- head/sys/contrib/dev/acpica/components/utilities/utxfinit.c	Tue Jul  9 17:18:24 2019	(r349862)
+++ head/sys/contrib/dev/acpica/components/utilities/utxfinit.c	Tue Jul  9 18:02:36 2019	(r349863)
@@ -381,24 +381,17 @@ AcpiInitializeObjects (
     ACPI_FUNCTION_TRACE (AcpiInitializeObjects);
 
 
+#ifdef ACPI_OBSOLETE_BEHAVIOR
     /*
-     * This case handles the legacy option that groups all module-level
-     * code blocks together and defers execution until all of the tables
-     * are loaded. Execute all of these blocks at this time.
-     * Execute any module-level code that was detected during the table
-     * load phase.
-     *
-     * Note: this option is deprecated and will be eliminated in the
-     * future. Use of this option can cause problems with AML code that
-     * depends upon in-order immediate execution of module-level code.
+     * 05/2019: Removed, initialization now happens at both object
+     * creation and table load time
      */
-    AcpiNsExecModuleCodeList ();
 
     /*
      * Initialize the objects that remain uninitialized. This
      * runs the executable AML that may be part of the
-     * declaration of these objects:

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190709235218.N1412>