public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Marcin Juszkiewicz" <marcin.juszkiewicz@linaro.org>
To: devel@edk2.groups.io
Cc: Leif Lindholm <quic_llindhol@quicinc.com>,
	Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Graeme Gregory <graeme@xora.org.uk>,
	Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Subject: [edk2-devel] [PATCH edk2-platforms] SbsaQemu: move code outside of methods in DSDT
Date: Mon, 22 Apr 2024 10:51:45 +0200	[thread overview]
Message-ID: <20240422085145.1234981-1-marcin.juszkiewicz@linaro.org> (raw)

IASL complained that DSDT is not optimal:

Dsdt.iiii
83:             Name (RBUF, ResourceTemplate() {
Remark   2173 - Creation of named objects within a method is highly
inefficient, use globals or method local variables instead ^
(\_SB.USB0._CRS)

Dsdt.iiii
377:       Name (RBUF, ResourceTemplate () {
Remark   2173 - Creation of named objects within a method is highly
inefficient, use globals or method local variables instead ^
(\_SB.PCI0._CRS)
---
 Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl b/Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl
index b55ad6c5cc07..60c72fecc74f 100644
--- a/Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl
+++ b/Silicon/Qemu/SbsaQemu/AcpiTables/Dsdt.asl
@@ -77,13 +77,13 @@ DefinitionBlock ("DsdtTable.aml", "DSDT",
         Method (_STA) {
           Return (XHCI)
         }
+        Name (RBUF, ResourceTemplate() {
+            Memory32Fixed (ReadWrite,
+                           FixedPcdGet32 (PcdPlatformXhciBase),
+                           FixedPcdGet32 (PcdPlatformXhciSize))
+            Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 43 }
+        })
         Method (_CRS, 0x0, Serialized) {
-            Name (RBUF, ResourceTemplate() {
-                Memory32Fixed (ReadWrite,
-                               FixedPcdGet32 (PcdPlatformXhciBase),
-                               FixedPcdGet32 (PcdPlatformXhciSize))
-                Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive) { 43 }
-            })
             Return (RBUF)
         }
 
@@ -371,7 +371,6 @@ DefinitionBlock ("DsdtTable.aml", "DSDT",
       })
 
       // Root complex resources
-      Method (_CRS, 0, Serialized) {
       Name (RBUF, ResourceTemplate () {
         WordBusNumber ( // Bus numbers assigned to this root
         ResourceProducer,
@@ -418,10 +417,10 @@ DefinitionBlock ("DsdtTable.aml", "DSDT",
           FixedPcdGet32 (PcdPciIoSize),            // Length
           ,,,TypeTranslation
           )
-        }) // Name(RBUF)
-
+      }) // Name(RBUF)
+      Method (_CRS, 0, Serialized) {
         Return (RBUF)
-      } // Method(_CRS)
+      }
 
       Device (RES0)
       {
-- 
2.44.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118078): https://edk2.groups.io/g/devel/message/118078
Mute This Topic: https://groups.io/mt/105666235/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



             reply	other threads:[~2024-04-22  8:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-22  8:51 Marcin Juszkiewicz [this message]
2024-04-23 10:00 ` [edk2-devel] [PATCH edk2-platforms] SbsaQemu: move code outside of methods in DSDT Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240422085145.1234981-1-marcin.juszkiewicz@linaro.org \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox