Contribute
Register

[Guide] Using Clover to "hotpatch" ACPI

And at your post, I found this, is that a typing mistake? <Find> is same as <Replace>.

I will look for and correct the typo.
 
Hello Rehabman,
Thanks for this awesome guide.

Am trying to implement this kind of code in my SSDT-HACK:
Code:
Method(GPRW, 2)
{
    If (0x6d == Arg0) { Return(Package() { 0x6d, 0, }) }
    External(\XPRW, MethodObj)
    Return(XPRW(Arg0, Arg1))
}

but in my case, I have name instead method:
Code:
Name (_PRW, Package (0x02)
{
   0x0D,
   0x03
})

Can you please post a example?

Thanks in advance.
 
Hello Rehabman,
Thanks for this awesome guide.

Am trying to implement this kind of code in my SSDT-HACK:
Code:
Method(GPRW, 2)
{
    If (0x6d == Arg0) { Return(Package() { 0x6d, 0, }) }
    External(\XPRW, MethodObj)
    Return(XPRW(Arg0, Arg1))
}

but in my case, I have name instead method:
Code:
Name (_PRW, Package (0x02)
{
   0x0D,
   0x03
})

Can you please post a example?

Thanks in advance.

Look at the mixed listing to determine the byte pattern of that code.
 
Yes, Am using this:
Code:
       4:                      Name (_PRW, Package (0x02)
       5:                      {
       6:                      0x0D,
       7:                      0x03
       8:                      })

00000024:  08 5F 50 52 57 .........    "._PRW"
00000029:  12 06 02 0A 0D 0A 03 ...    "......."

      10:                      Name (_PRW, Package (0x02)
      11:                      {
      12:                      0x0D,
      13:                      Zero
      14:                      })

00000030:  08 5F 50 52 57 .........    "._PRW"
00000035:  12 05 02 0A 0D 00 ......    "......"

to hot patch DSDT with Clover for now, but would like to know if i can implement your method to redirect _PRW calls into SSDT.
 
Last edited:
Yes, Am using this:
Code:
       4:                      Name (_PRW, Package (0x02)
       5:                      {
       6:                      0x0D,
       7:                      0x03
       8:                      })

00000024:  08 5F 50 52 57 .........    "._PRW"
00000029:  12 06 02 0A 0D 0A 03 ...    "......."

      10:                      Name (_PRW, Package (0x02)
      11:                      {
      12:                      0x0D,
      13:                      Zero
      14:                      })

00000030:  08 5F 50 52 57 .........    "._PRW"
00000035:  12 05 02 0A 0D 00 ......    "......"

to hot patch DSDT with Clover for now, but would like to know if i can implement your method to redirect _PRW calls into SSDT.

No need for SSDT. Simple Find/Replace:

Find: 08 5F 50 52 57 12 06 02 0A 0D 0A 03
Replace: 08 5F 50 52 57 12 06 02 0A 0D 0A 00
 
Hello RM, regarding to SSDT-HACK in your HP ENVY repo, can you please explain the purpose to modify the _Q10 and _Q11 methods?
Thanks.

Code:
Method (_Q11, 0, NotSerialized) // _Qxx: EC Query
{
External(\_PR.CPU0, DeviceObj)
External(\_PR.CPU1, DeviceObj)
External(\_PR.CPU2, DeviceObj)
External(\_PR.CPU3, DeviceObj)
External(\_PR.CPU4, DeviceObj)
External(\_PR.CPU5, DeviceObj)
External(\_PR.CPU6, DeviceObj)
External(\_PR.CPU7, DeviceObj)
External(\_PR.CPU0._PPC, IntObj)
Subtract (NPS, One, NPS)
If (CondRefOf (\_PR.CPU0._PPC, Local0))
{
Store (NPS, \_PR.CPU0._PPC)
Notify (\_PR.CPU0, 0x80)
}
If (CondRefOf (\_PR.CPU1._PPC, Local0))
{
//Store (NPS, \_PR.CPU1._PPC)
Notify (\_PR.CPU1, 0x80)
}
If (CondRefOf (\_PR.CPU2._PPC, Local0))
{
//Store (NPS, \_PR.CPU2._PPC)
Notify (\_PR.CPU2, 0x80)
}
If (CondRefOf (\_PR.CPU3._PPC, Local0))
{
//Store (NPS, \_PR.CPU3._PPC)
Notify (\_PR.CPU3, 0x80)
}
If (CondRefOf (\_PR.CPU4._PPC, Local0))
{
//Store (NPS, \_PR.CPU4._PPC)
Notify (\_PR.CPU4, 0x80)
}
If (CondRefOf (\_PR.CPU5._PPC, Local0))
{
//Store (NPS, \_PR.CPU5._PPC)
Notify (\_PR.CPU5, 0x80)
}
If (CondRefOf (\_PR.CPU6._PPC, Local0))
{
//Store (NPS, \_PR.CPU6._PPC)
Notify (\_PR.CPU6, 0x80)
}
If (CondRefOf (\_PR.CPU7._PPC, Local0))
{
//Store (NPS, \_PR.CPU7._PPC)
Notify (\_PR.CPU7, 0x80)
}
}
Method (_Q10, 0, NotSerialized) // _Qxx: EC Query
{
Add (NPS, One, NPS)
If (CondRefOf (\_PR.CPU0._PPC, Local0))
{
Store (NPS, \_PR.CPU0._PPC)
Notify (\_PR.CPU0, 0x80)
}
If (CondRefOf (\_PR.CPU1._PPC, Local0))
{
//Store (NPS, \_PR.CPU1._PPC)
Notify (\_PR.CPU1, 0x80)
}
If (CondRefOf (\_PR.CPU2._PPC, Local0))
{
//Store (NPS, \_PR.CPU2._PPC)
Notify (\_PR.CPU2, 0x80)
}
If (CondRefOf (\_PR.CPU3._PPC, Local0))
{
//Store (NPS, \_PR.CPU3._PPC)
Notify (\_PR.CPU3, 0x80)
}
If (CondRefOf (\_PR.CPU4._PPC, Local0))
{
//Store (NPS, \_PR.CPU4._PPC)
Notify (\_PR.CPU4, 0x80)
}
If (CondRefOf (\_PR.CPU5._PPC, Local0))
{
//Store (NPS, \_PR.CPU5._PPC)
Notify (\_PR.CPU5, 0x80)
}
If (CondRefOf (\_PR.CPU6._PPC, Local0))
{
//Store (NPS, \_PR.CPU6._PPC)
Notify (\_PR.CPU6, 0x80)
}
If (CondRefOf (\_PR.CPU7._PPC, Local0))
{
Notify (\_PR.CPU7, 0x80)
}
}
 
