the-braveknight
Moderator
- Joined
- Nov 24, 2015
- Messages
- 1,220
- Motherboard
- Lenovo Legion Y520 (Clover)
- CPU
- i7-7700HQ
- Graphics
- HD 630 (1920x1080) + Nvidia GTX 1060
- Mac
- Mobile Phone
Thanks for the information. I kinda have a better understanding of how it all works now.Normally, _OFF is not called at all.
But when we patch _INI to call _OFF it is called at the time all _INI methods are executed.
Which is *before* EC._REG is called, which means that any EC access must be removed from _OFF or anything _OFF calls. Such code is then moved to _REG where it is safe to execute.
You could replace all the EC related code with Noop op-codes, but the patching for that would be rather unwieldy.
Better to replace the _OFF method entirely (using "rename/replace" pattern).
Well... if the code was actually coded with the ECON conditional, assuming ECON is *not* in the EC, nothing need be patched in the _OFF as the EC related code will not execute (it is being protected with the If (ECON) conditional).
And if the Store-op to GATY that you meantion was actually being executed (for some reason ECON is non-zero), changing it to EX0.GATY will not work. It would cause ACPI abort, as the EX0.GATY will not be found in ACPI namespace. The execution of the _OFF method would stop at that point and further code after it will not be executed.
So, I’ll need to check if ECON is zero, then I wouldn’t need to replace the _OFF since it’s being protected by the conditional. But if it does, how about creating a 'dummy' EX0 device that contains a 'GATY' property? Will that work?
Also, if I wanted to use ACPIDebug, I can simply add a p1 call from inside that if conditional just to verify if it’s zero, I might add and else statement to be sure [that it’s not zero], is that how it’s usually done?