Clarify exceptions

This commit is contained in:
Elliot Nunn 2018-05-13 22:17:07 +08:00
parent b1bb36c551
commit 0470029cac
7 changed files with 123 additions and 116 deletions

View File

@ -148,9 +148,9 @@ SevenFFFDead2 ds.l 1 ; -8dc
SevenFFFDead3 ds.l 1 ; -8d8 SevenFFFDead3 ds.l 1 ; -8d8
SevenFFFDead4 ds.l 1 ; -8d4 SevenFFFDead4 ds.l 1 ; -8d4
VioletVecBase ds.l 48 ; -8d0:-810 VioletVecBase ds.l 48 ; -8d0:-810
IdleVecBase ds.l 48 ; -810:-750 ; to wake from DOZE/NAP/SLEEP state VecBaseIdle ds.l 48 ; -810:-750 ; to wake from DOZE/NAP/SLEEP state
BlueVecBase ds.l 48 ; -750:-690 ; gets enabled by PDM PIH VecBasePIH ds.l 48 ; -750:-690 ; gets enabled by PDM PIH
GreenVecBase ds.l 48 ; -690:-5d0 VecBaseScreenConsole ds.l 48 ; -690:-5d0
DiagInfo ds.b 256 ; -5d0:-4d0 DiagInfo ds.b 256 ; -5d0:-4d0
ProcessorState ds.b 128 ; -4d0:-450 ; interesting what this gets used by ProcessorState ds.b 128 ; -4d0:-450 ; interesting what this gets used by
FreeList ds.l 4 ; -450:-440 FreeList ds.l 4 ; -450:-440
@ -582,7 +582,7 @@ NCBPointerCacheEnd
VecBaseSystem ds.l 48 ; 360:420 ; when 68k emulator is running, *or* any MTask VecBaseSystem ds.l 48 ; 360:420 ; when 68k emulator is running, *or* any MTask
VecBaseAlternate ds.l 48 ; 420:4e0 ; native PowerPC in blue task VecBaseAlternate ds.l 48 ; 420:4e0 ; native PowerPC in blue task
VecBaseTranslation ds.l 48 ; 4e0:5a0 ; "FDP" instruction emulation VecBaseMemRetry ds.l 48 ; 4e0:5a0 ; "FDP" instruction emulation
OldKDP ds.l 1 ; 5a0 ; gotten from the old SPRG0 OldKDP ds.l 1 ; 5a0 ; gotten from the old SPRG0
OtherFreeThing ds.l 1 ; 5a4 OtherFreeThing ds.l 1 ; 5a4
TopOfFreePages ds.l 1 ; 5a8 ; gotten from the old SPRG0 TopOfFreePages ds.l 1 ; 5a8 ; gotten from the old SPRG0

View File

@ -380,7 +380,7 @@ InitHighLevel
li r22, VecTable.Size li r22, VecTable.Size
bl wordfill bl wordfill
addi r8, r1, KDP.VecBaseTranslation addi r8, r1, KDP.VecBaseMemRetry
li r22, VecTable.Size li r22, VecTable.Size
bl wordfill bl wordfill
@ -388,7 +388,7 @@ InitHighLevel
li r22, VecTable.Size li r22, VecTable.Size
bl wordfill bl wordfill
addi r8, r1, PSA.BlueVecBase addi r8, r1, PSA.VecBasePIH
li r22, VecTable.Size li r22, VecTable.Size
bl wordfill bl wordfill
@ -399,7 +399,7 @@ InitHighLevel
llabel r23, IgnoreSoftwareInt llabel r23, IgnoreSoftwareInt
add r23, r23, r25 add r23, r23, r25
addi r8, r1, PSA.GreenVecBase addi r8, r1, PSA.VecBaseScreenConsole
li r22, VecTable.Size li r22, VecTable.Size
bl wordfill bl wordfill
@ -494,17 +494,17 @@ InitHighLevel
; Fill the Translation vector table ; Fill the Translation vector table
addi r8, r1, KDP.VecBaseTranslation addi r8, r1, KDP.VecBaseMemRetry
llabel r23, panic llabel r23, panic
add r23, r23, r25 add r23, r23, r25
stw r23, VecTable.SystemResetVector(r8) stw r23, VecTable.SystemResetVector(r8)
llabel r23, IntMachineCheckMemRetry llabel r23, MemRetryMachineCheck
add r23, r23, r25 add r23, r23, r25
stw r23, VecTable.MachineCheckVector(r8) stw r23, VecTable.MachineCheckVector(r8)
llabel r23, IntDSITranslation llabel r23, MemRetryDSI
add r23, r23, r25 add r23, r23, r25
stw r23, VecTable.DSIVector(r8) stw r23, VecTable.DSIVector(r8)
@ -550,7 +550,7 @@ InitHighLevel
; Fill Blue (PSA) ; Fill Blue (PSA)
addi r8, r1, PSA.BlueVecBase addi r8, r1, PSA.VecBasePIH
llabel r23, panic llabel r23, panic
add r23, r23, r25 add r23, r23, r25
@ -560,7 +560,7 @@ InitHighLevel
add r23, r23, r25 add r23, r23, r25
stw r23, VecTable.MachineCheckVector(r8) stw r23, VecTable.MachineCheckVector(r8)
llabel r23, IntDSIOther llabel r23, PIHDSI
add r23, r23, r25 add r23, r23, r25
stw r23, VecTable.DSIVector(r8) stw r23, VecTable.DSIVector(r8)

View File

@ -1,25 +1,25 @@
; System = FFFFFFFF, Alt = 7DF2F700 (ecInstPageFault and ecDataPageFault disabled), same +/- VM ; System = FFFFFFFF, Alt = 7DF2F700 (ecInstPageFault and ecDataPageFault disabled), same +/- VM
ecNoException equ 0 ; CodeLikeException ecNoException equ 0 ; Exception
ecSystemCall equ 1 ; ? ecSystemCall equ 1 ; ?
ecTrapInstr equ 2 ; CodeLikeException ecTrapInstr equ 2 ; Exception
ecFloatException equ 3 ; CodeLikeException ecFloatException equ 3 ; Exception
ecInvalidInstr equ 4 ; CodeLikeException ecInvalidInstr equ 4 ; Exception
ecPrivilegedInstr equ 5 ; ? ecPrivilegedInstr equ 5 ; ?
ecMachineCheck equ 7 ; CodeLikeException ecMachineCheck equ 7 ; Exception
ecInstTrace equ 8 ; CodeLikeException ecInstTrace equ 8 ; Exception
ecInstInvalidAddress equ 10 ; CodeLikeException ecInstInvalidAddress equ 10 ; Exception
ecInstHardwareFault equ 11 ; CodeLikeException ecInstHardwareFault equ 11 ; Exception
ecInstPageFault equ 12 ; CodeLikeException ecInstPageFault equ 12 ; Exception
ecInstSupAccessViolation equ 14 ; CodeLikeException ecInstSupAccessViolation equ 14 ; Exception
; Usually from IntDSITranslation (also IntAlignment and IntMachineCheck) ; Usually from MemRetryDSI (also IntAlignment and IntMachineCheck)
ecDataInvalidAddress equ 18 ; DataLikeException ecDataInvalidAddress equ 18 ; ExceptionMemRetried
ecDataHardwareFault equ 19 ; DataLikeException ecDataHardwareFault equ 19 ; ExceptionMemRetried
ecDataPageFault equ 20 ; DataLikeException ecDataPageFault equ 20 ; ExceptionMemRetried
ecDataWriteViolation equ 21 ; DataLikeException ecDataWriteViolation equ 21 ; ExceptionMemRetried
ecDataSupAccessViolation equ 22 ; DataLikeException ecDataSupAccessViolation equ 22 ; ExceptionMemRetried
ecDataSupWriteViolation equ 23 ; ? ecDataSupWriteViolation equ 23 ; ?
ecUnknown24 equ 24 ; DataLikeException ecUnknown24 equ 24 ; ExceptionMemRetried
@ -35,7 +35,7 @@ IntLocalBlockMPCall
align 5 align 5
DataLikeException ExceptionMemRetried
mfsprg r1, 0 mfsprg r1, 0
mtsprg 3, r24 mtsprg 3, r24
@ -162,7 +162,7 @@ PreferRegistersFromEWASavingContextBlock ; OUTSIDE REFERER
; This is the only path to UnhandledCodeFault ; This is the only path to UnhandledCodeFault
CodeLikeException Exception
mfsprg r1, 0 mfsprg r1, 0
mtcrf 0x3f, r7 mtcrf 0x3f, r7
@ -188,8 +188,8 @@ CodeLikeException
; SIGP-return exceptions obviously separate ; SIGP-return exceptions obviously separate
; MTasks (non-blue) -> UnhandledCodeFault (ends up going to backing store) ; MTasks (non-blue) -> UnhandledCodeFault (ends up going to backing store)
; Exception enabled for blue task (i.e. in system context) -> field exception to task ; Exception enabled for blue task (i.e. in system context) -> field exception to task
; Not actually a code fault -> system context (68k interrupt) ; Code fault for blue task but exception is disabled -> UnhandledCodeFault
; Data fault that blue does not wish to handle ; Non-code fault for blue task -> system context (68k interrupt)
bc BO_IF, EWA.kFlagSIGP, IntReturnFromSIGP bc BO_IF, EWA.kFlagSIGP, IntReturnFromSIGP
bc BO_IF_NOT, EWA.kFlagBlue, UnhandledCodeFault bc BO_IF_NOT, EWA.kFlagBlue, UnhandledCodeFault
@ -396,7 +396,7 @@ major_0x02ccc ; OUTSIDE REFERER
stw r7, EWA.Flags(r1) stw r7, EWA.Flags(r1)
li r8, ecInstTrace li r8, ecInstTrace
b CodeLikeException b Exception
@return @return
blr blr
@ -446,7 +446,7 @@ major_0x02ccc_0x30
rlwimi r25, r17, 4, 23, 27 rlwimi r25, r17, 4, 23, 27
mtcrf 0x10, r26 ; so the second nybble of the entry is copied to cr3 mtcrf 0x10, r26 ; so the second nybble of the entry is copied to cr3
lha r22, 0x0c00(r25) lha r22, 0x0c00(r25)
addi r23, r8, KDP.VecBaseTranslation addi r23, r8, KDP.VecBaseMemRetry
add r22, r22, r25 add r22, r22, r25
mfsprg r24, 3 mfsprg r24, 3
mtlr r22 mtlr r22
@ -895,7 +895,7 @@ IntDecrementer_0x54
# # ## # # # # # # # # ## # # # # # #
### # # # ###### ##### ### ### # # # ###### ##### ###
; Kick it to the FDP-associated IntDSITranslation ; Kick it to the FDP-associated MemRetryDSI
align kIntAlign align kIntAlign
@ -925,7 +925,7 @@ IntDSI
; ("Set if the access is due to a lwarx, ldarx, stwcx., or stdcx. ; ("Set if the access is due to a lwarx, ldarx, stwcx., or stdcx.
; instruction that addresses memory that is Write Through ; instruction that addresses memory that is Write Through
; Required or Caching Inhibited; otherwise cleared") ; Required or Caching Inhibited; otherwise cleared")
addi r23, r1, KDP.VecBaseTranslation addi r23, r1, KDP.VecBaseMemRetry
andis. r28, r26, 0x400 ; test bit 5 (see cmt above) andis. r28, r26, 0x400 ; test bit 5 (see cmt above)
mtsprg 3, r23 mtsprg 3, r23
@ -1068,7 +1068,7 @@ IntAlignment ; OUTSIDE REFERER
rlwinm. r21, r21, 0, Task.kFlagTakesAllExceptions, Task.kFlagTakesAllExceptions rlwinm. r21, r21, 0, Task.kFlagTakesAllExceptions, Task.kFlagTakesAllExceptions
addi r23, r1, KDP.VecBaseTranslation addi r23, r1, KDP.VecBaseMemRetry
bne major_0x03548_0x20 bne major_0x03548_0x20
@ -1157,24 +1157,24 @@ major_0x03548_0x20 ; OUTSIDE REFERER
rlwimi r17, r27, 7, 31, 31 rlwimi r17, r27, 7, 31, 31
xori r17, r17, 0x01 xori r17, r17, 0x01
li r8, ecUnknown24 li r8, ecUnknown24
b DataLikeException b ExceptionMemRetried
align kIntAlign align kIntAlign
IntDSITranslation ; OUTSIDE REFERER MemRetryDSI ; OUTSIDE REFERER
mfsprg r1, 0 mfsprg r1, 0
mfspr r31, dsisr mfspr r31, dsisr
mfspr r27, dar mfspr r27, dar
andis. r28, r31, 0xc030 andis. r28, r31, 0xc030
lwz r1, -0x0004(r1) lwz r1, -0x0004(r1)
bne IntDSIOtherOther_0x1c8 bne MemRetryDSI_0x1c8
mfspr r30, srr1 mfspr r30, srr1
andi. r28, r30, 0x4000 andi. r28, r30, 0x4000
mfsprg r30, 0 mfsprg r30, 0
beq IntDSIOtherOther_0x100 beq MemRetryDSI_0x100
stw r8, -0x00e0(r30) stw r8, -0x00e0(r30)
stw r9, -0x00dc(r30) stw r9, -0x00dc(r30)
mfcr r8 mfcr r8
@ -1190,47 +1190,47 @@ IntDSITranslation ; OUTSIDE REFERER
lwz r17, 0x0028(r8) lwz r17, 0x0028(r8)
cmplw r27, r16 cmplw r27, r16
cmplw cr7, r27, r17 cmplw cr7, r27, r17
blt IntDSIOtherOther_0xe0 blt MemRetryDSI_0xe0
bgt cr7, IntDSIOtherOther_0xe0 bgt cr7, MemRetryDSI_0xe0
mr r31, r8 mr r31, r8
mr r8, r27 mr r8, r27
bl SpaceGetPagePLE ; LogicalPage *r8, Area *r31 // PLE *r30, notfound cr0.eq bl SpaceGetPagePLE ; LogicalPage *r8, Area *r31 // PLE *r30, notfound cr0.eq
beq IntDSIOtherOther_0xe0 beq MemRetryDSI_0xe0
lwz r8, 0x0000(r30) lwz r8, 0x0000(r30)
lwz r16, 0x0098(r31) lwz r16, 0x0098(r31)
rlwinm r28, r8, 0, 29, 30 rlwinm r28, r8, 0, 29, 30
cmpwi cr7, r28, 0x04 cmpwi cr7, r28, 0x04
cmpwi r28, 0x02 cmpwi r28, 0x02
beq cr7, IntDSIOtherOther_0xe0 beq cr7, MemRetryDSI_0xe0
beq IntDSIOtherOther_0xe0 beq MemRetryDSI_0xe0
IntDSIOtherOther_0x98 MemRetryDSI_0x98
addi r17, r31, 0x90 addi r17, r31, 0x90
cmpw r16, r17 cmpw r16, r17
addi r17, r16, 0x14 addi r17, r16, 0x14
beq IntDSIOtherOther_0x158 beq MemRetryDSI_0x158
lwz r9, 0x0010(r16) lwz r9, 0x0010(r16)
add r9, r9, r17 add r9, r9, r17
IntDSIOtherOther_0xb0 MemRetryDSI_0xb0
lwz r18, 0x0000(r17) lwz r18, 0x0000(r17)
cmplw cr7, r17, r9 cmplw cr7, r17, r9
lwz r19, 0x0004(r17) lwz r19, 0x0004(r17)
bgt cr7, IntDSIOtherOther_0xd8 bgt cr7, MemRetryDSI_0xd8
cmplw r27, r18 cmplw r27, r18
cmplw cr7, r27, r19 cmplw cr7, r27, r19
blt IntDSIOtherOther_0xd0 blt MemRetryDSI_0xd0
ble cr7, IntDSIOtherOther_0xe0 ble cr7, MemRetryDSI_0xe0
IntDSIOtherOther_0xd0 MemRetryDSI_0xd0
addi r17, r17, 0x08 addi r17, r17, 0x08
b IntDSIOtherOther_0xb0 b MemRetryDSI_0xb0
IntDSIOtherOther_0xd8 MemRetryDSI_0xd8
lwz r16, 0x0008(r16) lwz r16, 0x0008(r16)
b IntDSIOtherOther_0x98 b MemRetryDSI_0x98
IntDSIOtherOther_0xe0 MemRetryDSI_0xe0
mfsprg r30, 0 mfsprg r30, 0
mfspr r31, dsisr mfspr r31, dsisr
lwz r8, -0x00e0(r30) lwz r8, -0x00e0(r30)
@ -1240,7 +1240,7 @@ IntDSIOtherOther_0xe0
lwz r18, -0x00d0(r30) lwz r18, -0x00d0(r30)
lwz r19, -0x00cc(r30) lwz r19, -0x00cc(r30)
IntDSIOtherOther_0x100 MemRetryDSI_0x100
andis. r28, r31, 0x800 andis. r28, r31, 0x800
addi r29, r1, KDP.BATs + 0xa0 addi r29, r1, KDP.BATs + 0xa0
bnel PagingL2PWithBATs bnel PagingL2PWithBATs
@ -1250,23 +1250,23 @@ IntDSIOtherOther_0x100
beql IntPanicIsland beql IntPanicIsland
mfsprg r28, 2 mfsprg r28, 2
mtlr r28 mtlr r28
bne cr7, IntDSIOtherOther_0x144 bne cr7, MemRetryDSI_0x144
mfspr r28, srr0 mfspr r28, srr0
addi r28, r28, 0x04 addi r28, r28, 0x04
lwz r26, 0x0e90(r1) lwz r26, 0x0e90(r1)
mtspr srr0, r28 mtspr srr0, r28
addi r26, r26, 0x01 addi r26, r26, 0x01
stw r26, 0x0e90(r1) stw r26, 0x0e90(r1)
b IntDSIOtherOther_0x19c b MemRetryDSI_0x19c
IntDSIOtherOther_0x144 MemRetryDSI_0x144
andi. r28, r31, 0x03 andi. r28, r31, 0x03
li r8, ecDataSupAccessViolation li r8, ecDataSupAccessViolation
beq DataLikeException beq ExceptionMemRetried
li r8, ecDataWriteViolation li r8, ecDataWriteViolation
b DataLikeException b ExceptionMemRetried
IntDSIOtherOther_0x158 MemRetryDSI_0x158
mfsprg r30, 0 mfsprg r30, 0
lwz r16, 0x0f00(r1) lwz r16, 0x0f00(r1)
lwz r8, -0x00c8(r30) lwz r8, -0x00c8(r30)
@ -1285,16 +1285,16 @@ IntDSIOtherOther_0x158
mtlr r28 mtlr r28
mtspr srr1, r29 mtspr srr1, r29
IntDSIOtherOther_0x19c MemRetryDSI_0x19c
mfsprg r1, 1 mfsprg r1, 1
rlwinm r26, r25, 30, 24, 31 rlwinm r26, r25, 30, 24, 31
rfi rfi
dcb.b 32, 0 dcb.b 32, 0
IntDSIOtherOther_0x1c8 MemRetryDSI_0x1c8
andis. r28, r31, 0x8010 andis. r28, r31, 0x8010
bne IntMachineCheckMemRetry_0x14c bne MemRetryMachineCheck_0x14c
_Lock PSA.HTABLock, scratch1=r28, scratch2=r31 _Lock PSA.HTABLock, scratch1=r28, scratch2=r31
@ -1302,15 +1302,15 @@ IntDSIOtherOther_0x1c8
_AssertAndRelease PSA.HTABLock, scratch=r28 _AssertAndRelease PSA.HTABLock, scratch=r28
mfsprg r28, 2 mfsprg r28, 2
mtlr r28 mtlr r28
beq IntDSIOtherOther_0x19c beq MemRetryDSI_0x19c
li r8, ecDataInvalidAddress li r8, ecDataInvalidAddress
bge DataLikeException bge ExceptionMemRetried
li r8, ecDataPageFault li r8, ecDataPageFault
b DataLikeException b ExceptionMemRetried
IntMachineCheckMemRetry ; OUTSIDE REFERER MemRetryMachineCheck ; OUTSIDE REFERER
mfsprg r1, 0 mfsprg r1, 0
mr r28, r8 mr r28, r8
@ -1341,9 +1341,9 @@ IntMachineCheckMemRetry ; OUTSIDE REFERER
lwz r27, 0x0694(r1) lwz r27, 0x0694(r1)
subf r28, r19, r27 subf r28, r19, r27
cmpwi r28, -0x10 cmpwi r28, -0x10
blt IntMachineCheckMemRetry_0x14c blt MemRetryMachineCheck_0x14c
cmpwi r28, 0x10 cmpwi r28, 0x10
bgt IntMachineCheckMemRetry_0x14c bgt MemRetryMachineCheck_0x14c
_Lock PSA.HTABLock, scratch1=r28, scratch2=r29 _Lock PSA.HTABLock, scratch1=r28, scratch2=r29
@ -1357,24 +1357,26 @@ IntMachineCheckMemRetry ; OUTSIDE REFERER
rlwinm. r28, r28, 0, 0, 14 rlwinm. r28, r28, 0, 0, 14
sync sync
tlbie r27 tlbie r27
beq IntMachineCheckMemRetry_0x124 beq MemRetryMachineCheck_0x124
sync sync
tlbsync tlbsync
IntMachineCheckMemRetry_0x124 MemRetryMachineCheck_0x124
sync sync
isync isync
_AssertAndRelease PSA.HTABLock, scratch=r28 _AssertAndRelease PSA.HTABLock, scratch=r28
IntMachineCheckMemRetry_0x14c ; OUTSIDE REFERER
MemRetryMachineCheck_0x14c ; OUTSIDE REFERER
cmplw r10, r19 cmplw r10, r19
li r8, ecDataHardwareFault li r8, ecDataHardwareFault
bne DataLikeException bne ExceptionMemRetried
mfsprg r1, 0 mfsprg r1, 0
mtsprg 3, r24 mtsprg 3, r24
lmw r14, 0x0038(r1) lmw r14, 0x0038(r1)
li r8, ecInstHardwareFault li r8, ecInstHardwareFault
b CodeLikeException b Exception
@ -1396,10 +1398,14 @@ IntISI ; OUTSIDE REFERER
_AssertAndRelease PSA.HTABLock, scratch=r28 _AssertAndRelease PSA.HTABLock, scratch=r28
mfsprg r8, 0 mfsprg r8, 0
bne major_0x039dc bne major_0x039dc
; MemRetry
mfsprg r24, 3 mfsprg r24, 3
mfmsr r14 mfmsr r14
ori r15, r14, 0x10 ori r15, r14, 0x10
addi r23, r1, KDP.VecBaseTranslation addi r23, r1, KDP.VecBaseMemRetry
mtsprg 3, r23 mtsprg 3, r23
mr r19, r10 mr r19, r10
mtmsr r15 mtmsr r15
@ -1418,16 +1424,16 @@ IntISI ; OUTSIDE REFERER
major_0x039dc ; OUTSIDE REFERER major_0x039dc ; OUTSIDE REFERER
lmw r14, 0x0038(r8) lmw r14, 0x0038(r8)
li r8, ecInstPageFault li r8, ecInstPageFault
blt CodeLikeException blt Exception
li r8, ecInstInvalidAddress li r8, ecInstInvalidAddress
b CodeLikeException b Exception
major_0x039dc_0x14 ; OUTSIDE REFERER major_0x039dc_0x14 ; OUTSIDE REFERER
andis. r8, r11, 0x800 andis. r8, r11, 0x800
li r8, ecInstSupAccessViolation li r8, ecInstSupAccessViolation
bne CodeLikeException bne Exception
li r8, ecInstHardwareFault li r8, ecInstHardwareFault
b CodeLikeException b Exception
@ -1461,7 +1467,7 @@ IntMachineCheck ; OUTSIDE REFERER
@not_L1_data_cache_error @not_L1_data_cache_error
li r8, ecMachineCheck li r8, ecMachineCheck
b CodeLikeException b Exception
@ -1475,13 +1481,13 @@ MaskedInterruptTaken ; OUTSIDE REFERER
lis r10, -0x4523 lis r10, -0x4523
ori r10, r10, 0xcb00 ori r10, r10, 0xcb00
li r8, ecMachineCheck li r8, ecMachineCheck
b CodeLikeException b Exception
align kIntAlign align kIntAlign
IntDSIOther ; OUTSIDE REFERER PIHDSI ; OUTSIDE REFERER
mfspr r8, dsisr mfspr r8, dsisr
rlwimi r11, r8, 0, 0, 9 rlwimi r11, r8, 0, 0, 9
andis. r8, r11, 0x4020 andis. r8, r11, 0x4020
@ -1531,23 +1537,23 @@ kcReturnFromException ; OUTSIDE REFERER
_bset r11, r11, MSR_EEbit _bset r11, r11, MSR_EEbit
mtcrf 0x3f, r7 mtcrf 0x3f, r7
cmplwi cr1, r3, 0x01 cmplwi cr1, r3, 1 ; exception handler return value
bc BO_IF, EWA.kFlagSIGP, IntReturnFromSIGP bc BO_IF, EWA.kFlagSIGP, IntReturnFromSIGP
blt cr1, major_0x03be0_0x58 blt cr1, major_0x03be0_0x58
beq cr1, major_0x03be0_0x90 beq cr1, major_0x03be0_0x90
addi r8, r3, -0x20 subi r8, r3, 32
lwz r9, KDP.NanoKernelInfo + NKNanoKernelInfo.ExceptionForcedCount(r1) lwz r9, KDP.NanoKernelInfo + NKNanoKernelInfo.ExceptionForcedCount(r1)
cmplwi r8, 0xe0 cmplwi r8, 224
addi r9, r9, 1 addi r9, r9, 1
stw r9, KDP.NanoKernelInfo + NKNanoKernelInfo.ExceptionForcedCount(r1) stw r9, KDP.NanoKernelInfo + NKNanoKernelInfo.ExceptionForcedCount(r1)
mfsprg r1, 0 mfsprg r1, 0
rlwimi r7, r3, 24, 0, 7 rlwimi r7, r3, 24, 0, 7
blt major_0x03be0_0xe8 blt major_0x03be0_0xe8
li r8, ecTrapInstr li r8, ecTrapInstr
b CodeLikeException b Exception
major_0x03be0_0x58 major_0x03be0_0x58
mfsprg r1, 0 mfsprg r1, 0
@ -1594,7 +1600,7 @@ major_0x03be0_0xe8
crclr cr6_so crclr cr6_so
mfspr r10, srr0 mfspr r10, srr0
li r8, ecTrapInstr li r8, ecTrapInstr
b CodeLikeException b Exception
@ -1932,7 +1938,7 @@ major_0x04180_0x9c
bl LoadInterruptRegisters bl LoadInterruptRegisters
li r8, ecInvalidInstr li r8, ecInvalidInstr
b CodeLikeException b Exception
@ -2186,7 +2192,7 @@ kcRunAlternateContext
lmw r14, EWA.r14(r1) lmw r14, EWA.r14(r1)
lwz r1, EWA.PA_KDP(r1) lwz r1, EWA.PA_KDP(r1)
li r8, ecTrapInstr li r8, ecTrapInstr
b CodeLikeException b Exception
@ -2375,7 +2381,7 @@ major_0x046d0 ; OUTSIDE REFERER
bl LoadInterruptRegisters bl LoadInterruptRegisters
li r8, ecTrapInstr li r8, ecTrapInstr
b CodeLikeException b Exception
@ -2397,7 +2403,7 @@ IntExternalAlternate
mtcrf 0x3f, r7 mtcrf 0x3f, r7
bcl BO_IF_NOT, EWA.kFlagBlue, IntPanicIsland bcl BO_IF_NOT, EWA.kFlagBlue, IntPanicIsland
li r8, ecNoException li r8, ecNoException
b CodeLikeException b Exception
@ -2443,7 +2449,7 @@ IntProgram
bc BO_IF_NOT, 26, @_IntProgram_0x58 bc BO_IF_NOT, 26, @_IntProgram_0x58
stw r14, ContextBlock.r14(r6) stw r14, ContextBlock.r14(r6)
mfsprg r14, 3 mfsprg r14, 3
addi r8, r1, PSA.BlueVecBase addi r8, r1, PSA.VecBasePIH
mfmsr r9 mfmsr r9
mtsprg 3, r8 mtsprg 3, r8
_bset r8, r9, 27 ; turn on data paging (MSR[DR]) for just a sec _bset r8, r9, 27 ; turn on data paging (MSR[DR]) for just a sec
@ -2556,15 +2562,15 @@ IntProgram
rlwinm r8, r11, 17, 28, 29 ; whoa rlwinm r8, r11, 17, 28, 29 ; whoa
addi r8, r8, 0x4b3 addi r8, r8, 0x4b3
rlwnm r8, r8, r8, 28, 31 rlwnm r8, r8, r8, 28, 31
b CodeLikeException b Exception
@floating_point_exception @floating_point_exception
li r8, ecFloatException li r8, ecFloatException
bc BO_IF, 15, CodeLikeException ; if SRR0 points to subsequent instr bc BO_IF, 15, Exception ; if SRR0 points to subsequent instr
addi r10, r10, 4 ; if SRR0 points to offending instr addi r10, r10, 4 ; if SRR0 points to offending instr
rlwimi r7, r7, 27, 26, 26 ; copy EWA.kFlagBE into EWA.kFlag26 rlwimi r7, r7, 27, 26, 26 ; copy EWA.kFlagBE into EWA.kFlag26
b CodeLikeException b Exception
@ -2771,7 +2777,8 @@ SIGP
major_0x04a20 ; OUTSIDE REFERER major_0x04a20
mfsprg r23, 0 mfsprg r23, 0
lwz r6, -0x0014(r23) lwz r6, -0x0014(r23)
lwz r7, -0x0010(r23) lwz r7, -0x0010(r23)
@ -2924,7 +2931,7 @@ IntTrace ; OUTSIDE REFERER
bl LoadInterruptRegisters bl LoadInterruptRegisters
li r8, ecInstTrace li r8, ecInstTrace
b CodeLikeException b Exception