Hello RM, regarding to SSDT-HACK in your HP ENVY repo, can you please explain the purpose to modify the _Q10 and _Q11 methods?
Thanks.

Code:
Method (_Q11, 0, NotSerialized) // _Qxx: EC Query
{
External(\_PR.CPU0, DeviceObj)
External(\_PR.CPU1, DeviceObj)
External(\_PR.CPU2, DeviceObj)
External(\_PR.CPU3, DeviceObj)
External(\_PR.CPU4, DeviceObj)
External(\_PR.CPU5, DeviceObj)
External(\_PR.CPU6, DeviceObj)
External(\_PR.CPU7, DeviceObj)
External(\_PR.CPU0._PPC, IntObj)
Subtract (NPS, One, NPS)
If (CondRefOf (\_PR.CPU0._PPC, Local0))
{
Store (NPS, \_PR.CPU0._PPC)
Notify (\_PR.CPU0, 0x80)
}
If (CondRefOf (\_PR.CPU1._PPC, Local0))
{
//Store (NPS, \_PR.CPU1._PPC)
Notify (\_PR.CPU1, 0x80)
}
If (CondRefOf (\_PR.CPU2._PPC, Local0))
{
//Store (NPS, \_PR.CPU2._PPC)
Notify (\_PR.CPU2, 0x80)
}
If (CondRefOf (\_PR.CPU3._PPC, Local0))
{
//Store (NPS, \_PR.CPU3._PPC)
Notify (\_PR.CPU3, 0x80)
}
If (CondRefOf (\_PR.CPU4._PPC, Local0))
{
//Store (NPS, \_PR.CPU4._PPC)
Notify (\_PR.CPU4, 0x80)
}
If (CondRefOf (\_PR.CPU5._PPC, Local0))
{
//Store (NPS, \_PR.CPU5._PPC)
Notify (\_PR.CPU5, 0x80)
}
If (CondRefOf (\_PR.CPU6._PPC, Local0))
{
//Store (NPS, \_PR.CPU6._PPC)
Notify (\_PR.CPU6, 0x80)
}
If (CondRefOf (\_PR.CPU7._PPC, Local0))
{
//Store (NPS, \_PR.CPU7._PPC)
Notify (\_PR.CPU7, 0x80)
}
}
Method (_Q10, 0, NotSerialized) // _Qxx: EC Query
{
Add (NPS, One, NPS)
If (CondRefOf (\_PR.CPU0._PPC, Local0))
{
Store (NPS, \_PR.CPU0._PPC)
Notify (\_PR.CPU0, 0x80)
}
If (CondRefOf (\_PR.CPU1._PPC, Local0))
{
//Store (NPS, \_PR.CPU1._PPC)
Notify (\_PR.CPU1, 0x80)
}
If (CondRefOf (\_PR.CPU2._PPC, Local0))
{
//Store (NPS, \_PR.CPU2._PPC)
Notify (\_PR.CPU2, 0x80)
}
If (CondRefOf (\_PR.CPU3._PPC, Local0))
{
//Store (NPS, \_PR.CPU3._PPC)
Notify (\_PR.CPU3, 0x80)
}
If (CondRefOf (\_PR.CPU4._PPC, Local0))
{
//Store (NPS, \_PR.CPU4._PPC)
Notify (\_PR.CPU4, 0x80)
}
If (CondRefOf (\_PR.CPU5._PPC, Local0))
{
//Store (NPS, \_PR.CPU5._PPC)
Notify (\_PR.CPU5, 0x80)
}
If (CondRefOf (\_PR.CPU6._PPC, Local0))
{
//Store (NPS, \_PR.CPU6._PPC)
Notify (\_PR.CPU6, 0x80)
}
If (CondRefOf (\_PR.CPU7._PPC, Local0))
{
Notify (\_PR.CPU7, 0x80)
}
}

The Store ops to _PR.CPUx._PPC are invalid due to _PPC being a method.
 
Hello Rehabman.

I want to use this method to patch battery with my hp pavilion g4 laptop,and i use diffmerge find some diffs but i don't know how to create a SSDT-Battery.dsl to make it well.

QQ20161225-203413@2x.png


Thanks.
 

Attachments

  • BatteryNO.dsl.zip
    39.2 KB · Views: 151
  • BatteryYES.dsl.zip
    40.7 KB · Views: 153
  • SSDT-HPBAT.dsl.zip
    2.2 KB · Views: 142
Hello Rehabman.

I want to use this method to patch battery with my hp pavilion g4 laptop,and i use diffmerge find some diffs but i don't know how to create a SSDT-Battery.dsl to make it well.

View attachment 226791

Thanks.

You need to use 'External' to access the fields present in DSDT from the SSDT.
 
Back
Top