From owner-svn-src-all@freebsd.org Thu Aug 1 13:54:52 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F3EEBE811; Thu, 1 Aug 2019 13:54:52 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45zsHG1g6Dz4g1Q; Thu, 1 Aug 2019 13:54:49 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 3DB0F21FBC; Thu, 1 Aug 2019 09:54:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 01 Aug 2019 09:54:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm3; bh=E 5aymkAzrMFVNqR2nlcRvmW41zl/dRvf5CI4g81ckR0=; b=U55dBLdaP3nu6MW2j IMg9baszBFkSrRgRx78awj1jM8pPyCwS3TYYXWyTpuchddurIgudbaoLJFA85rVQ buRMG9hrZ5cnTr0JGHRq8KtZCUelXTiMQzAaHysYwY0gVoAoqi+uOGX+qXMl4HKD MNeHwoSQV3Zt2gIn/TctbpgiFyrFl+XK7zE0XsZScRR7DY5zsE8Bzyr687AwbJBm q/ziKDFUPlCU8S7xu5+UyyZwgWSU9whFK8H3wToyn9DX2B9gDz94T9wVEy/R1Aay pLWvpQBUWkLz5wxunslutMcTL1sS1qNU12Osy2RZfrgTfOtG68KMqankskddJQD+ n/yHw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=E5aymkAzrMFVNqR2nlcRvmW41zl/dRvf5CI4g81ck R0=; b=C44HZAxVIrdQNXp7m2sXkX1JLzhyBJWrRvl84UZjctvoPOF/zjyzGBTQS ujrqSUsemkCYUmJLjR083pF96k7IuwNwONeUJpZsEZhG9Mg6VIcVThBDmC481wQR 3z07J0cltgMQChVVNbWAi5tYinl0CxyorbpU7bBpBRNM5N9CgrTMW4D/IGXxwAgF MdYOZTL6lp3PEVCIV7MhSlLA4PMEBjvvExCSd10xC74IqwSAULsGfUDCCWiUYN1Y P2E3WvdRkmmG19kBxShGvO+WNyVXnBDKTi9O4P+jv4OvkLZJI9XwKot6y21ingp1 hzpQ5JMGyUuOiSKtu2rpStsvQA8jw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrleejgdeikecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpegtggfuhfgjfffgkfhfvffosehtqhhmtdhhtdejnecuhfhrohhmpefutghothht ucfnohhnghcuoehstghothhtlhesshgrmhhstghordhorhhgqeenucffohhmrghinhepfh hrvggvsghsugdrohhrghenucfkphepkedrgeeirdekledrvddufeenucfrrghrrghmpehm rghilhhfrhhomhepshgtohhtthhlsehsrghmshgtohdrohhrghenucevlhhushhtvghruf hiiigvpedt X-ME-Proxy: Received: from [192.168.0.146] (unknown [8.46.89.213]) by mail.messagingengine.com (Postfix) with ESMTPA id ADD4D8005C; Thu, 1 Aug 2019 09:54:47 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: svn commit: r349863 - in head/sys/contrib/dev/acpica: . compiler components/dispatcher components/events components/executer components/namespace components/tables components/utilities include From: Scott Long In-Reply-To: <201907091802.x69I2bWv076792@repo.freebsd.org> Date: Thu, 1 Aug 2019 07:54:46 -0600 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201907091802.x69I2bWv076792@repo.freebsd.org> To: Jung-uk Kim X-Mailer: Apple Mail (2.3445.104.11) X-Rspamd-Queue-Id: 45zsHG1g6Dz4g1Q X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=samsco.org header.s=fm3 header.b=U55dBLda; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=C44HZAxV; dmarc=none; spf=pass (mx1.freebsd.org: domain of scottl@samsco.org designates 66.111.4.27 as permitted sender) smtp.mailfrom=scottl@samsco.org X-Spamd-Result: default: False [-5.56 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[samsco.org:s=fm3,messagingengine.com:s=fm3]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:66.111.4.27]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MV_CASE(0.50)[]; DMARC_NA(0.00)[samsco.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[samsco.org:+,messagingengine.com:+]; MX_GOOD(-0.01)[in2-smtp.messagingengine.com,in1-smtp.messagingengine.com,in2-smtp.messagingengine.com,in1-smtp.messagingengine.com,in2-smtp.messagingengine.com,in1-smtp.messagingengine.com,in2-smtp.messagingengine.com,in1-smtp.messagingengine.com]; NEURAL_HAM_SHORT(-0.99)[-0.989,0]; IP_SCORE(-3.46)[ip: (-9.78), ipnet: 66.111.4.0/24(-4.80), asn: 11403(-2.68), country: US(-0.05)]; RCVD_IN_DNSWL_LOW(-0.10)[27.4.111.66.list.dnswl.org : 127.0.5.1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2019 13:54:52 -0000 Hi, I need to ask that this be backed out. I have two systems that are = failing to boot when this revision is present. One I can=E2=80=99t debug = because it causes USB to fail to probe, leaving me without a working console (and no = network access for other reasons). The other fails in a different way and = livelocks the system: ixl1: flags=3D8843 metric 0 mtu = 1500 = options=3De507bb ether ac:1f:6b:0a:4a:57 media: Ethernet autoselect (1000baseT ) status: active nd6 options=3D29 Starting devd. Here the boot hangs. If I hit Ctrl-C, I get this: ^CACPI Error: AE_ERROR, Thread 100315 could not acquire Mutex = [ACPI_MTX_Namespace] (0x1) (20190703/utmutex-434) ACPI Error: AE_ERROR, Thread 100315 could not acquire Mutex = [ACPI_MTX_Namespace] (0x1) (20190703/utmutex-434) ACPI Error: AE_ERROR, Thread 100315 could not acquire Mutex = [ACPI_MTX_Namespace] (0x1) (20190703/utmutex-434) Breaking into DDB gives this: db> bt Tracing pid 11 tid 100012 td 0xfffff800038a85a0 acpi_cpu_idle_mwait() at acpi_cpu_idle_mwait+0x70/frame = 0xfffffe00005a4180 acpi_cpu_idle() at acpi_cpu_idle+0x183/frame 0xfffffe00005a41d0 cpu_idle_acpi() at cpu_idle_acpi+0x3f/frame 0xfffffe00005a41f0 cpu_idle() at cpu_idle+0xa6/frame 0xfffffe00005a4210 sched_idletd() at sched_idletd+0x442/frame 0xfffffe00005a42f0 fork_exit() at fork_exit+0x83/frame 0xfffffe00005a4330 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00005a4330 --- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- db> ps pid ppid pgrp uid state wmesg wchan cmd 401 399 59 0 S+ piperd 0xfffff80005214000 sort 400 399 59 0 S+ acmtx 0xfffff80003770280 devmatch =E2=80=A6 100247 S acmtx 0xfffff80003770280 [usbus0] ... db> bt 100315 Thread 100315 not found db> bt 400 Tracing pid 400 tid 100339 td 0xfffff8002a52c5a0 sched_switch() at sched_switch+0x64a/frame 0xfffffe00b4c21d20 mi_switch() at mi_switch+0xe2/frame 0xfffffe00b4c21d50 sleepq_catch_signals() at sleepq_catch_signals+0x425/frame = 0xfffffe00b4c21da0 sleepq_wait_sig() at sleepq_wait_sig+0xf/frame 0xfffffe00b4c21dd0 _sleep() at _sleep+0x1bf/frame 0xfffffe00b4c21e50 AcpiOsAcquireMutex() at AcpiOsAcquireMutex+0xab/frame 0xfffffe00b4c21ea0 AcpiUtAcquireMutex() at AcpiUtAcquireMutex+0x3d/frame 0xfffffe00b4c21ee0 AcpiGetObjectInfo() at AcpiGetObjectInfo+0x51/frame 0xfffffe00b4c21f60 acpi_child_pnpinfo_str_method() at = acpi_child_pnpinfo_str_method+0x24/frame 0xfffffe00b4c21f90 sysctl_devices() at sysctl_devices+0x215/frame 0xfffffe00b4c21fe0 sysctl_root_handler_locked() at sysctl_root_handler_locked+0x8b/frame = 0xfffffe00b4c22020 sysctl_root() at sysctl_root+0x24d/frame 0xfffffe00b4c220a0 userland_sysctl() at userland_sysctl+0x17a/frame 0xfffffe00b4c22150 sys___sysctl() at sys___sysctl+0x5f/frame 0xfffffe00b4c22200 amd64_syscall() at amd64_syscall+0x3b0/frame 0xfffffe00b4c22330 fast_syscall_common() at fast_syscall_common+0x101/frame = 0xfffffe00b4c22330 --- syscall (202, FreeBSD ELF64, sys___sysctl), rip =3D 0x80041cb2a, rsp = =3D 0x7fffffffda78, rbp =3D 0x7fffffffdab0 --- db> bt 100247 Tracing pid 45 tid 100247 td 0xfffff800077045a0 sched_switch() at sched_switch+0x64a/frame 0xfffffe00a7f76dc0 mi_switch() at mi_switch+0xe2/frame 0xfffffe00a7f76df0 sleepq_catch_signals() at sleepq_catch_signals+0x425/frame = 0xfffffe00a7f76e40 sleepq_wait_sig() at sleepq_wait_sig+0xf/frame 0xfffffe00a7f76e70 _sleep() at _sleep+0x1bf/frame 0xfffffe00a7f76ef0 AcpiOsAcquireMutex() at AcpiOsAcquireMutex+0xab/frame 0xfffffe00a7f76f40 AcpiUtAcquireMutex() at AcpiUtAcquireMutex+0x3d/frame 0xfffffe00a7f76f80 AcpiNsGetNode() at AcpiNsGetNode+0x27/frame 0xfffffe00a7f77020 AcpiNsEvaluate() at AcpiNsEvaluate+0x1a7/frame 0xfffffe00a7f77060 AcpiEvaluateObject() at AcpiEvaluateObject+0x196/frame = 0xfffffe00a7f770c0 acpi_GetInteger() at acpi_GetInteger+0x3f/frame 0xfffffe00a7f77120 acpi_get_domain() at acpi_get_domain+0x92/frame 0xfffffe00a7f77170 device_attach() at device_attach+0x2e7/frame 0xfffffe00a7f771c0 device_probe_and_attach() at device_probe_and_attach+0x42/frame = 0xfffffe00a7f771f0 usb_probe_and_attach() at usb_probe_and_attach+0x282/frame = 0xfffffe00a7f77280 usb_bus_attach() at usb_bus_attach+0x1b3/frame 0xfffffe00a7f772b0 usb_process() at usb_process+0xf5/frame 0xfffffe00a7f772f0 fork_exit() at fork_exit+0x83/frame 0xfffffe00a7f77330 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe00a7f77330 --- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- db>=20 It looks like there=E2=80=99s a leaked mutex inside of ACPI. Not sure what=E2=80=99s up with thread 100315, but thread 400 is a dead give-away. If I revert the 20190703 ACPICA import then everything is fine. I don=E2=80=99t know yet if this is the same = problem on my first system, but both work fine without this revision, and the hung usb thread is also very telling. Please consider reverting this from HEAD while we debug it further. Thanks, Scott > On Jul 9, 2019, at 12:02 PM, Jung-uk Kim wrote: >=20 > Author: jkim > Date: Tue Jul 9 18:02:36 2019 > New Revision: 349863 > URL: https://svnweb.freebsd.org/changeset/base/349863 >=20 > Log: > MFV: r349861 >=20 > Import ACPICA 20190703. >=20 > 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) >=20 > Modified: head/sys/contrib/dev/acpica/changes.txt > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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=20 > +of the legacy module-level code executions. Since we no longer = support=20 > +this option, this is essentially dead code and has been removed from = the=20 > +ACPICA source. > + > +iASL: ensure that _WAK, _PTS, _TTS, and _Sx are declared only at the = root=20 > +scope. If these named objects are declared outside the root scope, = they=20 > +will not be invoked by any host Operating System. > + > +Clear status of GPEs on first direct enable. ACPI GPEs (other than = the EC=20 > +one) can be enabled in two situations. First, the GPEs with existing = _Lxx=20 > +and _Exx methods are enabled implicitly by ACPICA during system=20 > +initialization. Second, the GPEs without these methods (like GPEs = listed=20 > +by _PRW objects for wakeup devices) need to be enabled directly by = the=20 > +code that is going to use them (e.g. ACPI power management or device=20= > +drivers). > + > +In the former case, if the status of a given GPE is set to start = with,=20 > +its handler method (either _Lxx or _Exx) needs to be invoked to take = care=20 > +of the events (possibly) signaled before the GPE was enabled. In the=20= > +latter case, however, the first caller of AcpiEnableGpe() for a given = GPE=20 > +should not be expected to care about any events that might be = signaled=20 > +through it earlier. In that case, it is better to clear the status = of=20 > +the GPE before enabling it, to prevent stale events from triggering=20= > +unwanted actions (like spurious system resume, for example). > + > +For this reason, modify AcpiEvAddGpeReference() to take an additional=20= > +boolean argument indicating whether or not the GPE status needs to be=20= > +cleared when its reference counter changes from zero to one and make=20= > +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=20= > +project files have been upgraded. The new project files appear in the=20= > +directory \acpica\generate\msvc2017. This change effectively = deprecates=20 > +the older project files in \acpica\generate\msvc9. > + > +iASL: ensure that _WAK, _PTS, _TTS, and _Sx are declared only at the = root=20 > +scope. If these named objects are declared outside the root scope, = they=20 > +will not be invoked by any host Operating System > + > +---------------------------------------- > 09 May 2019. Summary of changes for version 20190509: >=20 >=20 >=20 > Modified: head/sys/contrib/dev/acpica/compiler/asldefine.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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 =3D = TRUE; > #define COMMENT_CAPTURE_OFF AslGbl_CommentState.CaptureComments =3D = FALSE; >=20 > +/* > + * 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 */ >=20 > Modified: head/sys/contrib/dev/acpica/compiler/aslglobal.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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" > }; >=20 > +const char *AslGbl_SpecialNamedObjects = [MAX_SPECIAL_NAMES] =3D > +{ > + 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 > + >=20 >=20 > /* >=20 > Modified: head/sys/contrib/dev/acpica/compiler/aslload.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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 @@ >=20 > static ACPI_STATUS > LdLoadFieldElements ( > + UINT32 AmlType, > ACPI_PARSE_OBJECT *Op, > ACPI_WALK_STATE *WalkState); >=20 > @@ -190,6 +191,10 @@ LdCommonNamespaceEnd ( > UINT32 Level, > void *Context); >=20 > +static void > +LdCheckSpecialNames ( > + ACPI_NAMESPACE_NODE *Node, > + ACPI_PARSE_OBJECT *Op); >=20 > = /*************************************************************************= ****** > * > @@ -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 ( >=20 > static ACPI_STATUS > LdLoadFieldElements ( > + UINT32 AmlType, > ACPI_PARSE_OBJECT *Op, > ACPI_WALK_STATE *WalkState) > { > @@ -274,7 +281,7 @@ LdLoadFieldElements ( > { > Status =3D 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 =3D=3D AE_NOT_FOUND) > { > @@ -507,11 +514,15 @@ LdNamespace1Begin ( > */ > switch (Op->Asl.AmlOpcode) > { > - case AML_BANK_FIELD_OP: > case AML_INDEX_FIELD_OP: > + > + Status =3D LdLoadFieldElements (ACPI_TYPE_LOCAL_REGION_FIELD, = Op, WalkState); > + return (Status); > + > + case AML_BANK_FIELD_OP: > case AML_FIELD_OP: >=20 > - Status =3D LdLoadFieldElements (Op, WalkState); > + Status =3D LdLoadFieldElements (ACPI_TYPE_REGION, Op, = WalkState); > return (Status); >=20 > case AML_INT_CONNECTION_OP: > @@ -966,6 +977,10 @@ LdNamespace1Begin ( > } > } >=20 > + /* Check special names like _WAK and _PTS */ > + > + LdCheckSpecialNames (Node, Op); > + > if (ForceNewScope) > { > Status =3D AcpiDsScopeStackPush (Node, ObjectType, WalkState); > @@ -1001,6 +1016,42 @@ FinishNode: > } >=20 > 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 =3D 0; i < MAX_SPECIAL_NAMES; i++) > + { > + if (ACPI_COMPARE_NAMESEG(Node->Name.Ascii, = AslGbl_SpecialNamedObjects[i]) && > + Node->Parent !=3D AcpiGbl_RootNode) > + { > + AslError (ASL_ERROR, ASL_MSG_INVALID_SPECIAL_NAME, Op, = Op->Asl.ExternalName); > + return; > + } > + } > } >=20 >=20 >=20 > Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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 = [] =3D > /* 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" > }; >=20 > /* Table compiler */ >=20 > Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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, >=20 > /* These messages are used by the Data Table compiler only */ >=20 >=20 > Modified: head/sys/contrib/dev/acpica/compiler/aslstubs.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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) >=20 > Modified: head/sys/contrib/dev/acpica/compiler/aslsupport.l > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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 ( >=20 > while ((c =3D input()) !=3D '\n' && c !=3D EOF) > { > - *AslGbl_LineBufPtr =3D c; > + *AslGbl_LineBufPtr =3D (char) c; > AslGbl_LineBufPtr++; > } > *AslGbl_LineBufPtr =3D 0; > @@ -498,7 +498,7 @@ AslInsertLineBuffer ( >=20 > if (AcpiGbl_CaptureComments) > { > - CvProcessCommentState (SourceChar); > + CvProcessCommentState ((char) SourceChar); > } > } > } > @@ -601,7 +601,7 @@ loop: > AslInsertLineBuffer (c); > if (AcpiGbl_CaptureComments && CurrentState.CaptureComments) > { > - *StringBuffer =3D c; > + *StringBuffer =3D (char) c; > ++StringBuffer; > } > c1 =3D c; > @@ -629,7 +629,7 @@ loop: > AslInsertLineBuffer (c); > if (AcpiGbl_CaptureComments && CurrentState.CaptureComments) > { > - *StringBuffer =3D c; > + *StringBuffer =3D (char) c; > ++StringBuffer; > } >=20 > @@ -720,7 +720,7 @@ AslDoCommentType2 ( > AslInsertLineBuffer (c); > if (AcpiGbl_CaptureComments && CurrentState.CaptureComments) > { > - *StringBuffer =3D c; > + *StringBuffer =3D (char) c; > ++StringBuffer; > } > } > @@ -878,7 +878,7 @@ DoCharacter: > if (ACPI_IS_OCTAL_DIGIT (StringChar)) > { > State =3D ASL_OCTAL_CONSTANT; > - ConvertBuffer[0] =3D StringChar; > + ConvertBuffer[0] =3D (char) StringChar; > i =3D 1; > continue; > } > @@ -934,7 +934,7 @@ DoCharacter: >=20 > /* Append another digit of the constant */ >=20 > - ConvertBuffer[i] =3D StringChar; > + ConvertBuffer[i] =3D (char) StringChar; > i++; > continue; >=20 > @@ -978,7 +978,7 @@ DoCharacter: >=20 > /* Append another digit of the constant */ >=20 > - ConvertBuffer[i] =3D StringChar; > + ConvertBuffer[i] =3D (char) StringChar; > i++; > continue; >=20 > @@ -989,7 +989,7 @@ DoCharacter: >=20 > /* Save the finished character */ >=20 > - *StringBuffer =3D StringChar; > + *StringBuffer =3D (char) StringChar; > StringBuffer++; > if (StringBuffer >=3D EndBuffer) > { >=20 > Modified: head/sys/contrib/dev/acpica/components/dispatcher/dsinit.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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")); > } >=20 > /* Summary of objects initialized */ >=20 > Modified: head/sys/contrib/dev/acpica/components/events/evgpe.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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 ( >=20 > ACPI_STATUS > AcpiEvAddGpeReference ( > - ACPI_GPE_EVENT_INFO *GpeEventInfo) > + ACPI_GPE_EVENT_INFO *GpeEventInfo, > + BOOLEAN ClearOnEnable) > { > ACPI_STATUS Status =3D AE_OK; >=20 > @@ -343,6 +345,11 @@ AcpiEvAddGpeReference ( > if (GpeEventInfo->RuntimeCount =3D=3D 1) > { > /* Enable on first reference */ > + > + if (ClearOnEnable) > + { > + (void) AcpiHwClearGpe (GpeEventInfo); > + } >=20 > Status =3D AcpiEvUpdateGpeEnableMask (GpeEventInfo); > if (ACPI_SUCCESS (Status)) >=20 > Modified: head/sys/contrib/dev/acpica/components/events/evgpeblk.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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; > } >=20 > - Status =3D AcpiEvAddGpeReference (GpeEventInfo); > + Status =3D AcpiEvAddGpeReference (GpeEventInfo, FALSE); > if (ACPI_FAILURE (Status)) > { > ACPI_EXCEPTION ((AE_INFO, Status, >=20 > Modified: head/sys/contrib/dev/acpica/components/events/evxface.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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 */ >=20 > Modified: head/sys/contrib/dev/acpica/components/events/evxfgpe.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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) !=3D > ACPI_GPE_DISPATCH_NONE) > { > - Status =3D AcpiEvAddGpeReference (GpeEventInfo); > + Status =3D AcpiEvAddGpeReference (GpeEventInfo, TRUE); > if (ACPI_SUCCESS (Status) && > ACPI_GPE_IS_POLLING_NEEDED (GpeEventInfo)) > { >=20 > Modified: head/sys/contrib/dev/acpica/components/executer/exconfig.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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); > } >=20 > - /* Complete the initialization/resolution of package objects */ > + /* Complete the initialization/resolution of new objects */ >=20 > - Status =3D AcpiNsWalkNamespace (ACPI_TYPE_PACKAGE, = ACPI_ROOT_OBJECT, > - ACPI_UINT32_MAX, 0, AcpiNsInitOnePackage, NULL, NULL, NULL); > + AcpiNsInitializeObjects (); >=20 > /* Parameter Data (optional) */ >=20 > @@ -620,10 +619,11 @@ AcpiExLoadOp ( > return_ACPI_STATUS (Status); > } >=20 > - /* Complete the initialization/resolution of package objects */ > + /* Complete the initialization/resolution of new objects */ >=20 > - Status =3D AcpiNsWalkNamespace (ACPI_TYPE_PACKAGE, = ACPI_ROOT_OBJECT, > - ACPI_UINT32_MAX, 0, AcpiNsInitOnePackage, NULL, NULL, NULL); > + AcpiExExitInterpreter (); > + AcpiNsInitializeObjects (); > + AcpiExEnterInterpreter (); >=20 > /* Store the DdbHandle into the Target operand */ >=20 >=20 > Modified: head/sys/contrib/dev/acpica/components/namespace/nsaccess.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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 =3D NULL; > ACPI_NAMESPACE_NODE *NewNode; > + ACPI_NAMESPACE_NODE *PrevNode =3D NULL; > ACPI_OPERAND_OBJECT *ObjDesc; > ACPI_STRING Val =3D NULL; >=20 > @@ -213,13 +214,30 @@ AcpiNsRootInitialize ( > */ > AcpiGbl_RootNode =3D &AcpiGbl_RootNodeStruct; >=20 > - /* Enter the pre-defined names in the name table */ > + /* Enter the predefined names in the name table */ >=20 > ACPI_DEBUG_PRINT ((ACPI_DB_INFO, > "Entering predefined entries into namespace\n")); >=20 > + /* > + * 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 =3D 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 =3D AcpiGbl_PreDefinedNames; InitVal->Name; = InitVal++) > { > + Status =3D AE_OK; > + > /* _OSI is optional for now, will be permanent later */ >=20 > if (!strcmp (InitVal->Name, "_OSI") && = !AcpiGbl_CreateOsiMethod) > @@ -227,17 +245,35 @@ AcpiNsRootInitialize ( > continue; > } >=20 > - Status =3D 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 =3D ACPI_ALLOCATE_ZEROED (sizeof = (ACPI_NAMESPACE_NODE)); > + if (!NewNode) > { > - ACPI_EXCEPTION ((AE_INFO, Status, > - "Could not create predefined name %s", > - InitVal->Name)); > - continue; > + Status =3D AE_NO_MEMORY; > + goto UnlockAndExit; > } >=20 > + ACPI_COPY_NAMESEG (NewNode->Name.Ascii, InitVal->Name); > + NewNode->DescriptorType =3D ACPI_DESC_TYPE_NAMED; > + NewNode->Type =3D InitVal->Type; > + > + if (!PrevNode) > + { > + AcpiGbl_RootNodeStruct.Child =3D NewNode; > + } > + else > + { > + PrevNode->Peer =3D NewNode; > + } > + > + NewNode->Parent =3D &AcpiGbl_RootNodeStruct; > + PrevNode =3D NewNode; > + > /* > * Name entered successfully. If entry in PreDefinedNames[] = specifies > * an initial value, create the initial value. > @@ -286,7 +322,7 @@ AcpiNsRootInitialize ( >=20 > NewNode->Value =3D ObjDesc->Method.ParamCount; > #else > - /* Mark this as a very SPECIAL method */ > + /* Mark this as a very SPECIAL method (_OSI) */ >=20 > ObjDesc->Method.InfoFlags =3D = ACPI_METHOD_INTERNAL_ONLY; > ObjDesc->Method.Dispatch.Implementation =3D = AcpiUtOsiImplementation; > @@ -358,7 +394,6 @@ AcpiNsRootInitialize ( > AcpiUtRemoveReference (ObjDesc); > } > } > - >=20 > UnlockAndExit: > (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); >=20 > Modified: head/sys/contrib/dev/acpica/components/namespace/nseval.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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") >=20 > -/* Local prototypes */ >=20 > -static void > -AcpiNsExecModuleCode ( > - ACPI_OPERAND_OBJECT *MethodObj, > - ACPI_EVALUATE_INFO *Info); > - > - > = /*************************************************************************= ****** > * > * FUNCTION: AcpiNsEvaluate > @@ -464,207 +457,4 @@ Cleanup: > ACPI_FREE (Info->FullPathname); > Info->FullPathname =3D 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 =3D 0; > - > - > - ACPI_FUNCTION_TRACE (NsExecModuleCodeList); > - > - > - /* Exit now if the list is empty */ > - > - Next =3D 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 =3D ACPI_ALLOCATE (sizeof (ACPI_EVALUATE_INFO)); > - if (!Info) > - { > - return_VOID; > - } > - > - /* Walk the list, executing each "method" */ > - > - while (Next) > - { > - Prev =3D Next; > - Next =3D Next->Method.Mutex; > - > - /* Clear the link field and execute the method */ > - > - Prev->Method.Mutex =3D 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 =3D 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 =3D ACPI_CAST_PTR ( > - ACPI_NAMESPACE_NODE, MethodObj->Method.NextObject); > - Type =3D 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 =3D=3D ACPI_TYPE_DEVICE) && ParentNode->Object) > - { > - MethodObj->Method.Dispatch.Handler =3D > - ParentNode->Object->Device.Handler; > - } > - > - /* Must clear NextObject (AcpiNsAttachObject needs the field) */ > - > - MethodObj->Method.NextObject =3D NULL; > - > - /* Initialize the evaluation information block */ > - > - memset (Info, 0, sizeof (ACPI_EVALUATE_INFO)); > - Info->PrefixNode =3D 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 =3D AcpiNsGetAttachedObject (ParentNode); > - if (ParentObj) > - { > - AcpiUtAddReference (ParentObj); > - } > - > - /* Install the method (module-level code) in the parent node */ > - > - Status =3D AcpiNsAttachObject (ParentNode, MethodObj, = ACPI_TYPE_METHOD); > - if (ACPI_FAILURE (Status)) > - { > - goto Exit; > - } > - > - /* Execute the parent node as a control method */ > - > - Status =3D 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 =3D AcpiNsAttachObject (ParentNode, ParentObj, Type); > - } > - else > - { > - ParentNode->Type =3D (UINT8) Type; > - } > - > -Exit: > - if (ParentObj) > - { > - AcpiUtRemoveReference (ParentObj); > - } > - return_VOID; > } >=20 > Modified: head/sys/contrib/dev/acpica/components/namespace/nsinit.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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: ")); >=20 > - /* Set all init info to zero */ > + /* Clear the info block */ >=20 > memset (&Info, 0, sizeof (ACPI_INIT_WALK_INFO)); >=20 > /* Walk entire namespace from the supplied root */ >=20 > + /* > + * TBD: will become ACPI_TYPE_PACKAGE as this type object > + * is now the only one that supports deferred initialization > + * (forward references). > + */ > Status =3D 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")); > } >=20 > 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)); >=20 > ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, > "%u Control Methods found\n%u Op Regions found\n", > @@ -561,35 +562,19 @@ AcpiNsInitOneObject ( > AcpiExEnterInterpreter (); >=20 > /* > - * 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: >=20 > - Info->OpRegionInit++; > - Status =3D AcpiDsGetRegionArguments (ObjDesc); > - break; > + /* TBD: BankFields do not require deferred init, remove this = code */ >=20 > - case ACPI_TYPE_BUFFER_FIELD: > - > Info->FieldInit++; > - Status =3D AcpiDsGetBufferFieldArguments (ObjDesc); > - break; > - > - case ACPI_TYPE_LOCAL_BANK_FIELD: > - > - Info->FieldInit++; > Status =3D AcpiDsGetBankFieldArguments (ObjDesc); > break; >=20 > - case ACPI_TYPE_BUFFER: > - > - Info->BufferInit++; > - Status =3D AcpiDsGetBufferArguments (ObjDesc); > - break; > - > case ACPI_TYPE_PACKAGE: >=20 > /* Complete the initialization/resolution of the package = object */ > @@ -600,8 +585,12 @@ AcpiNsInitOneObject ( >=20 > default: >=20 > - /* No other types can get here */ > + /* No other types should get here */ >=20 > + Status =3D AE_TYPE; > + ACPI_EXCEPTION ((AE_INFO, Status, > + "Opcode is not deferred [%4.4s] (%s)", > + AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Type))); > break; > } >=20 >=20 > Modified: head/sys/contrib/dev/acpica/components/namespace/nsload.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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")); >=20 > - /* > - * 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); > } >=20 >=20 > Modified: head/sys/contrib/dev/acpica/components/namespace/nsutils.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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; >=20 >=20 > ACPI_FUNCTION_TRACE (NsTerminate); >=20 > - > - /* Delete any module-level code blocks */ > - > - Next =3D AcpiGbl_ModuleCodeList; > - while (Next) > - { > - Prev =3D Next; > - Next =3D Next->Method.Mutex; > - Prev->Method.Mutex =3D NULL; /* Clear the Mutex (cheated) = field */ > - AcpiUtRemoveReference (Prev); > - } >=20 > /* > * Free the entire namespace -- all nodes and all objects >=20 > Modified: head/sys/contrib/dev/acpica/components/tables/tbdata.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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 =3D AcpiNsLoadTable (TableIndex, ParentNode); >=20 > /* > - * 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. >=20 > Modified: head/sys/contrib/dev/acpica/components/tables/tbxfload.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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 =3D 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); > } >=20 >=20 > Modified: head/sys/contrib/dev/acpica/components/utilities/utinit.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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 ( >=20 > /* Namespace */ >=20 > - AcpiGbl_ModuleCodeList =3D NULL; > AcpiGbl_RootNode =3D NULL; > AcpiGbl_RootNodeStruct.Name.Integer =3D ACPI_ROOT_NAME; > AcpiGbl_RootNodeStruct.DescriptorType =3D ACPI_DESC_TYPE_NAMED; >=20 > Modified: head/sys/contrib/dev/acpica/components/utilities/utxfinit.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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); >=20 >=20 > +#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 (); >=20 > /* > * Initialize the objects that remain uninitialized. This > * runs the executable AML that may be part of the > - * declaration of these objects: >=20 > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >=20