View File

@ -18,7 +18,7 @@ InitIdleVecTable
mflr r9 mflr r9
llabel r23, panic llabel r23, panic
add r23, r23, r25 add r23, r23, r25
addi r8, r1, PSA.IdleVecBase addi r8, r1, PSA.VecBaseIdle
li r22, VecTable.Size li r22, VecTable.Size
bl wordfill bl wordfill
mtlr r9 mtlr r9
@ -106,7 +106,7 @@ PwrIdle
; Activate the interrupt table that will rouse the CPU ; Activate the interrupt table that will rouse the CPU
mfsprg r31, 3 ; will restore r31 => SPRG3 after state exited mfsprg r31, 3 ; will restore r31 => SPRG3 after state exited
addi r8, r1, PSA.IdleVecBase addi r8, r1, PSA.VecBaseIdle
mtsprg 3, r8 mtsprg 3, r8

View File

@ -295,7 +295,7 @@ PDM_PIH
bl SchSaveStartingAtR20 bl SchSaveStartingAtR20
addi r9, r1, PSA.BlueVecBase addi r9, r1, PSA.VecBasePIH
andis. r8, r11, 0x8000 >> 14 ; SRR1 mystery bit andis. r8, r11, 0x8000 >> 14 ; SRR1 mystery bit
mfsprg r30, 3 mfsprg r30, 3
@ -374,7 +374,7 @@ PBX_PIH
bl SchSaveStartingAtR20 bl SchSaveStartingAtR20
; r8 = sprg0 (not used by me) ; r8 = sprg0 (not used by me)
addi r9, r1, PSA.BlueVecBase addi r9, r1, PSA.VecBasePIH
andis. r8, r11, 0x02 andis. r8, r11, 0x02
mfsprg r30, 3 mfsprg r30, 3
bne PBX_PIH_0x38 bne PBX_PIH_0x38
@ -438,7 +438,7 @@ GazellePIH
bl SchSaveStartingAtR20 bl SchSaveStartingAtR20
; r8 = sprg0 (not used by me) ; r8 = sprg0 (not used by me)
addi r9, r1, PSA.BlueVecBase addi r9, r1, PSA.VecBasePIH
andis. r8, r11, 0x02 andis. r8, r11, 0x02
mfsprg r30, 3 mfsprg r30, 3
bne GazellePIH_0x38 bne GazellePIH_0x38
@ -526,7 +526,7 @@ TNT_PIH
bl SchSaveStartingAtR20 bl SchSaveStartingAtR20
; r8 = sprg0 (not used by me) ; r8 = sprg0 (not used by me)
addi r9, r1, PSA.BlueVecBase addi r9, r1, PSA.VecBasePIH
andis. r8, r11, 0x02 andis. r8, r11, 0x02
mfsprg r30, 3 mfsprg r30, 3
bne TNT_PIH_0x38 bne TNT_PIH_0x38
@ -602,7 +602,7 @@ GossamerPIH
bl SchSaveStartingAtR20 bl SchSaveStartingAtR20
; r8 = sprg0 (not used by me) ; r8 = sprg0 (not used by me)
addi r9, r1, PSA.BlueVecBase addi r9, r1, PSA.VecBasePIH
andis. r8, r11, 0x02 andis. r8, r11, 0x02
mfsprg r30, 3 mfsprg r30, 3
bne GossamerPIH_0x38 bne GossamerPIH_0x38
@ -695,7 +695,7 @@ NewWorldPowerBookPIH
bl SchSaveStartingAtR20 bl SchSaveStartingAtR20
; r8 = sprg0 (not used by me) ; r8 = sprg0 (not used by me)
addi r9, r1, PSA.BlueVecBase addi r9, r1, PSA.VecBasePIH
andis. r8, r11, 0x02 andis. r8, r11, 0x02
mfsprg r30, 3 mfsprg r30, 3
bne NewWorldPowerBookPIH_0x38 bne NewWorldPowerBookPIH_0x38
@ -772,7 +772,7 @@ CordycepsPIH
bl SchSaveStartingAtR20 bl SchSaveStartingAtR20
; r8 = sprg0 (not used by me) ; r8 = sprg0 (not used by me)
addi r9, r1, PSA.BlueVecBase addi r9, r1, PSA.VecBasePIH
andis. r8, r11, 0x02 andis. r8, r11, 0x02
mfsprg r30, 3 mfsprg r30, 3
bne CordycepsPIH_0x38 bne CordycepsPIH_0x38
@ -836,7 +836,7 @@ NewWorldPIH
bl SchSaveStartingAtR20 bl SchSaveStartingAtR20
; r8 = sprg0 (not used by me) ; r8 = sprg0 (not used by me)
addi r9, r1, PSA.BlueVecBase addi r9, r1, PSA.VecBasePIH
andis. r8, r11, 0x02 andis. r8, r11, 0x02
mfsprg r30, 3 mfsprg r30, 3
bne NewWorldPIH_0x38 bne NewWorldPIH_0x38
@ -1024,7 +1024,7 @@ UnknownPIH
bl SchSaveStartingAtR20 bl SchSaveStartingAtR20
; r8 = sprg0 (not used by me) ; r8 = sprg0 (not used by me)
addi r9, r1, PSA.BlueVecBase addi r9, r1, PSA.VecBasePIH
andis. r8, r11, 0x02 andis. r8, r11, 0x02
mfsprg r30, 3 mfsprg r30, 3
bne UnknownPIH_0x38 bne UnknownPIH_0x38

View File

@ -78,7 +78,7 @@ ScreenConsole_redraw ; OUTSIDE REFERER
mfcr r15 mfcr r15
stw r14, PSA._3f0(r1) stw r14, PSA._3f0(r1)
stw r15, PSA._3ec(r1) stw r15, PSA._3ec(r1)
addi r26, r1, PSA.GreenVecBase addi r26, r1, PSA.VecBaseScreenConsole
mfsprg r2, 3 mfsprg r2, 3
mtsprg 3, r26 mtsprg 3, r26
lwz r26, 0x0edc(r1) lwz r26, 0x0edc(r1)

View File

@ -285,7 +285,7 @@ FDP_023c
FDP_024c FDP_024c
li r8, 18 li r8, 18
b DataLikeException b ExceptionMemRetried
FDP_0254 ; stswi FDP_0254 ; stswi
@ -2351,7 +2351,7 @@ FDP_1354
stw r9, 0x0ea0(r6) stw r9, 0x0ea0(r6)
lwz r6, -0x0014(r1) lwz r6, -0x0014(r1)
lwz r7, -0x0010(r1) lwz r7, -0x0010(r1)
b CodeLikeException b Exception