Jump to content

Trying to load ADP1 IOReg object


takeawaydave
 Share

5 posts in this topic

Recommended Posts

I am trying to understand how SSDT hot patching works - done a lot of reading but the not quite there yet.

 

Basically I have a patched DSDT which will load the following:

 

 

1691743455_Screenshot2019-09-18at21_18_43.png.2e92ecd72d4887993cb9af0a1ee3b5eb.png

 

I used the Rehabman patch replacing AC with ADP1

 

          Device (ADP1)
            {
                Name (_HID, "ACPI0003")  // _HID: Hardware ID
                Method (_PCL, 0, NotSerialized)  // _PCL: Power Consumer List
                {
                    Return (Package (0x03)
                    {
                        _SB, 
                        BAT0, 
                        BAT1
                    })
                }
                Method (_PSR, 0, NotSerialized)  // _PSR: Power Source
                {
                    Store (ECG5 (), Local0)
                    And (Local0, One, Local0)
                    If (LNotEqual (Local0, PWRS))
                    {
                        Store (Local0, PWRS)
                        PNOT ()
                    }
                    Return (Local0)
                }
                Method (_STA, 0, NotSerialized)  // _STA: Status
                {
                    Return (0x0F)
                }
                Name (_PRW, Package (0x02)  // _PRW: Power Resources for Wake
                {
                    0x18, 
                    0x03
                })
            }


How do I create a SSDT Hotpatch for the same ? 

 

Example of SSDT-ADP1 hot patches such as shown below do not load on my system (EDIT: Ok, it loads but doesn't create the ADP1 Ioreg object) so I'd like understand what I currently don't.

 

DefinitionBlock ("", "SSDT", 2, "hack", "ADP1", 0x00000000)
{
    External (_SB_.ADP1, DeviceObj)    // (from opcode)
    Scope (\_SB.ADP1)
    {
        Name (_PRW, Package (0x02)  // _PRW: Power Resources for Wake
        {
            0x18, 
            0x03
        })
    }
}


Anyone able to explain how I would hot patch rather than load complete DSDT ?

 

 

 

 

 

Screenshot 2019-09-13 at 21.58.47.png

DSDT.aml.zip

Edited by takeawaydave
Link to comment
Share on other sites

@takeawaydave Looks like the patch should work, and you haven't done what I've said. 1) Rename AC__ to ADP1 in your config.plist, and 2) use SSDT-ADP1.aml.

1) will get you to have ADP1 instead of AC in your IOReg.

2) will make ACPIACAdapter attach to ADP1.

Here's how it works.

1) You have AC__ device in your DSDT, not ADP1. So you rename it either statically aka patch DSDT or via config.plist ACPI Rename.

2) Besides the name patch, there's also a content (Name (_PRW) to be added inside Device ADP1 (previously AC__). You add it statically by simply adding the content inside the device. With hotpatch, you add it via SSDT by declaring the scope and adding the patch content inside it. Here, scope means that the object ADP1 is at \_SB. With that alone, the SSDT does not know what kind of object it is. It is a device in the DSDT, so you declare it as a device object, or External(_SB.ADP1,DeviceObj).

Look up the hex of AC__ and ADP1 and apply the patch in your config file. Use Clover Configurator, Hackintool, iasl decompile method (with iasl -l DSDT.aml), or any other methods you can find, but please do it yourself as I've said in the previous reply.

  • Thanks 1
Link to comment
Share on other sites

 Share

×
×
  • Create New...