Skip to content

Commit 50bd233

Browse files
committed
[rtg] add debug output to SetMMU
1 parent 03857ce commit 50bd233

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

rtg/replay.card.asm

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1765,6 +1765,8 @@ _LVOUnlockContextList EQU -216
17651765
_LVOSetPropertyList EQU -228
17661766
_LVORebuildTreesA EQU -360
17671767

1768+
BUG "SetMMU(addr:%lx size:%lx flags:%lx)",a0,d0,d1
1769+
17681770
movem.l d2-d7/a2-a5,-(sp)
17691771

17701772
movem.l d0/a0,-(sp) ; (sp),4(sp) = size,addr
@@ -1787,6 +1789,7 @@ _LVORebuildTreesA EQU -360
17871789
.done
17881790
PERMIT
17891791

1792+
BUG "mmu.library = %lx",d2
17901793
tst.l d2
17911794
bne.b .mmulib_ok
17921795

@@ -1799,25 +1802,31 @@ _LVORebuildTreesA EQU -360
17991802
tst.b d0
18001803
bne.b .mmu_ok
18011804

1805+
BUG "GetMMUType = <none>"
18021806
pea .nommu(pc)
18031807
bra .failed
18041808

18051809
.mmu_ok
18061810
sub.b #'0',d0
1811+
BUG "GetMMUType = 680%ld0",d0
18071812

18081813
; Get contexts
18091814
CALLLIB _LVODefaultContext
1815+
BUG "DefaultContext = %lx",d0
18101816
movea.l d0,a5 ; a5 = ctx
18111817
move.l d0,a0
18121818
CALLLIB _LVOSuperContext
1819+
BUG "SuperContext = %lx",d0
18131820
movea.l d0,a4 ; a4 = sctx
18141821

18151822
move.l a5,d0
18161823
CALLLIB _LVOGetPageSize
1824+
BUG "GetPageSize (ctx) = %lx (%ld bytes)",d0,d0
18171825
move.l d0,d7 ; d7 = pagesize
18181826

18191827
move.l a4,d0
18201828
CALLLIB _LVOGetPageSize
1829+
BUG "GetPageSize (sctx) = %lx (%ld bytes)",d0,d0
18211830
cmp.l d0,d7
18221831
beq.b .page_ok
18231832

@@ -1828,6 +1837,8 @@ _LVORebuildTreesA EQU -360
18281837
; adjust address and size to match page size
18291838
movem.l (sp),d0/d1
18301839

1840+
BUG "Requested region = %lx,%lx",d1,d0
1841+
18311842
move.l d7,d6
18321843
subq.l #1,d6
18331844
not.l d6
@@ -1838,6 +1849,8 @@ _LVORebuildTreesA EQU -360
18381849
add.l d7,d0
18391850
and.l d6,d0
18401851

1852+
BUG "Aligned region = %lx,%lx",d1,d0
1853+
18411854
movem.l d0/d1,(sp) ; (sp),4(sp) = adjusted size/addr
18421855

18431856
; Lock contexts
@@ -1850,6 +1863,7 @@ _LVORebuildTreesA EQU -360
18501863
; Get mapping
18511864
move.l a5,a0
18521865
CALLLIB _LVOGetMapping (ctx)
1866+
BUG "ctx mapping = %lx",d0
18531867
move.l d0,d5 ; d5 = ctx mapping
18541868
bne.b .ctx_ok
18551869

@@ -1858,6 +1872,7 @@ _LVORebuildTreesA EQU -360
18581872

18591873
.ctx_ok move.l a4,a0
18601874
CALLLIB _LVOGetMapping (sctx)
1875+
BUG "sctx mapping = %lx",d0
18611876
move.l d0,d4 ; d4 = ctx mapping
18621877
bne.b .sctx_ok
18631878

@@ -1869,7 +1884,9 @@ _LVORebuildTreesA EQU -360
18691884
move.l a5,a0
18701885
move.l d7,a1
18711886
lea .tagDone,a2
1887+
BUG "GetPropertiesA = %lx,%lx,%lx",a0,a1,(a2)
18721888
CALLLIB _LVOGetPropertiesA (ctx,from,TAG_DONE)
1889+
BUG "GetPropertiesA => %lx",d0
18731890
move.l d0,(sp) ; (sp) = old flags (ctx)
18741891

