aggressive power management

This commit is contained in:
Elliot Nunn 2018-03-17 22:00:40 +08:00
parent b725df3cf7
commit 4f95ec6b34
3 changed files with 43 additions and 8 deletions

View File

@ -59,3 +59,45 @@ NKDebug
b ReturnMPCallOOM
endif
; The 7447a does not have THRM registers. Enable me to stop the mini
; crashing with a vanilla CPU plugin
IF 1
; ARG selector r3, arbitrary args r4...
; RET arbitrary
DeclareMPCall 46, MPCpuPluginThatDoesntTrustThrmRegisters
MPCpuPluginThatDoesntTrustThrmRegisters
cmpwi r3, kGetProcessorTemp
bne @not_temp_selector
mfpvr r8
rlwinm r8, r8, 0, 0xffff0000
lis r9, 0x8003
cmpw r8, r9
bne @not_G4e
li r3, kCantReportProcessorTemperatureErr ; (MacErrors.a)
b CommonMPCallReturnPath
@not_temp_selector
@not_G4e
; Arguments in registers
li r8, 0
; Hopefully returns via kcReturnFromInterrupt? Geez...
bl SIGP
mr r3, r8
mr r4, r9 ; r4 not accessible calling MPLibrary func from C
b CommonMPCallReturnPath
ENDIF

View File

@ -62,7 +62,7 @@ HID0_neither equ 0
PflgTblEnt 0x03, HID0_NHR_and_sleep, 1<< hasL2CR | 1<< hasPLRUL1 | 1<< hasTAU | 1<< hasVMX | 1<< hasMSSregs ; 8**0 = 7450 (see note below)
PflgTblEnt 0x1b, HID0_NHR_and_sleep, 1<< hasL2CR | 1<< hasPLRUL1 | 1<< hasTAU | 1<< hasVMX | 1<< hasMSSregs ; 8**1 = 7445/55
PflgTblEnt 0x03, HID0_NHR_and_sleep, 0 ; 8**2 = 7447 (OS X only)
PflgTblEnt 0x03, HID0_NHR_and_sleep, 0 ; 8**3
PflgTblEnt 0x23, HID0_NHR_and_sleep, 1<< hasL2CR | 1<< hasPLRUL1 | 1<< hasTAU | 1<< hasVMX | 1<< hasMSSregs ; 8**3 like 7450 but better
PflgTblEnt 0x03, HID0_NHR_only, 0 ; 8**4
PflgTblEnt 0x03, HID0_NHR_and_sleep, 0 ; 8**5
PflgTblEnt 0x03, HID0_NHR_and_sleep, 0 ; 8**6

View File

@ -2179,13 +2179,6 @@ SchIdleTask
; Check that CPU plugin trusts this CPU
li r3, kGetProcessorTemp
li r4, 1 ; 2nd arg ignored
li r0, 46 ; KCCpuPlugin
sc
cmpwi r3, 0
beq @startagain
li r3, 1
li r4, 0