public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH edk2-platforms] SbsaQemu: move code outside of methods in DSDT
@ 2024-04-22  8:51 Marcin Juszkiewicz
  2024-04-23 10:00 ` Gerd Hoffmann
  0 siblings, 1 reply; 2+ messages in thread
From: Marcin Juszkiewicz @ 2024-04-22  8:51 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Ard Biesheuvel, Graeme Gregory, Marcin Juszkiewicz

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]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-23 10:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-22  8:51 [edk2-devel] [PATCH edk2-platforms] SbsaQemu: move code outside of methods in DSDT Marcin Juszkiewicz
2024-04-23 10:00 ` Gerd Hoffmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox