-
Notifications
You must be signed in to change notification settings - Fork 938
/
SSDT-GPRW.dsl
31 lines (29 loc) · 998 Bytes
/
SSDT-GPRW.dsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// For solving instant wake by hooking GPRW or UPRW
#ifndef NO_DEFINITIONBLOCK
DefinitionBlock("", "SSDT", 2, "hack", "_GPRW", 0)
{
#endif
External(XPRW, MethodObj)
External(RMCF.DWOU, IntObj)
// In DSDT, native GPRW is renamed to XPRW with Clover binpatch.
// As a result, calls to GPRW land here.
// The purpose of this implementation is to avoid "instant wake"
// by returning 0 in the second position (sleep state supported)
// of the return package.
Method(GPRW, 2)
{
For (,,)
{
// when RMCF.DWOU is provided and is zero, patch disabled
If (CondRefOf(\RMCF.DWOU)) { If (!\RMCF.DWOU) { Break }}
// either RMCF.DWOU not provided, or is non-zero, patch is enabled
If (0x6d == Arg0) { Return (Package() { 0x6d, 0, }) }
If (0x0d == Arg0) { Return (Package() { 0x0d, 0, }) }
Break
}
Return (XPRW(Arg0, Arg1))
}
#ifndef NO_DEFINITIONBLOCK
}
#endif
//EOF