18751892
move.l a5,a0
@@ -1878,6 +1895,7 @@ _LVORebuildTreesA EQU -360
18781895
move.l d6,d0
18791896
move.l d7,a1
18801897
lea .tagDone(pc),a2
1898+
BUG "SetPropertiesA = %lx,%lx,%lx %lx,%lx %lx",a0,d1,d2,a1,d0,(a2)
18811899
CALLLIB _LVOSetPropertiesA (ctx,flags,mask,from,size,TAG_DONE)
18821900
tst.b d0
18831901
beq .revert
@@ -1886,7 +1904,9 @@ _LVORebuildTreesA EQU -360
18861904
move.l d7,a1
18871905
movem.l (sp),d0/a1
18881906
lea .tagDone,a2
1907+
BUG "GetPropertiesA = %lx,%lx,%lx",a0,a1,(a2)
18891908
CALLLIB _LVOGetPropertiesA (sctx,from,TAG_DONE)
1909+
BUG "GetPropertiesA => %lx",d0
18901910
move.l d0,4(sp) ; 4(sp) = old flags (sctx)
18911911

18921912
move.l a4,a0
@@ -1895,6 +1915,7 @@ _LVORebuildTreesA EQU -360
18951915
move.l d6,d0
18961916
move.l d7,a1
18971917
lea .tagDone(pc),a2
1918+
BUG "SetPropertiesA = %lx,%lx,%lx %lx,%lx %lx",a0,d1,d2,a1,d0,(a2)
18981919
CALLLIB _LVOSetPropertiesA (sctx,flags,mask,from,size,TAG_DONE)
18991920
tst.b d0
19001921
beq .revert
@@ -1904,6 +1925,7 @@ _LVORebuildTreesA EQU -360
19041925
move.l a4,4(sp)
19051926
clr.l 8(sp)
19061927
move.l sp,a0
1928+
BUG "RebuildTreesA = %lx,%lx,%lx",(a0),4(a0),8(a0)
19071929
CALLLIB _LVORebuildTreesA (ctx,sctx,NULL)
19081930
add.w #4*3,sp
19091931
tst.b d0
@@ -1913,47 +1935,58 @@ _LVORebuildTreesA EQU -360
19131935
pea .cleanup(pc)
19141936
move.l a5,a0
19151937
move.l d5,a1
1938+
BUG "SetPropertyList = %lx,%lx",a0,a1
19161939
CALLLIB _LVOSetPropertyList (ctx,ctxl)
19171940
move.l a4,a0
19181941
move.l d4,a1
1942+
BUG "SetPropertyList = %lx,%lx",a0,a1
19191943
CALLLIB _LVOSetPropertyList (sctx,sctxl)
19201944

19211945
.failed
1946+
BUG "Failure!"
19221947
moveq.l #-1,d0
19231948
move.l d0,4(sp) ; set return values
19241949
move.l d0,8(sp)
19251950
rts
19261951

19271952
.success
1953+
BUG "Success!"
19281954

19291955
.cleanup
19301956
move.l a4,a0
19311957
move.l d4,a1
1958+
; BUG "ReleaseMapping = %lx,%lx",a0,a1
19321959
CALLLIB _LVOReleaseMapping (sctx,sctxl)
19331960

19341961
.release
19351962
move.l a5,a0
19361963
move.l d5,a1
1964+
; BUG "ReleaseMapping = %lx,%lx",a0,a1
19371965
CALLLIB _LVOReleaseMapping (ctx,ctxl)
19381966

19391967
.unlock
19401968

19411969
; Unlock contexts
19421970
movea.l a4,a0
1971+
; BUG "UnlockMMUContext = %lx",a0
19431972
CALLLIB _LVOUnlockMMUContext (sctx)
19441973
movea.l a5,a0
1974+
; BUG "UnlockMMUContext = %lx",a0
19451975
CALLLIB _LVOUnlockMMUContext (ctx)
1976+
; BUG "UnlockContextList"
19461977
CALLLIB _LVOUnlockContextList
19471978

19481979
.nommu
19491980

19501981
move.l a6,a1
19511982
move.l 4.w,a6
1983+
; BUG "CloseLibrary = %lx",a1
19521984
CALLLIB _LVOCloseLibrary
19531985

19541986
.exit:
19551987
movem.l (sp)+,d0/d1
19561988
movem.l (sp)+,d2-d7/a2-a5
1989+
; BUG "DONE"
19571990
rts
19581991

19591992
.mmuName dc.b "mmu.library",0

0 commit comments

Comments
 (0)