Skip to content

[Enhancement] Use RenameDevices for Methods too #378

@kushwavez

Description

@kushwavez

So what I tried to do is rename _GPE.NTFY -> XTFY, and _SB.PCI0.RP09._INI -> XINI in DSDT
_GPE.NTFY:

  • _GPE (Scope)
  • NTFY (Method)

Képernyőfotó 2021-03-10 - 14 00 50

Looked at he log, I see it is not renamed.

[...]
0:712  0:000  NTFY:_GPE:->will be renamed to XTFY
[...]
4:851  0:003  Name: NTFY, Bridge: _GPE, Replace: XTFY
4:852  0:001    0 replacements
[...]

So according to @SergeySlice it's normal because ONLY Devices can be renamed, Methods cannot.

But maybe because of a bug, if there is a Device after the Scope, the Method can be renamed too.
Example what I mentioned: _SB.PCI0.RP09._INI -> XINI

  • _SB.PCI0 (Scope)
  • RP09 (Device)
  • _INI (Method)

Result:

[...]
4:250  0:000  Name: _INI, Bridge: RP09, Replace: XINI
4:253  0:003    1 replacements
[...]

Képernyőfotó 2021-03-10 - 14 43 46
As you can see, it is renamed.

Another example: SB.PCI0.RP09._PS3 -> XPS3 in SSDT-4

  • SB.PCI0.RP09 (Scope)
  • _PS3 (Method)

(so there is no device after Scope, so it'll fail)
Result:

0:742  0:000  _PS3:RP09:PCI0:_SB_:->will be renamed to XPS3
[...]
7:700  0:001  Name: _PS3, Bridge: RP09, Replace: XPS3
7:705  0:003    0 replacements

Now I use Bin rename patches to do this, but for the ONLY and EXACT match I need to find that one Method with HexFiend in DSDT.aml, and find a pattern that matches ONLY that exact one Method that needs to be patched.

For example if I want to patch _SB.PCI0.RP09._INI -> XINI without using RenameDevices I have to find the pattern in HexFiend, that matches only _INI that is inside _SB.PCI0 Scope, RP09 Device. But the problem is that for _INI there are 44 matches in DSDT.aml, so it's really hard to find that only match. As for now, I'm lucky because the _SB.PCI0.RP09._INI -> XINI RenameDevice worked (because of a bug), so I could find it with HexFiend, and use rename patch :

Find: 5F414452 00A00E92 93525041 390A00A4 52504139 A107A40C 00001D00 084C5452 5A0A0008 4F42465A 0A00084C 4D534C0A 00084C4E 534C0A00 142A5F49 4E49
Replace: 5F414452 00A00E92 93525041 390A00A4 52504139 A107A40C 00001D00 084C5452 5A0A0008 4F42465A 0A00084C 4D534C0A 00084C4E 534C0A00 142A5849 4E49
As you can see it is really long, because it is the only pattern that matches with that one _INI Method

It would be convenient to use RenameDevices to Rename Methods too under Scopes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions