mirror of
https://github.com/elliotnunn/powermac-rom.git
synced 2024-06-14 09:29:33 +00:00
much nicer
This commit is contained in:
parent
2194a99638
commit
768e805da9
|
@ -1,5 +1,9 @@
|
|||
; AUTO-GENERATED SYMBOL LIST
|
||||
|
||||
; Special MR registers to investigate: r19 (inst addr), r26 (error)
|
||||
|
||||
########################################################################
|
||||
|
||||
MRDataStorageInt ; Consult DSISR and the page table to decide what to do
|
||||
mfdsisr r31 ; Check DSISR for simple HTAB miss
|
||||
andis. r28, r31, 0xC030 ; (bits 0/1/10/11)
|
||||
|
|
|
@ -1,16 +1,19 @@
|
|||
; Indexing this table:
|
||||
; bits 0-23 MRCode
|
||||
; bits 24-26 number of bytes to access minus one
|
||||
; bit 27 one for load, zero for store
|
||||
; bits 28-30 alignment modulus
|
||||
; bit 31 zero (entries are 2b)
|
||||
; AUTO-GENERATED SYMBOL LIST
|
||||
|
||||
; "Alignment modulus":
|
||||
; If the "string" to be accessed is right-aligned to an 8b boundary, modulus is 0.
|
||||
; Modulus then increases by 1 for every increase in the address of the "string".
|
||||
; Indexing this table:
|
||||
; bits 0-23 MRCode
|
||||
; bits 24-26 number of bytes to access minus one
|
||||
; bit 27 one for load, zero for store
|
||||
; bits 28-30 bottom three bits of adjusted EA
|
||||
; bit 31 zero (entries are 2b)
|
||||
|
||||
; "adjusted EA": address of the byte immediately to the right of the "string"
|
||||
|
||||
; Interpreting this table:
|
||||
; Each entry refers to a routine
|
||||
; Entries refer to routines in MRMemtabCode, all
|
||||
; of which eventually jump to MRDoSecondary.
|
||||
|
||||
########################################################################
|
||||
|
||||
MACRO
|
||||
memtabRow &label
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
; AUTO-GENERATED SYMBOL LIST
|
||||
|
||||
; Each routine accepts:
|
||||
; r17 = pretend inst with accessLen (range 1-8) in bits 27-30 (will be decremented)
|
||||
; r19 = address of byte to the right of the string to be loaded/saved
|
||||
|
|
|
@ -1,176 +1,159 @@
|
|||
; AUTO-GENERATED SYMBOL LIST
|
||||
|
||||
########################################################################
|
||||
|
||||
MACRO
|
||||
optabRow &upperSix, &lowerSix, &flags, &primLabel, &secLabel
|
||||
IF &TYPE('&upperSix') = 'UNDEFINED' ; 0-5 lowerSix
|
||||
orUpperSix set 63
|
||||
ELSE
|
||||
orUpperSix set &upperSix
|
||||
ENDIF
|
||||
|
||||
IF &TYPE('&lowerSix') = 'UNDEFINED' ; 6-11 upperSix
|
||||
orLowerSix set 1
|
||||
ELSE
|
||||
orLowerSix set &lowerSix
|
||||
ENDIF
|
||||
|
||||
IF &TYPE('&flags') = 'UNDEFINED' ; 12-15 flags
|
||||
orFlags set 1
|
||||
ELSE
|
||||
orFlags set &flags
|
||||
ENDIF
|
||||
|
||||
DC.W (orLowerSix << 10) | (orUpperSix << 4) | orFlags
|
||||
|
||||
IF &TYPE('&primLabel') = 'UNDEFINED' ; 16-23 primary routine
|
||||
DC.B (MRPriCrash - MRBase) >> 2
|
||||
ELSE
|
||||
DC.B (&primLabel - MRBase) >> 2
|
||||
ENDIF
|
||||
IF &TYPE('&secLabel') = 'UNDEFINED' ; 24-31 secondary routine
|
||||
DC.B (MRSecException - MRBase) >> 2
|
||||
ELSE
|
||||
DC.B (&secLabel - MRBase) >> 2
|
||||
ENDIF
|
||||
optabRow &myAccLen, &myLoadStore, &resLabel, &myFlags, &primLabel, &secLabel
|
||||
_L set 1
|
||||
_S set 0
|
||||
DC.W (&myAccLen << 11) | (&myLoadStore << 10) | (((&resLabel - MRResTab) >> 1) << 4) | &myFlags
|
||||
DC.B (&primLabel - MRBase) >> 2
|
||||
DC.B (&secLabel - MRBase) >> 2
|
||||
ENDM
|
||||
|
||||
; LEGEND .. metatab index (r17 bits 0-5, dflt=63)
|
||||
; .... access size (r17 bits 27-30) and (L)oad/(S)tore (r17 bit 31)
|
||||
; LEGEND .... access size (r17 bits 27-30) and 0=Store/1=Load (r17 bit 31)
|
||||
; ................ MRRestab entry (r17 bits 0-5)
|
||||
;
|
||||
; . mrOpflag1 }
|
||||
; . mrOpflag2 } cr3 flags,
|
||||
; . mrOpflag3 } all unset by default
|
||||
; . mrFlagDidLoad }
|
||||
; . mrOpflag1 }
|
||||
; . mrOpflag2 } cr3 flags
|
||||
; . mrOpflag3 }
|
||||
; . mrFlagDidLoad }
|
||||
;
|
||||
; primary routine secondary routine X-form extended opcode D-form opcode
|
||||
; (dflt=MRPriCrash) (dflt=MRSecExc'n)
|
||||
; ................ ................ ....................... .................
|
||||
; primary routine secondary routine X-form extended opcode D-form opcode
|
||||
; ................ ................ ....................... .................
|
||||
|
||||
MACRO
|
||||
optabNone
|
||||
optabRow 0,_L, MRResBlank, %0000, MRPriCrash, MRSecException ; defaults for blank rows
|
||||
ENDM
|
||||
|
||||
MROptabX
|
||||
optabRow 20, 4,L, %0000, MRPriPlainLoad, MRSecLWARX ; 00000(101)00=020=LWARX metatabLine %0001, MRSecLWARX ; 20
|
||||
optabRow 21, 8,L, %0000, MRPriCrash, MRSecException ; 00010(101)00=084=LDARX metatabLine %0001, MRSecException ; 21
|
||||
optabRow , ,, , , ; 00100(101)00=148
|
||||
optabRow , ,, , , ; 00110(101)00=212
|
||||
optabRow , ,, , , ; 01000(101)00=276
|
||||
optabRow , ,, , , ; 01010(101)00=340
|
||||
optabRow , ,, , , ; 01100(101)00=404
|
||||
optabRow , ,, , , ; 01110(101)00=468
|
||||
optabRow , ,, , , ; 10000(101)00=532
|
||||
optabRow , ,, , , ; 10010(101)00=596
|
||||
optabRow , ,, , , ; 10100(101)00=660
|
||||
optabRow , ,, , , ; 10110(101)00=724
|
||||
optabRow 3, 8,L, %0000, MRPriPlainLoad, MRSecLoad ; 11000(101)00=788 metatabLine %0001, MRSecLoad ; 3
|
||||
optabRow 6, 4,L, %0000, MRPriPlainLoad, MRSecLoad ; 11010(101)00=852 metatabLine %0001, MRSecLoad ; 6
|
||||
optabRow 19, 8,S, %0000, MRPriPlainStore, MRSecDone ; 11100(101)00=916 metatabLine %0001, MRSecDone ; 19
|
||||
optabRow , ,, , , ; 11110(101)00=980
|
||||
optabRow , ,, , , ; 00001(101)00=052
|
||||
optabRow , ,, , , ; 00011(101)00=116
|
||||
optabRow , ,, , , ; 00101(101)00=180
|
||||
optabRow , ,, , , ; 00111(101)00=244
|
||||
optabRow , ,, , , ; 01001(101)00=308
|
||||
optabRow , ,, , , ; 01011(101)00=372
|
||||
optabRow , ,, , , ; 01101(101)00=436
|
||||
optabRow , ,, , , ; 01111(101)00=500
|
||||
optabRow , ,, , , ; 10001(101)00=564
|
||||
optabRow , ,, , , ; 10011(101)00=628
|
||||
optabRow , ,, , , ; 10101(101)00=692
|
||||
optabRow , ,, , , ; 10111(101)00=756
|
||||
optabRow 3, 8,L, %0000, MRPriUpdLoad, MRSecLoad ; 11001(101)00=820 metatabLine %0001, MRSecLoad ; 3
|
||||
optabRow 27, 8,L, %0011, MRPriCrash, MRSecException ; 11011(101)00=884 metatabLine %0011, MRSecException ; 27
|
||||
optabRow 19, 8,S, %0000, MRPriUpdStore, MRSecDone ; 11101(101)00=948 metatabLine %0001, MRSecDone ; 19
|
||||
optabRow 31, 8,S, %0010, MRPriCrash, MRSecException ; 11111(101)00=1012 metatabLine %0011, MRSecException ; 31
|
||||
optabRow 3, 8,L, %0000, MRPriPlainLoad, MRSecLoad ; 00000(101)01=021=LDX metatabLine %0001, MRSecLoad ; 3
|
||||
optabRow , ,, , , ; 00010(101)01=085
|
||||
optabRow 19, 8,S, %0000, MRPriPlainStore, MRSecDone ; 00100(101)01=149=STDX metatabLine %0001, MRSecDone ; 19
|
||||
optabRow , ,, , , ; 00110(101)01=213
|
||||
optabRow 40, 4,L, %1011, MRPriLSCBX, MRSecLSCBX ; 01000(101)01=277=LSCBX (POWER) metatabLine %0011, MRSecLSCBX ; 40
|
||||
optabRow 6, 4,L, %0000, MRPriPlainLoad, MRSecLoad ; 01010(101)01=341=LWAX metatabLine %0001, MRSecLoad ; 6
|
||||
optabRow , ,, , , ; 01100(101)01=405
|
||||
optabRow , ,, , , ; 01110(101)01=469
|
||||
optabRow 32, 4,L, %1011, MRPriLSWX, MRSecLSWix ; 10000(101)01=533=LSWX metatabLine %0011, MRSecLSWix ; 32
|
||||
optabRow 32, 4,L, %1111, MRPriLSWI, MRSecLSWix ; 10010(101)01=597=LSWI metatabLine %0011, MRSecLSWix ; 32
|
||||
optabRow 36, 4,S, %0010, MRPriSTSWX, MRSecStrStore ; 10100(101)01=661=STSWX metatabLine %0011, MRSecStrStore ; 36
|
||||
optabRow 36, 4,S, %1110, MRPriSTSWI, MRSecStrStore ; 10110(101)01=725=STSWI metatabLine %0011, MRSecStrStore ; 36
|
||||
optabRow , ,, , , ; 11000(101)01=789
|
||||
optabRow , ,, , , ; 11010(101)01=853
|
||||
optabRow , ,, , , ; 11100(101)01=917
|
||||
optabRow , ,, , , ; 11110(101)01=981
|
||||
optabRow 3, 8,L, %0000, MRPriUpdLoad, MRSecLoad ; 00001(101)01=053=LDUX metatabLine %0001, MRSecLoad ; 3
|
||||
optabRow , ,, , , ; 00011(101)01=117
|
||||
optabRow 19, 8,S, %0000, MRPriUpdStore, MRSecDone ; 00101(101)01=181=STDUX metatabLine %0001, MRSecDone ; 19
|
||||
optabRow , ,, , , ; 00111(101)01=245
|
||||
optabRow , ,, , , ; 01001(101)01=309
|
||||
optabRow 6, 4,L, %0000, MRPriUpdLoad, MRSecDone ; 01011(101)01=373=LWAUX metatabLine %0001, MRSecLoad ; 6
|
||||
optabRow , ,, , , ; 01101(101)01=437
|
||||
optabRow , ,, , , ; 01111(101)01=501
|
||||
optabRow , ,, , , ; 10001(101)01=565
|
||||
optabRow , ,, , , ; 10011(101)01=629
|
||||
optabRow , ,, , , ; 10101(101)01=693
|
||||
optabRow , ,, , , ; 10111(101)01=757
|
||||
optabRow , ,, , , ; 11001(101)01=821
|
||||
optabRow , ,, , , ; 11011(101)01=885
|
||||
optabRow , ,, , , ; 11101(101)01=949
|
||||
optabRow , ,, , , ; 11111(101)01=1013
|
||||
optabRow , ,, , , ; 00000(101)10=022
|
||||
optabRow 62, 1,L, %0010, MRPriUpdLoad, MRSecRedoNoTrace ; 00010(101)10=086 metatabLine %0011, MRSecRedoNoTrace ; 62
|
||||
optabRow 22, 4,L, %0000, MRPriPlainStore, MRSecSTWCX ; 00100(101)10=150=STWCX. metatabLine %0001, MRSecSTWCX ; 22
|
||||
optabRow 23, 8,S, %0000, MRPriCrash, MRSecException ; 00110(101)10=214=STDCX. metatabLine %0001, MRSecException ; 23
|
||||
optabRow 62, 1,L, %0010, MRPriUpdLoad, MRSecRedoNoTrace ; 01000(101)10=278=DCBT metatabLine %0011, MRSecRedoNoTrace ; 62
|
||||
optabRow , ,, , , ; 01010(101)10=342
|
||||
optabRow , ,, , , ; 01100(101)10=406
|
||||
optabRow , ,, , , ; 01110(101)10=470
|
||||
optabRow 10, 4,L, %0010, MRPriUpdLoad, MRSecLWBRX ; 10000(101)10=534=LWBRX metatabLine %0011, MRSecLWBRX ; 10
|
||||
optabRow , ,, , , ; 10010(101)10=598
|
||||
optabRow 18, 4,S, %0000, MRPriSTWBRX, MRSecDone ; 10100(101)10=662=STWBRX metatabLine %0001, MRSecDone ; 18
|
||||
optabRow , ,, , , ; 10110(101)10=726
|
||||
optabRow 9, 2,L, %0010, MRPriUpdLoad, MRSecLHBRX ; 11000(101)10=790=LHBRX metatabLine %0011, MRSecLHBRX ; 9
|
||||
optabRow , ,, , , ; 11010(101)10=854
|
||||
optabRow 17, 2,S, %0000, MRPriSTHBRX, MRSecDone ; 11100(101)10=918=STHBRX metatabLine %0001, MRSecDone ; 17
|
||||
optabRow 62, 1,L, %0010, MRPriUpdLoad, MRSecRedoNoTrace ; 11110(101)10=982=ICBI metatabLine %0011, MRSecRedoNoTrace ; 62
|
||||
optabRow 62, 1,L, %0010, MRPriUpdLoad, MRSecRedoNoTrace ; 00001(101)10=054=DCBST metatabLine %0011, MRSecRedoNoTrace ; 62
|
||||
optabRow , ,, , , ; 00011(101)10=118
|
||||
optabRow , ,, , , ; 00101(101)10=182
|
||||
optabRow 62, 1,L, %0010, MRPriUpdLoad, MRSecRedoNoTrace ; 00111(101)10=246=DCBTST metatabLine %0011, MRSecRedoNoTrace ; 62
|
||||
optabRow 63, 0,L, %0000, MRPriPlainLoad, MRSecException2 ; 01001(101)10=310=ECIWX metatabLine %0001, MRSecException2 ; 63
|
||||
optabRow , ,, , , ; 01011(101)10=374
|
||||
optabRow 63, 0,S, %0000, MRPriPlainStore, MRSecException2 ; 01101(101)10=438=ECOWX metatabLine %0001, MRSecException2 ; 63
|
||||
optabRow , ,, , , ; 01111(101)10=502
|
||||
optabRow , ,, , , ; 10001(101)10=566
|
||||
optabRow , ,, , , ; 10011(101)10=630
|
||||
optabRow , ,, , , ; 10101(101)10=694
|
||||
optabRow , ,, , , ; 10111(101)10=758
|
||||
optabRow , ,, , , ; 11001(101)10=822
|
||||
optabRow , ,, , , ; 11011(101)10=886
|
||||
optabRow , ,, , , ; 11101(101)10=950
|
||||
optabRow 48, 8,S, %0010, MRPriDCBZ, MRSecDCBZ ; 11111(101)10=1014=DCBZ metatabLine %0011, MRSecDCBZ ; 48
|
||||
MROptabD
|
||||
optabRow 2, 4,L, %0000, MRPriPlainLoad, MRSecLoad ; 00000(101)11=023=LWZX (1)00000=32=LWZ metatabLine %0001, MRSecLoad ; 2
|
||||
optabRow 0, 1,L, %0000, MRPriPlainLoad, MRSecLoad ; 00010(101)11=087=LBZX (1)00010=34=LBZ metatabLine %0001, MRSecLoad ; 0
|
||||
optabRow 18, 4,S, %0000, MRPriPlainStore, MRSecDone ; 00100(101)11=151=STWX (1)00100=36=STW metatabLine %0001, MRSecDone ; 18
|
||||
optabRow 16, 1,S, %0000, MRPriPlainStore, MRSecDone ; 00110(101)11=215=STBX (1)00110=38=STB metatabLine %0001, MRSecDone ; 16
|
||||
optabRow 1, 2,L, %0000, MRPriPlainLoad, MRSecLoad ; 01000(101)11=279=LHZX (1)01000=40=LHZ metatabLine %0001, MRSecLoad ; 1
|
||||
optabRow 5, 2,L, %0000, MRPriPlainLoad, MRSecLoadExt ; 01010(101)11=343=LHAX (1)01010=42=LHA metatabLine %0001, MRSecLoadExt ; 5
|
||||
optabRow 17, 2,S, %0000, MRPriPlainStore, MRSecDone ; 01100(101)11=407=STHX (1)01100=44=STH metatabLine %0001, MRSecDone ; 17
|
||||
optabRow 26, 4,L, %0011, MRPriUpdLoad, MRSecLMW ; 01110(101)11=471 (1)01110=46=LMW metatabLine %0011, MRSecLMW ; 26
|
||||
optabRow 14, 4,L, %0000, MRPriPlainLoad, MRSecLFSu ; 10000(101)11=535=LFSX (1)10000=48=LFS metatabLine %0001, MRSecLFSu ; 14
|
||||
optabRow 15, 8,L, %0000, MRPriPlainLoad, MRSecLFDu ; 10010(101)11=599=LFDX (1)10010=50=LFD metatabLine %0001, MRSecLFDu ; 15
|
||||
optabRow 18, 4,S, %0000, MRPriSTFSx, MRSecDone ; 10100(101)11=663=STFSX (1)10100=52=STFS metatabLine %0001, MRSecDone ; 18
|
||||
optabRow 19, 8,S, %0000, MRPriSTFDx, MRSecDone ; 10110(101)11=727=STFDX (1)10110=54=STFD metatabLine %0001, MRSecDone ; 19
|
||||
optabRow , ,, , , ; 11000(101)11=791 (1)11000=56
|
||||
optabRow , ,, , , ; 11010(101)11=855 (1)11010=58
|
||||
optabRow , ,, , , ; 11100(101)11=919 (1)11100=60
|
||||
optabRow 18, 4,S, %0000, MRPriSTFDx, MRSecDone ; 11110(101)11=983=STFIWX (1)11110=62 metatabLine %0001, MRSecDone ; 18
|
||||
optabRow 2, 4,L, %0000, MRPriUpdLoad, MRSecLoad ; 00001(101)11=055=LWZUX (1)00001=33=LWZU metatabLine %0001, MRSecLoad ; 2
|
||||
optabRow 0, 1,L, %0000, MRPriUpdLoad, MRSecLoad ; 00011(101)11=119=LBZUX (1)00011=35=LBZU metatabLine %0001, MRSecLoad ; 0
|
||||
optabRow 18, 4,S, %0000, MRPriUpdStore, MRSecDone ; 00101(101)11=183=STWUX (1)00101=37=STWU metatabLine %0001, MRSecDone ; 18
|
||||
optabRow 16, 1,S, %0000, MRPriUpdStore, MRSecDone ; 00111(101)11=247=STBUX (1)00111=39=STBU metatabLine %0001, MRSecDone ; 16
|
||||
optabRow 1, 2,L, %0000, MRPriUpdLoad, MRSecLoad ; 01001(101)11=311=LHZUX (1)01001=41=LHZU metatabLine %0001, MRSecLoad ; 1
|
||||
optabRow 5, 2,L, %0000, MRPriUpdLoad, MRSecLoadExt ; 01011(101)11=375=LHAUX (1)01011=43=LHAU metatabLine %0001, MRSecLoadExt ; 5
|
||||
optabRow 17, 2,S, %0000, MRPriUpdStore, MRSecDone ; 01101(101)11=439=STHUX (1)01101=45=STHU metatabLine %0001, MRSecDone ; 17
|
||||
optabRow 30, 4,S, %0010, MRPriUpdStore, MRSecSTMW ; 01111(101)11=503 (1)01111=47=STMW metatabLine %0011, MRSecSTMW ; 30
|
||||
optabRow 14, 4,L, %0000, MRPriUpdLoad, MRSecLFSu ; 10001(101)11=567=LFSUX (1)10001=49=LFSU metatabLine %0001, MRSecLFSu ; 14
|
||||
optabRow 15, 8,L, %0000, MRPriUpdLoad, MRSecLFDu ; 10011(101)11=631=LFDUX (1)10011=51=LFDU metatabLine %0001, MRSecLFDu ; 15
|
||||
optabRow 18, 4,S, %0000, MRPriSTFSUx, MRSecDone ; 10101(101)11=695=STFSUX (1)10101=53=STFSU metatabLine %0001, MRSecDone ; 18
|
||||
optabRow 19, 8,S, %0000, MRPriSTFDUx, MRSecDone ; 10111(101)11=759=STFDUX (1)10111=55=STFDU metatabLine %0001, MRSecDone ; 19
|
||||
optabRow , ,, , , ; 11001(101)11=823 (1)11001=57
|
||||
optabRow , ,, , , ; 11011(101)11=887 (1)11011=59
|
||||
optabRow , ,, , , ; 11101(101)11=951 (1)11101=61
|
||||
optabRow , ,, , , ; 11111(101)11=1015 (1)11111=63
|
||||
optabRow 4,_L, MRResLWARX, %0000, MRPriPlainLoad, MRSecLWARX ; 00000(101)00=020=LWARX
|
||||
optabRow 8,_L, MRResLDARX, %0000, MRPriCrash, MRSecException ; 00010(101)00=084=LDARX
|
||||
optabNone ; 00100(101)00=148
|
||||
optabNone ; 00110(101)00=212
|
||||
optabNone ; 01000(101)00=276
|
||||
optabNone ; 01010(101)00=340
|
||||
optabNone ; 01100(101)00=404
|
||||
optabNone ; 01110(101)00=468
|
||||
optabNone ; 10000(101)00=532
|
||||
optabNone ; 10010(101)00=596
|
||||
optabNone ; 10100(101)00=660
|
||||
optabNone ; 10110(101)00=724
|
||||
optabRow 8,_L, MRResLDux, %0000, MRPriPlainLoad, MRSecLoad ; 11000(101)00=788
|
||||
optabRow 4,_L, MRResLWAux, %0000, MRPriPlainLoad, MRSecLoad ; 11010(101)00=852
|
||||
optabRow 8,_S, MRResST8ux, %0000, MRPriPlainStore, MRSecDone ; 11100(101)00=916
|
||||
optabNone ; 11110(101)00=980
|
||||
optabNone ; 00001(101)00=052
|
||||
optabNone ; 00011(101)00=116
|
||||
optabNone ; 00101(101)00=180
|
||||
optabNone ; 00111(101)00=244
|
||||
optabNone ; 01001(101)00=308
|
||||
optabNone ; 01011(101)00=372
|
||||
optabNone ; 01101(101)00=436
|
||||
optabNone ; 01111(101)00=500
|
||||
optabNone ; 10001(101)00=564
|
||||
optabNone ; 10011(101)00=628
|
||||
optabNone ; 10101(101)00=692
|
||||
optabNone ; 10111(101)00=756
|
||||
optabRow 8,_L, MRResLDux, %0000, MRPriUpdLoad, MRSecLoad ; 11001(101)00=820
|
||||
optabRow 8,_L, MRResX884, %0011, MRPriCrash, MRSecException ; 11011(101)00=884
|
||||
optabRow 8,_S, MRResST8ux, %0000, MRPriUpdStore, MRSecDone ; 11101(101)00=948
|
||||
optabRow 8,_S, MRResX1012, %0010, MRPriCrash, MRSecException ; 11111(101)00=1012
|
||||
optabRow 8,_L, MRResLDux, %0000, MRPriPlainLoad, MRSecLoad ; 00000(101)01=021=LDX
|
||||
optabNone ; 00010(101)01=085
|
||||
optabRow 8,_S, MRResST8ux, %0000, MRPriPlainStore, MRSecDone ; 00100(101)01=149=STDX
|
||||
optabNone ; 00110(101)01=213
|
||||
optabRow 4,_L, MRResLSCBX, %1011, MRPriLSCBX, MRSecLSCBX ; 01000(101)01=277=LSCBX (POWER)
|
||||
optabRow 4,_L, MRResLWAux, %0000, MRPriPlainLoad, MRSecLoad ; 01010(101)01=341=LWAX
|
||||
optabNone ; 01100(101)01=405
|
||||
optabNone ; 01110(101)01=469
|
||||
optabRow 4,_L, MRResLSWix, %1011, MRPriLSWX, MRSecLSWix ; 10000(101)01=533=LSWX
|
||||
optabRow 4,_L, MRResLSWix, %1111, MRPriLSWI, MRSecLSWix ; 10010(101)01=597=LSWI
|
||||
optabRow 4,_S, MRResSTSWix, %0010, MRPriSTSWX, MRSecStrStore ; 10100(101)01=661=STSWX
|
||||
optabRow 4,_S, MRResSTSWix, %1110, MRPriSTSWI, MRSecStrStore ; 10110(101)01=725=STSWI
|
||||
optabNone ; 11000(101)01=789
|
||||
optabNone ; 11010(101)01=853
|
||||
optabNone ; 11100(101)01=917
|
||||
optabNone ; 11110(101)01=981
|
||||
optabRow 8,_L, MRResLDux, %0000, MRPriUpdLoad, MRSecLoad ; 00001(101)01=053=LDUX
|
||||
optabNone ; 00011(101)01=117
|
||||
optabRow 8,_S, MRResST8ux, %0000, MRPriUpdStore, MRSecDone ; 00101(101)01=181=STDUX
|
||||
optabNone ; 00111(101)01=245
|
||||
optabNone ; 01001(101)01=309
|
||||
optabRow 4,_L, MRResLWAux, %0000, MRPriUpdLoad, MRSecDone ; 01011(101)01=373=LWAUX
|
||||
optabNone ; 01101(101)01=437
|
||||
optabNone ; 01111(101)01=501
|
||||
optabNone ; 10001(101)01=565
|
||||
optabNone ; 10011(101)01=629
|
||||
optabNone ; 10101(101)01=693
|
||||
optabNone ; 10111(101)01=757
|
||||
optabNone ; 11001(101)01=821
|
||||
optabNone ; 11011(101)01=885
|
||||
optabNone ; 11101(101)01=949
|
||||
optabNone ; 11111(101)01=1013
|
||||
optabNone ; 00000(101)10=022
|
||||
optabRow 1,_L, MRResRedoNoTrace, %0010, MRPriUpdLoad, MRSecRedoNoTrace ; 00010(101)10=086
|
||||
optabRow 4,_L, MRResSTWCX, %0000, MRPriPlainStore, MRSecSTWCX ; 00100(101)10=150=STWCX.
|
||||
optabRow 8,_S, MRResSTDCX, %0000, MRPriCrash, MRSecException ; 00110(101)10=214=STDCX.
|
||||
optabRow 1,_L, MRResRedoNoTrace, %0010, MRPriUpdLoad, MRSecRedoNoTrace ; 01000(101)10=278=DCBT
|
||||
optabNone ; 01010(101)10=342
|
||||
optabNone ; 01100(101)10=406
|
||||
optabNone ; 01110(101)10=470
|
||||
optabRow 4,_L, MRResLWBRX, %0010, MRPriUpdLoad, MRSecLWBRX ; 10000(101)10=534=LWBRX
|
||||
optabNone ; 10010(101)10=598
|
||||
optabRow 4,_S, MRResST4ux, %0000, MRPriSTWBRX, MRSecDone ; 10100(101)10=662=STWBRX
|
||||
optabNone ; 10110(101)10=726
|
||||
optabRow 2,_L, MRResLHBRX, %0010, MRPriUpdLoad, MRSecLHBRX ; 11000(101)10=790=LHBRX
|
||||
optabNone ; 11010(101)10=854
|
||||
optabRow 2,_S, MRResST2ux, %0000, MRPriSTHBRX, MRSecDone ; 11100(101)10=918=STHBRX
|
||||
optabRow 1,_L, MRResRedoNoTrace, %0010, MRPriUpdLoad, MRSecRedoNoTrace ; 11110(101)10=982=ICBI
|
||||
optabRow 1,_L, MRResRedoNoTrace, %0010, MRPriUpdLoad, MRSecRedoNoTrace ; 00001(101)10=054=DCBST
|
||||
optabNone ; 00011(101)10=118
|
||||
optabNone ; 00101(101)10=182
|
||||
optabRow 1,_L, MRResRedoNoTrace, %0010, MRPriUpdLoad, MRSecRedoNoTrace ; 00111(101)10=246=DCBTST
|
||||
optabRow 0,_L, MRResBlank, %0000, MRPriPlainLoad, MRSecException2 ; 01001(101)10=310=ECIWX
|
||||
optabNone ; 01011(101)10=374
|
||||
optabRow 0,_S, MRResBlank, %0000, MRPriPlainStore, MRSecException2 ; 01101(101)10=438=ECOWX
|
||||
optabNone ; 01111(101)10=502
|
||||
optabNone ; 10001(101)10=566
|
||||
optabNone ; 10011(101)10=630
|
||||
optabNone ; 10101(101)10=694
|
||||
optabNone ; 10111(101)10=758
|
||||
optabNone ; 11001(101)10=822
|
||||
optabNone ; 11011(101)10=886
|
||||
optabNone ; 11101(101)10=950
|
||||
optabRow 8,_S, MRResDCBZ, %0010, MRPriDCBZ, MRSecDCBZ ; 11111(101)10=1014=DCBZ
|
||||
MROptabD ; X-form opcodes ending with 0b11 correspond with D-form opcodes, so these tables can overlap
|
||||
optabRow 4,_L, MRResLWZux, %0000, MRPriPlainLoad, MRSecLoad ; 00000(101)11=023=LWZX (1)00000=32=LWZ
|
||||
optabRow 1,_L, MRResLBZux, %0000, MRPriPlainLoad, MRSecLoad ; 00010(101)11=087=LBZX (1)00010=34=LBZ
|
||||
optabRow 4,_S, MRResST4ux, %0000, MRPriPlainStore, MRSecDone ; 00100(101)11=151=STWX (1)00100=36=STW
|
||||
optabRow 1,_S, MRResST1ux, %0000, MRPriPlainStore, MRSecDone ; 00110(101)11=215=STBX (1)00110=38=STB
|
||||
optabRow 2,_L, MRResLHZux, %0000, MRPriPlainLoad, MRSecLoad ; 01000(101)11=279=LHZX (1)01000=40=LHZ
|
||||
optabRow 2,_L, MRResLHAux, %0000, MRPriPlainLoad, MRSecLoadExt ; 01010(101)11=343=LHAX (1)01010=42=LHA
|
||||
optabRow 2,_S, MRResST2ux, %0000, MRPriPlainStore, MRSecDone ; 01100(101)11=407=STHX (1)01100=44=STH
|
||||
optabRow 4,_L, MRResLMW, %0011, MRPriUpdLoad, MRSecLMW ; 01110(101)11=471 (1)01110=46=LMW
|
||||
optabRow 4,_L, MRResLFSux, %0000, MRPriPlainLoad, MRSecLFSu ; 10000(101)11=535=LFSX (1)10000=48=LFS
|
||||
optabRow 8,_L, MRResLFDux, %0000, MRPriPlainLoad, MRSecLFDu ; 10010(101)11=599=LFDX (1)10010=50=LFD
|
||||
optabRow 4,_S, MRResST4ux, %0000, MRPriSTFSx, MRSecDone ; 10100(101)11=663=STFSX (1)10100=52=STFS
|
||||
optabRow 8,_S, MRResST8ux, %0000, MRPriSTFDx, MRSecDone ; 10110(101)11=727=STFDX (1)10110=54=STFD
|
||||
optabNone ; 11000(101)11=791 (1)11000=56
|
||||
optabNone ; 11010(101)11=855 (1)11010=58
|
||||
optabNone ; 11100(101)11=919 (1)11100=60
|
||||
optabRow 4,_S, MRResST4ux, %0000, MRPriSTFDx, MRSecDone ; 11110(101)11=983=STFIWX (1)11110=62
|
||||
optabRow 4,_L, MRResLWZux, %0000, MRPriUpdLoad, MRSecLoad ; 00001(101)11=055=LWZUX (1)00001=33=LWZU
|
||||
optabRow 1,_L, MRResLBZux, %0000, MRPriUpdLoad, MRSecLoad ; 00011(101)11=119=LBZUX (1)00011=35=LBZU
|
||||
optabRow 4,_S, MRResST4ux, %0000, MRPriUpdStore, MRSecDone ; 00101(101)11=183=STWUX (1)00101=37=STWU
|
||||
optabRow 1,_S, MRResST1ux, %0000, MRPriUpdStore, MRSecDone ; 00111(101)11=247=STBUX (1)00111=39=STBU
|
||||
optabRow 2,_L, MRResLHZux, %0000, MRPriUpdLoad, MRSecLoad ; 01001(101)11=311=LHZUX (1)01001=41=LHZU
|
||||
optabRow 2,_L, MRResLHAux, %0000, MRPriUpdLoad, MRSecLoadExt ; 01011(101)11=375=LHAUX (1)01011=43=LHAU
|
||||
optabRow 2,_S, MRResST2ux, %0000, MRPriUpdStore, MRSecDone ; 01101(101)11=439=STHUX (1)01101=45=STHU
|
||||
optabRow 4,_S, MRResSTMW, %0010, MRPriUpdStore, MRSecSTMW ; 01111(101)11=503 (1)01111=47=STMW
|
||||
optabRow 4,_L, MRResLFSux, %0000, MRPriUpdLoad, MRSecLFSu ; 10001(101)11=567=LFSUX (1)10001=49=LFSU
|
||||
optabRow 8,_L, MRResLFDux, %0000, MRPriUpdLoad, MRSecLFDu ; 10011(101)11=631=LFDUX (1)10011=51=LFDU
|
||||
optabRow 4,_S, MRResST4ux, %0000, MRPriSTFSUx, MRSecDone ; 10101(101)11=695=STFSUX (1)10101=53=STFSU
|
||||
optabRow 8,_S, MRResST8ux, %0000, MRPriSTFDUx, MRSecDone ; 10111(101)11=759=STFDUX (1)10111=55=STFDU
|
||||
optabNone ; 11001(101)11=823 (1)11001=57
|
||||
optabNone ; 11011(101)11=887 (1)11011=59
|
||||
optabNone ; 11101(101)11=951 (1)11101=61
|
||||
optabNone ; 11111(101)11=1015 (1)11111=63
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
; AUTO-GENERATED SYMBOL LIST
|
||||
|
||||
########################################################################
|
||||
|
||||
MRPriCrash ; C00
|
||||
bl SystemCrash
|
||||
MRSecException ; C04
|
||||
|
|
88
NanoKernel/MRRestab.s
Executable file
88
NanoKernel/MRRestab.s
Executable file
|
@ -0,0 +1,88 @@
|
|||
; AUTO-GENERATED SYMBOL LIST
|
||||
|
||||
########################################################################
|
||||
|
||||
MACRO
|
||||
restabLine &myFlags, &secLabel
|
||||
DC.B &myFlags
|
||||
DC.B (&secLabel - MRBase) >> 2
|
||||
ENDM
|
||||
|
||||
MRRestab
|
||||
MRResLBZux restabLine %0001, MRSecLoad ; 0 ; LBZ(U)(X)
|
||||
MRResLHZux restabLine %0001, MRSecLoad ; 1 ; LHZ(U)(X)
|
||||
MRResLWZux restabLine %0001, MRSecLoad ; 2 ; LWZ(U)(X)
|
||||
MRResLDux restabLine %0001, MRSecLoad ; 3 ; LD(U)X + X-788 + X-820
|
||||
|
||||
restabLine %0001, MRSecException ; 4
|
||||
MRResLHAux restabLine %0001, MRSecLoadExt ; 5 ; LHA(U)(X)
|
||||
MRResLWAux restabLine %0001, MRSecLoad ; 6 ; LWA(U)X
|
||||
restabLine %0001, MRSecException ; 7
|
||||
|
||||
restabLine %0001, MRSecException ; 8
|
||||
MRResLHBRX restabLine %0011, MRSecLHBRX ; 9 ; LHBRX
|
||||
MRResLWBRX restabLine %0011, MRSecLWBRX ; 10 ; LWBRX
|
||||
restabLine %0001, MRSecException ; 11
|
||||
|
||||
restabLine %0001, MRSecException ; 12
|
||||
restabLine %0001, MRSecException ; 13
|
||||
MRResLFSux restabLine %0001, MRSecLFSu ; 14 ; LFS(U)(X)
|
||||
MRResLFDux restabLine %0001, MRSecLFDu ; 15 ; LFD(U)(X)
|
||||
|
||||
MRResST1ux restabLine %0001, MRSecDone ; 16 ; STB(U)(X)
|
||||
MRResST2ux restabLine %0001, MRSecDone ; 17 ; STH(U)(X) + STHBRX
|
||||
MRResST4ux restabLine %0001, MRSecDone ; 18 ; STW(U)(X) + STFS(U)(X) + STWBRX + STFIWX
|
||||
MRResST8ux restabLine %0001, MRSecDone ; 19 ; STFD(U)(X) + STDUX
|
||||
|
||||
MRResLWARX restabLine %0001, MRSecLWARX ; 20 ; LWARX
|
||||
MRResLDARX restabLine %0001, MRSecException ; 21 ; LDARX
|
||||
MRResSTWCX restabLine %0001, MRSecSTWCX ; 22 ; STWCX.
|
||||
MRResSTDCX restabLine %0001, MRSecException ; 23 ; STDCX.
|
||||
|
||||
restabLine %0001, MRSecException ; 24
|
||||
restabLine %0001, MRSecException ; 25
|
||||
MRResLMW restabLine %0011, MRSecLMW ; 26 ; LMW
|
||||
MRResX884 restabLine %0011, MRSecException ; 27 ; X-884
|
||||
|
||||
restabLine %0001, MRSecException ; 28
|
||||
restabLine %0001, MRSecException ; 29
|
||||
MRResSTMW restabLine %0011, MRSecSTMW ; 30 ; STMW
|
||||
MRResX1012 restabLine %0011, MRSecException ; 31 ; -1012
|
||||
|
||||
MRResLSWix restabLine %0011, MRSecLSWix ; 32 ; LSW(I|X)
|
||||
restabLine %0011, MRSecLSWix ; 33
|
||||
restabLine %0011, MRSecLSWix ; 34
|
||||
restabLine %0011, MRSecLSWix ; 35
|
||||
|
||||
MRResSTSWix restabLine %0011, MRSecStrStore ; 36 ; STSW(I|X)
|
||||
restabLine %0011, MRSecStrStore ; 37
|
||||
restabLine %0011, MRSecStrStore ; 38
|
||||
restabLine %0011, MRSecStrStore ; 39
|
||||
|
||||
MRResLSCBX restabLine %0011, MRSecLSCBX ; 40 ; LSCBX
|
||||
restabLine %0011, MRSecLSCBX ; 41
|
||||
restabLine %0011, MRSecLSCBX ; 42
|
||||
restabLine %0011, MRSecLSCBX ; 43
|
||||
restabLine %0011, MRSecLSCBX ; 44
|
||||
restabLine %0011, MRSecLSCBX ; 45
|
||||
restabLine %0011, MRSecLSCBX ; 46
|
||||
restabLine %0011, MRSecLSCBX ; 47
|
||||
|
||||
MRResDCBZ restabLine %0011, MRSecDCBZ ; 48 ; DCBZ
|
||||
restabLine %0001, MRSecException ; 49
|
||||
restabLine %0001, MRSecException ; 50
|
||||
restabLine %0001, MRSecException ; 51
|
||||
|
||||
restabLine %0001, MRSecException ; 52 ; A little birdie told me these will change in later versions
|
||||
restabLine %0001, MRSecException ; 53
|
||||
restabLine %0001, MRSecException ; 54
|
||||
restabLine %0001, MRSecException ; 55
|
||||
restabLine %0001, MRSecException ; 56
|
||||
restabLine %0001, MRSecException ; 57
|
||||
restabLine %0001, MRSecException ; 58
|
||||
restabLine %0001, MRSecException ; 59
|
||||
|
||||
restabLine %0001, MRSecException ; 60
|
||||
restabLine %0001, MRSecException ; 61
|
||||
MRResRedoNoTrace restabLine %0011, MRSecRedoNoTrace ; 62 ; DCBT + ICBI + DCBST + DCBTST + X-86
|
||||
MRResBlank restabLine %0001, MRSecException2 ; 63
|
49
NanoKernel/NKColdInts.s
Normal file
49
NanoKernel/NKColdInts.s
Normal file
|
@ -0,0 +1,49 @@
|
|||
; AUTO-GENERATED SYMBOL LIST
|
||||
|
||||
########################################################################
|
||||
|
||||
InstStorageInt
|
||||
bl LoadInterruptRegisters
|
||||
|
||||
andis. r8, r11, 0x4020 ; Not in HTAB || Bad seg reg
|
||||
beq @already_in_htab
|
||||
|
||||
stmw r14, KDP.r14(r1)
|
||||
mr r27, r10
|
||||
bl PutPTE
|
||||
bne @illegal_address ; Could not find in SegMap
|
||||
|
||||
mfsprg r24, 3
|
||||
mfmsr r14
|
||||
_set r15, r14, bitMsrDR
|
||||
addi r23, r1, KDP.VecTblMemRetry
|
||||
mtsprg 3, r23
|
||||
mr r19, r10
|
||||
mtmsr r15
|
||||
lbz r23, 0(r19)
|
||||
sync
|
||||
mtmsr r14
|
||||
mtsprg 3, r24
|
||||
lmw r14, KDP.r14(r1)
|
||||
b ReturnFromInt
|
||||
|
||||
@illegal_address
|
||||
lmw r14, KDP.r14(r1)
|
||||
li r8, ecInstPageFault
|
||||
blt Exception
|
||||
li r8, ecInstInvalidAddress
|
||||
b Exception
|
||||
|
||||
@already_in_htab
|
||||
andis. r8, r11, 0x800 ; Illegal access to legal EA?
|
||||
li r8, ecInstSupAccessViolation
|
||||
bne Exception
|
||||
li r8, ecInstHardwareFault
|
||||
b Exception
|
||||
|
||||
########################################################################
|
||||
|
||||
MachineCheckInt
|
||||
bl LoadInterruptRegisters
|
||||
li r8, ecMachineCheck
|
||||
b Exception
|
|
@ -124,8 +124,8 @@ maskGlobalFlags equ 0x00FF0000
|
|||
crMaskContextFlags equ %00001111
|
||||
maskContextFlags equ 0x0000FFFF
|
||||
; Bits 20-23 (CR5) MSR Flags FE0/SE/BE/FE1:
|
||||
crMaskMsrFlags equ %000001000
|
||||
maskMsrFlags equ 0x00000F000
|
||||
crMaskMsrFlags equ %00000100
|
||||
maskMsrFlags equ 0x00000F00
|
||||
; Bits 24-31 (CR6-CR7) Other Context Flags:
|
||||
_bitEqu 26, ContextFlagTraceWhenDone ; raised when MSR[SE] is up but we get an unrelated interrupt
|
||||
_bitEqu 27, ContextFlagMemRetryErr ; raised when an exception is raised during MemRetry
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
; AUTO-GENERATED SYMBOL LIST
|
||||
|
||||
########################################################################
|
||||
|
||||
; MemRetry error
|
||||
MRException
|
||||
mtsprg 3, r24
|
||||
|
||||
lwz r9, KDP.Enables(r1)
|
||||
extrwi r23, r17, 5, 25 ; extract accessLen field
|
||||
extrwi r23, r17, 5, 26 ; extract accessLen field
|
||||
rlwnm. r9, r9, r8, 0, 0 ; BGE taken if exception disabled
|
||||
|
||||
bcl BO_IF, mrFlagDidLoad, LoadExtraMRRegs
|
||||
|
@ -45,8 +45,8 @@ MRException
|
|||
;fall through ; exception enabled => run userspace handler
|
||||
|
||||
########################################################################
|
||||
|
||||
RunExceptionHandler
|
||||
; Exception or MRException that is Enabled (i.e. not being auto-forced to System)
|
||||
ExceptionCommon
|
||||
stw r10, CB.FaultSrcPC+4(r6) ; Save r10/SRR0, r12/LR, r3, r4
|
||||
stw r12, CB.FaultSrcLR+4(r6)
|
||||
stw r3, CB.FaultSrcR3+4(r6)
|
||||
|
@ -56,10 +56,10 @@ RunExceptionHandler
|
|||
stw r7, CB.IntraState.Flags(r6)
|
||||
stw r8, CB.IntraState.Enables(r6)
|
||||
|
||||
; Set up the Exception Handler context
|
||||
li r8, 0 ; r8/Enables = 0 (handler must not throw exception)
|
||||
lwz r10, CB.IntraState.Handler+4(r6) ; r10/SRR0 = handler addr
|
||||
lwz r4, CB.IntraState.HandlerArg+4(r6) ; r4 = arbitrary second argument
|
||||
; Use IntraState because context handles its own error
|
||||
li r8, 0 ; Enables=0 (any exceptions in handler go to System)
|
||||
lwz r10, CB.IntraState.Handler+4(r6) ; SRR0 = handler addr
|
||||
lwz r4, CB.IntraState.HandlerArg+4(r6) ; r4 = arbitrary second argument
|
||||
lwz r3, KDP.ECBPtrLogical(r1) ; r3 = ContextBlock ptr
|
||||
bc BO_IF, bitGlobalFlagSystem, @sys
|
||||
lwz r3, KDP.NCBCacheLA0(r1)
|
||||
|
@ -229,7 +229,7 @@ Exception
|
|||
addi r9, r9, 1
|
||||
stw r9, KDP.NKInfo.ExceptionCauseCounts(r8)
|
||||
|
||||
blt RunExceptionHandler ; exception enabled => run userspace handler
|
||||
blt ExceptionCommon ; exception enabled => run userspace handler
|
||||
;fall through ; Alt Context has left exception disabled => Sys Context
|
||||
|
||||
########################################################################
|
||||
|
@ -413,19 +413,19 @@ ReturnFromInt ; If ContextFlagMemRetryErr && ContextFlagResumeMemRetry, please p
|
|||
stw r4, KDP.r4(r1)
|
||||
stw r5, KDP.r5(r1)
|
||||
|
||||
lwz r8, CB.r7+7(r6)
|
||||
lwz r8, CB.r7+4(r6)
|
||||
stw r8, KDP.r7(r1)
|
||||
lwz r8, CB.r8+7(r6)
|
||||
lwz r8, CB.r8+4(r6)
|
||||
stw r8, KDP.r8(r1)
|
||||
lwz r8, CB.r9+7(r6)
|
||||
lwz r8, CB.r9+4(r6)
|
||||
stw r8, KDP.r9(r1)
|
||||
lwz r8, CB.r10+7(r6)
|
||||
lwz r8, CB.r10+4(r6)
|
||||
stw r8, KDP.r10(r1)
|
||||
lwz r8, CB.r11+7(r6)
|
||||
lwz r8, CB.r11+4(r6)
|
||||
stw r8, KDP.r11(r1)
|
||||
lwz r8, CB.r12+7(r6)
|
||||
lwz r8, CB.r12+4(r6)
|
||||
stw r8, KDP.r12(r1)
|
||||
lwz r8, CB.r13+7(r6)
|
||||
lwz r8, CB.r13+4(r6)
|
||||
stw r8, KDP.r13(r1)
|
||||
|
||||
stmw r14, KDP.r14(r1)
|
||||
|
@ -437,15 +437,15 @@ ReturnFromInt ; If ContextFlagMemRetryErr && ContextFlagResumeMemRetry, please p
|
|||
lwz r18, KernelState.MemRet18+4(r9)
|
||||
_clear r16, r7, bitContextFlagMemRetryErr
|
||||
|
||||
lwz r25, KDP.MRBase(r1) ; MRUnknown is indexed by the first arg of MROptab?
|
||||
lwz r25, KDP.MRBase(r1) ; MRRestab is indexed by the first arg of MROptab?
|
||||
extrwi. r22, r17, 4, 27 ;
|
||||
add r19, r19, r22 ; Correct r19 (EA) by adding len from r17
|
||||
rlwimi r25, r17, 7, 25, 30 ; The top of MRUnknown is... mysterious!
|
||||
lhz r26, MRUnknown-MRBase(r25) ; leaving this incorrect as a reminder!
|
||||
rlwimi r25, r17, 7, 25, 30
|
||||
lhz r26, MRRestab-MRBase(r25)
|
||||
|
||||
insrwi r25, r19, 3, 28 ; Set Memtab alignment modulus
|
||||
stw r16, KDP.Flags(r1)
|
||||
rlwimi r26, r26, 8, 8, 15 ; First byte of MRUnknown is for cr3/cr4
|
||||
rlwimi r26, r26, 8, 8, 15 ; First byte of MRRestab is for cr3/cr4
|
||||
insrwi r25, r17, 4, 24 ; len and load/store from second arg of MROptab?
|
||||
mtcrf 0x10, r26 ; Set CR3
|
||||
lha r22, MRMemtab-MRBase(r25) ; Jump to MRMemtab...
|
||||
|
@ -458,7 +458,7 @@ ReturnFromInt ; If ContextFlagMemRetryErr && ContextFlagResumeMemRetry, please p
|
|||
mfmsr r14
|
||||
_set r15, r14, bitMsrDR
|
||||
mtmsr r15
|
||||
rlwimi r25, r26, 2, 22, 29 ; Second byte of MRUnknown is a secondary routine
|
||||
rlwimi r25, r26, 2, 22, 29 ; Second byte of MRRestab is a secondary routine
|
||||
bnelr
|
||||
b MRDoSecondary
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ ExternalInt1
|
|||
|
||||
lwz r3, KDP.CodeBase(r1) ; Loop that number up in the table
|
||||
rlwimi r3, r0, 0, 0x0000003F
|
||||
lbz r2, IntLookupTable-NKTop(r3)
|
||||
lbz r2, IntLookupTable-CodeBase(r3)
|
||||
mfcr r0
|
||||
lwz r3, KDP.EmuIntLevelPtr(r1)
|
||||
clrlwi. r2, r2, 29
|
||||
|
@ -295,9 +295,9 @@ EmulateDataAccess
|
|||
bge @xform
|
||||
|
||||
;dform
|
||||
rlwimi r25, r27, 7, 26, 29 ; opcode >= 32
|
||||
rlwimi r25, r27, 7, 26, 29
|
||||
rlwimi r25, r27, 12, 25, 25
|
||||
lwz r26, MROptabD - MRBase(r25) ; table of 4b elements, index = major opcode bits 51234 (this is the last quarter of MROptabX)
|
||||
lwz r26, MROptabD - MRBase(r25) ; table of 4b elements, index = major opcode bits 51234 (this is the last quarter of MROptabX)
|
||||
extsh r23, r27 ; r23 = register offset field, sign-extended
|
||||
rlwimi r25, r26, 26, 22, 29
|
||||
mtlr r25 ; dest = r25 = first of two function ptrs in table entry
|
||||
|
@ -306,11 +306,11 @@ EmulateDataAccess
|
|||
rlwimi r17, r26, 6, 26, 5 ; r17 = pretend X-form inst with: maj opcode (from tbl), rS/D and RA (from inst), min opcode (from tbl)
|
||||
blr
|
||||
|
||||
@xform ; opcode <= 31
|
||||
@xform
|
||||
rlwimi r25, r27, 27, 26, 29
|
||||
rlwimi r25, r27, 0, 25, 25
|
||||
rlwimi r25, r27, 6, 23, 24
|
||||
lwz r26, MROptabX - MRBase(r25) ; table of 4b elements, index = minor (x-form) opcode bits 8940123
|
||||
lwz r26, MROptabX - MRBase(r25) ; table of 4b elements, index = minor (x-form) opcode bits 8940123
|
||||
rlwinm r23, r27, 23, 25, 29 ; r23 = 4 * rB
|
||||
rlwimi r25, r26, 26, 22, 29
|
||||
mtlr r25 ; dest = r25 = first of two function ptrs in table entry
|
||||
|
@ -352,9 +352,9 @@ AlignmentInt
|
|||
lwz r16, KDP.Flags(r1)
|
||||
rlwimi r25, r27, 24, 23, 29 ; add constant fields from dsisr (*4) to FDP
|
||||
rlwimi r16, r16, 27, 26, 26 ; ContextFlagTraceWhenDone = MsrSE
|
||||
bne @X_form
|
||||
bne @xform
|
||||
|
||||
; D- or DS-form (immediate-indexed) instruction
|
||||
;dform
|
||||
lwz r26, MROptabD - MRBase(r25) ; use upper quarter of table
|
||||
mfmsr r14
|
||||
rlwimi r25, r26, 26, 22, 29 ; third byte of lookup value is a /4 code offset in FDP
|
||||
|
@ -364,8 +364,7 @@ AlignmentInt
|
|||
rlwimi r17, r26, 6, 26, 5 ; wrap some shite around the register values
|
||||
blr
|
||||
|
||||
@X_form
|
||||
; X-form (register-indexed) instruction
|
||||
@xform
|
||||
lwz r26, MROptabX - MRBase(r25)
|
||||
mfmsr r14
|
||||
rlwimi r25, r26, 26, 22, 29
|
||||
|
@ -378,55 +377,3 @@ AlignmentInt
|
|||
lwz r27, 0(r10)
|
||||
mtmsr r14
|
||||
blr
|
||||
|
||||
########################################################################
|
||||
|
||||
INCLUDE 'NKMemRetry.s'
|
||||
|
||||
########################################################################
|
||||
|
||||
InstStorageInt
|
||||
bl LoadInterruptRegisters
|
||||
|
||||
andis. r8, r11, 0x4020 ; what the hell are these MSR bits?
|
||||
beq major_0x039dc_0x14
|
||||
|
||||
stmw r14, KDP.r14(r1)
|
||||
mr r27, r10
|
||||
bl PutPTE
|
||||
bne @not_in_htab
|
||||
|
||||
mfsprg r24, 3
|
||||
mfmsr r14
|
||||
_set r15, r14, bitMsrDR
|
||||
addi r23, r1, KDP.VecTblMemRetry
|
||||
mtsprg 3, r23
|
||||
mr r19, r10
|
||||
mtmsr r15
|
||||
lbz r23, 0(r19)
|
||||
sync
|
||||
mtmsr r14
|
||||
mtsprg 3, r24
|
||||
lmw r14, KDP.r14(r1)
|
||||
b ReturnFromInt
|
||||
|
||||
@not_in_htab
|
||||
lmw r14, KDP.r14(r1)
|
||||
li r8, ecInstPageFault
|
||||
blt Exception
|
||||
li r8, ecInstInvalidAddress
|
||||
b Exception
|
||||
|
||||
major_0x039dc_0x14
|
||||
andis. r8, r11, 0x800
|
||||
li r8, ecInstSupAccessViolation
|
||||
bne Exception
|
||||
li r8, ecInstHardwareFault
|
||||
b Exception
|
||||
|
||||
########################################################################
|
||||
|
||||
MachineCheckInt
|
||||
bl LoadInterruptRegisters
|
||||
li r8, ecMachineCheck
|
||||
b Exception
|
|
@ -10,6 +10,7 @@
|
|||
; VMSecondLastExportedFunc (=> NKMPCalls)
|
||||
; kcVMDispatch (=> NKInit)
|
||||
|
||||
########################################################################
|
||||
|
||||
MaxVMCallCount equ 26
|
||||
|
||||
|
@ -20,7 +21,7 @@ MaxVMCallCount equ 26
|
|||
|
||||
@h
|
||||
org VMDispatchTable + &n * 2
|
||||
dc.w &code - NKTop - &n * 2
|
||||
dc.w &code - CodeBase - &n * 2
|
||||
|
||||
org @h
|
||||
|
||||
|
@ -36,7 +37,7 @@ KCallVMDispatch ; OUTSIDE REFERER
|
|||
lwz r7, KDP.CodeBase(r1)
|
||||
cmplwi r3, MaxVMCallCount
|
||||
insrwi r7, r3, 7, 24
|
||||
lhz r8, VMDispatchTable - NKTop(r7)
|
||||
lhz r8, VMDispatchTable - CodeBase(r7)
|
||||
lwz r9, KDP.VMLogicalPages(r1)
|
||||
add r8, r8, r7
|
||||
mtlr r8
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
|
||||
MACRO
|
||||
llabel ®, &val
|
||||
lisori ®, &val - NKTop
|
||||
lisori ®, &val - CodeBase
|
||||
ENDM
|
||||
|
||||
|
||||
|
@ -307,7 +307,7 @@ _clear_lbit set 31
|
|||
MACRO
|
||||
_kaddr &rd, &rs, &label
|
||||
|
||||
addi &rd, &rs, (&label-NKTop)
|
||||
addi &rd, &rs, (&label-CodeBase)
|
||||
|
||||
ENDM
|
||||
|
||||
|
@ -315,7 +315,7 @@ _clear_lbit set 31
|
|||
MACRO
|
||||
_alignToCacheBlock
|
||||
|
||||
IF (*-NKTop) & 0x1f
|
||||
IF (*-CodeBase) & 0x1f
|
||||
b * + 4
|
||||
_alignToCacheBlock
|
||||
ENDIF
|
||||
|
@ -328,7 +328,7 @@ _clear_lbit set 31
|
|||
|
||||
my_align set 1 << (&arg)
|
||||
my_mask set my_align - 1
|
||||
my_offset set * - NKTop
|
||||
my_offset set * - CodeBase
|
||||
my_pad set (my_align - (my_offset & my_mask)) & my_mask
|
||||
IF my_pad
|
||||
dcb.l my_pad>>2, 0x48000004
|
||||
|
|
|
@ -8,11 +8,18 @@ NKFiles =
|
|||
{NKDir}NKMacros.s ¶
|
||||
{NKDir}NKInit.s ¶
|
||||
{NKDir}NKSystemCrash.s ¶
|
||||
{NKDir}NKIntHandlers.s ¶
|
||||
{NKDir}NKHotInts.s ¶
|
||||
{NKDir}NKColdInts.s ¶
|
||||
{NKDir}MROptabCode.s ¶
|
||||
{NKDir}MRMemtabCode.s ¶
|
||||
{NKDir}MRInterrupts.s ¶
|
||||
{NKDir}MROptab.s ¶
|
||||
{NKDir}MRMemtab.s ¶
|
||||
{NKDir}MRRestab.s ¶
|
||||
{NKDir}NKMemory.s ¶
|
||||
{NKDir}NKExceptions.s ¶
|
||||
{NKDir}NKFloatingPt.s ¶
|
||||
{NKDir}NKSoftInt.s ¶
|
||||
{NKDir}NKSoftInts.s ¶
|
||||
{NKDir}NKReset.s ¶
|
||||
{NKDir}NKLegacyVM.s ¶
|
||||
|
||||
|
|
|
@ -1,150 +0,0 @@
|
|||
; Control flow between PRIMARY and SECONDARY optab routines:
|
||||
|
||||
; INTERRUPT HANDLER sets:
|
||||
; r14 = original interrupt MSR
|
||||
; r15 = MSR | MSR[DR]
|
||||
; r17 = pretend inst: 0-5 from optab || 6-10 rS/rD || 11-15 rA || 21-25 zero || 26-31 from optab
|
||||
; r18 = effective address attempted
|
||||
; r25 = dirty MRBase ptr
|
||||
; r26 = OpTab entry
|
||||
; r27 = instruction
|
||||
; LR = r25 = address of primary routine (jumped to)
|
||||
|
||||
; PRIMARY ROUTINE
|
||||
|
||||
; LOOP until SECONDARY ROUTINE calls, or is, an exit routine
|
||||
; MRPriDone accepts:
|
||||
; r17 = pretend inst: 0-5 from optab || 6-10 rS/rD || 11-15 rA || 21-26 ?? || 27-30 accessLen || 31 isLoad (NB: what about bottom 6 bits??)
|
||||
; r19 = address first byte *after* the string to be accessed
|
||||
; r25 = dirty MRBase ptr
|
||||
; r26 = the original OpTab entry
|
||||
; EQ = should continue (NE => skip to MRDoSecondary)
|
||||
|
||||
; MRPriDone sets:
|
||||
; r25 = address of secondary routine
|
||||
; MSR = r15
|
||||
; SPRG3 = VecTblMemRetry
|
||||
; LR = r22 = address of MemAccess routine (jumped to)
|
||||
|
||||
; MemAccess routine accepts:
|
||||
; r17 = pretend inst as noted above (will be modified)
|
||||
; r19 = address first byte *after* the string to be accessed (not modified)
|
||||
; r20/r21 = right-justified data (stores only)
|
||||
|
||||
; MemAccess routine sets:
|
||||
; r17 = same but with len field decremented
|
||||
; r20/r21 = right-justified data (loads only)
|
||||
; r26 = scratch
|
||||
|
||||
; MRDoSecondary sets:
|
||||
; r17 = pretend inst as above
|
||||
; MSR = r14
|
||||
; SPRG3 = r24
|
||||
; userspace register rA in EWA = r18 (EA), and CR3.SO = 1 (skipped for r0 or if CR3.EQ)
|
||||
; LR = r25 = address of secondary routine (jumped to)
|
||||
|
||||
; SECONDARY ROUTINE
|
||||
|
||||
; EXIT ROUTINE
|
||||
|
||||
|
||||
|
||||
; registers in broad terms:
|
||||
; r16 Flags (why not r7?)
|
||||
;*r17 Status
|
||||
;*r18 effective address
|
||||
;*r19 end address
|
||||
;*r20/r21 data
|
||||
; r25 MemRetry pointer (often dirty)
|
||||
; r26 OpTab entry
|
||||
; r27 instruction
|
||||
|
||||
|
||||
_align 10
|
||||
MRBase
|
||||
INCLUDE 'MROptabCode.s' ; c00:1154
|
||||
INCLUDE 'MRMemtabCode.s' ; 1154:13f4
|
||||
INCLUDE 'MRInterrupts.s' ; 13f4:14f4
|
||||
INCLUDE 'MROptab.s' ; 14f4:16f4
|
||||
INCLUDE 'MRMemtab.s' ; 16f4:17f4
|
||||
; INCLUDE 'MRUnknown.s' ; 17f4:1874
|
||||
MRUnknown
|
||||
dcb.b 128, 0
|
||||
|
||||
END
|
||||
|
||||
; There is definitely some structure here -- but what does it mean?? Crack the bastard...
|
||||
|
||||
; metatabLine %0001, MRSecLoad ; 0
|
||||
; metatabLine %0001, MRSecLoad ; 1
|
||||
; metatabLine %0001, MRSecLoad ; 2
|
||||
; metatabLine %0001, MRSecLoad ; 3
|
||||
|
||||
metatabLine %0001, MRSecException ; 4
|
||||
; metatabLine %0001, MRSecLoadExt ; 5
|
||||
; metatabLine %0001, MRSecLoad ; 6
|
||||
metatabLine %0001, MRSecException ; 7
|
||||
metatabLine %0001, MRSecException ; 8
|
||||
; metatabLine %0011, MRSecLHBRX ; 9
|
||||
; metatabLine %0011, MRSecLWBRX ; 10
|
||||
metatabLine %0001, MRSecException ; 11
|
||||
metatabLine %0001, MRSecException ; 12
|
||||
metatabLine %0001, MRSecException ; 13
|
||||
; metatabLine %0001, MRSecLFSu ; 14
|
||||
; metatabLine %0001, MRSecLFDu ; 15
|
||||
|
||||
; metatabLine %0001, MRSecDone ; 16
|
||||
; metatabLine %0001, MRSecDone ; 17
|
||||
; metatabLine %0001, MRSecDone ; 18
|
||||
; metatabLine %0001, MRSecDone ; 19
|
||||
|
||||
; metatabLine %0001, MRSecLWARX ; 20 ; MRSecLoad
|
||||
; metatabLine %0001, MRSecException ; 21
|
||||
; metatabLine %0001, MRSecSTWCX ; 22 ; MRSecDone
|
||||
; metatabLine %0001, MRSecException ; 23
|
||||
|
||||
metatabLine %0001, MRSecException ; 24
|
||||
metatabLine %0001, MRSecException ; 25
|
||||
; metatabLine %0011, MRSecLMW ; 26
|
||||
; metatabLine %0011, MRSecException ; 27
|
||||
metatabLine %0001, MRSecException ; 28
|
||||
metatabLine %0001, MRSecException ; 29
|
||||
; metatabLine %0011, MRSecSTMW ; 30
|
||||
; metatabLine %0011, MRSecException ; 31
|
||||
|
||||
|
||||
; metatabLine %0011, MRSecLSWix ; 32
|
||||
metatabLine %0011, MRSecLSWix ; 33
|
||||
metatabLine %0011, MRSecLSWix ; 34
|
||||
metatabLine %0011, MRSecLSWix ; 35
|
||||
|
||||
; metatabLine %0011, MRSecStrStore ; 36
|
||||
metatabLine %0011, MRSecStrStore ; 37
|
||||
metatabLine %0011, MRSecStrStore ; 38
|
||||
metatabLine %0011, MRSecStrStore ; 39
|
||||
|
||||
; metatabLine %0011, MRSecLSCBX ; 40
|
||||
metatabLine %0011, MRSecLSCBX ; 41
|
||||
metatabLine %0011, MRSecLSCBX ; 42
|
||||
metatabLine %0011, MRSecLSCBX ; 43
|
||||
metatabLine %0011, MRSecLSCBX ; 44
|
||||
metatabLine %0011, MRSecLSCBX ; 45
|
||||
metatabLine %0011, MRSecLSCBX ; 46
|
||||
metatabLine %0011, MRSecLSCBX ; 47
|
||||
|
||||
; metatabLine %0011, MRSecDCBZ ; 48
|
||||
metatabLine %0001, MRSecException ; 49
|
||||
metatabLine %0001, MRSecException ; 50
|
||||
metatabLine %0001, MRSecException ; 51
|
||||
metatabLine %0001, MRSecException ; 52 ; MRSecDone
|
||||
metatabLine %0001, MRSecException ; 53 ; FDP_0370
|
||||
metatabLine %0001, MRSecException ; 54 ; FDP_0384
|
||||
metatabLine %0001, MRSecException ; 55 ; FDP_0398
|
||||
metatabLine %0001, MRSecException ; 56 ; MRSecDone
|
||||
metatabLine %0001, MRSecException ; 57 ; MRSecDone
|
||||
metatabLine %0001, MRSecException ; 58 ; MRSecDone
|
||||
metatabLine %0001, MRSecException ; 59 ; MRSecDone
|
||||
metatabLine %0001, MRSecException ; 60
|
||||
metatabLine %0001, MRSecException ; 61
|
||||
; metatabLine %0011, MRSecRedoNoTrace ; 62
|
||||
; metatabLine %0001, MRSecException2 ; 63
|
|
@ -1,3 +1,7 @@
|
|||
; AUTO-GENERATED SYMBOL LIST
|
||||
|
||||
########################################################################
|
||||
|
||||
SystemCrash
|
||||
mfsprg r1, 0
|
||||
|
||||
|
|
|
@ -1,16 +1,26 @@
|
|||
include 'InfoRecords.a'
|
||||
include 'InfoRecords.a'
|
||||
|
||||
include 'NKStructs.s'
|
||||
include 'NKEquates.s'
|
||||
include 'NKMacros.s'
|
||||
include 'NKStructs.s'
|
||||
include 'NKEquates.s'
|
||||
include 'NKMacros.s'
|
||||
|
||||
NKTop
|
||||
include 'NKInit.s'
|
||||
include 'NKSystemCrash.s'
|
||||
include 'NKIntHandlers.s'
|
||||
include 'NKMemory.s'
|
||||
include 'NKExceptions.s'
|
||||
include 'NKFloatingPt.s'
|
||||
include 'NKSoftInt.s'
|
||||
include 'NKLegacyVM.s'
|
||||
NKBtm
|
||||
CodeBase
|
||||
include 'NKInit.s'
|
||||
include 'NKSystemCrash.s'
|
||||
include 'NKHotInts.s'
|
||||
include 'NKColdInts.s'
|
||||
|
||||
_align 10
|
||||
MRBase
|
||||
include 'MROptabCode.s' ; c00:1154
|
||||
include 'MRMemtabCode.s' ; 1154:13f4
|
||||
include 'MRInterrupts.s' ; 13f4:14f4
|
||||
include 'MROptab.s' ; 14f4:16f4
|
||||
include 'MRMemtab.s' ; 16f4:17f4
|
||||
include 'MRRestab.s' ; 17f4:1874
|
||||
|
||||
include 'NKMemory.s'
|
||||
include 'NKExceptions.s'
|
||||
include 'NKFloatingPt.s'
|
||||
include 'NKSoftInts.s'
|
||||
include 'NKLegacyVM.s'
|
||||
|
|
Loading…
Reference in New Issue
Block a user