Commit 112a81d2 authored by Mike Stephens's avatar Mike Stephens
Browse files

1 Simplify source by removing various long-standing compile flags and pre-Medusa h/w support

 2 Fix bug with Pages_Unsafe/Pages_Safe page moving for StrongARM
   (interrupt hole) - also better performance for StrongARM

 3 Improve perfromance of physical memory clear for StrongARM
   (make sure it uses burst write for STM)

 4 Suspend Chocolate task switching for StrongARM if SALDMIBbroken
   is TRUE
parent bde2a684
......@@ -3,15 +3,18 @@
GBLA Version
GBLS VString
GBLS Date
GBLA OSVersionID ;for OS_Byte 129
[ STB
Version SETA 452
VString SETS "4.52"
Date SETS "07 Nov 1996" ; version for STB/NC OS
Version SETA 452
VString SETS "4.52"
Date SETS "07 Nov 1996" ; version for STB/NC OS
OSVersionID SETA &A6
|
Version SETA 372
VString SETS "3.72"
Date SETS "21 May 1997" ; version for RISC OS on desktop computers
Version SETA 380
VString SETS "3.80"
Date SETS "05 Sep 1997" ; version for RISC OS on desktop computers
OSVersionID SETA &A8 ; was &A7 for 3.70,3.71
]
END
......@@ -1214,14 +1214,6 @@ PFIQasIRQ_Chain # 4
; !!!! moved as it required more space).
OldIRQ1Vspace # 752
[ med_00001_debug
! 0,"med-00001 queue start, queue size, cda amount at &" :CC: :STR:(OldIRQ1Vspace)
med_00001_debug_start * OldIRQ1Vspace
med_00001_debug_size * OldIRQ1Vspace+4
med_00001_debug_cda * OldIRQ1Vspace+8
]
CallBack_Vector # 4
; interruptible heap manager workspace
......
......@@ -77,10 +77,12 @@ ValidateAMBHandles SETL {FALSE}
; without any intervening FreePool mangling, the page list is reused to save
; work. This is handy especially because the FreePool L2PT area is uncached.
;
; AMB_LimpidFreePool - if {TRUE}, the FreePool is normally assumed to be crystal clear (pages inactive),
; so that cache flushing is not required on mapping out from the FreePool. This
; requires a call to AMBControl from the Wimp to maintain FreePool status, if
; Wimp_ClaimFreeMemory is still supported.
; AMB_LimpidFreePool - if {TRUE}, the cache(s) can be assumed to be clear with respect to the FreePool
; when AMBControl fetches pages from it. This allows AMBControl to avoid any
; cache clean/flush for moving pages out of the FreePool. This assumption is
; valid if either: FreePool pages are uncacheable; or FreePool pages are
; never used in situ; or FreePool pages are flushed after use in situ (eg. by
; Wimp_ClaimFreeMemory).
;
; AMB_ChocTrace - if {TRUE}, keep trace info for some enhanced code calls and data (probably development only)
......@@ -91,7 +93,9 @@ ValidateAMBHandles SETL {FALSE}
AMB_LazyMapIn SETL {TRUE} :LAND: ChocolateAMB
AMB_StickyLastNode SETL {FALSE} :LAND: ChocolateAMB ;NOT implemented yet
AMB_LimpidFreePool SETL {FALSE} :LAND: ChocolateAMB ;NOT implemented yet
AMB_ChocTrace SETL {TRUE} :LAND: ChocolateAMB
AMB_ChocTrace SETL {FALSE} :LAND: ChocolateAMB ;development only
AMB_LimpidFreePool SETL {TRUE} :LAND: ChocolateAMB ;allowed because FreePool is currently marked uncacheable
;current implementation assumes uncacheability as criterion
END
......@@ -65,7 +65,7 @@ AMBmaxwork * :INDEX:@ ;size of main workspace (assumed to be mu
;
;definition of bits in AMBFlags
;
AMBFlag_LazyMapIn_disable * &80000000 ;bit 32 permanent disable (eg. not running on StrongARM)
AMBFlag_LazyMapIn_disable * &80000000 ;bit 31 permanent disable (eg. not running on StrongARM)
AMBFlag_LazyMapIn_suspend * &40000000 ;bit 30 suspend (controlled via AMB SWI)
;bits 29..0 reserved (0)
;
......
......@@ -42,37 +42,10 @@ allocate
CMP R4,#0 ;any handles available?
BNE %FT01
[ {TRUE} ; give up
; give up
Pull "R0,R3,R4,LR"
ADR R0,err_nomorehandles
B SLVK_SetV
]
[ {FALSE} ; oh no we don't, we're not a module now
;try to extend handles array
MOV R2,R0
MOV R0,#ModHandReason_ExtendBlock
MOV R3,#(GrowMaxNodes:SHL:2)
SWI XOS_Module
BVS alloc_done
MOV R0,R2
STR R0,AMBNodeHandles ;in case block has moved
LDR R3,AMBNhandles
STR R3,[R0] ;first free handle now
ADD LR,R3,#GrowMaxNodes
STR LR,AMBNhandles
ADD R4,R0,R3,LSL #2
ADD R3,R3,#1
;put new handles on free list
00
STR R3,[R4],#4
ADD R3,R3,#1
CMP R3,LR
BNE %BT00
MOV R3,#0
STR R3,[R4] ;0 = end of list
LDR R4,[R0] ;now we have a useable handle
]
01
;get memory for node - from RMA
......
......@@ -95,8 +95,15 @@ AMBControl_Init
ARM_read_ID R1
AND R1,R1,#&F000
CMP R1,#&A000
[ SALDMIBbroken
;for StrongARM, suspend LazyMapIn, since this can go pop for apps which use offending form of LDMIB
MOVEQ R1,#AMBFlag_LazyMapIn_suspend
MOVNE R1,#AMBFlag_LazyMapIn_disable
STR R1,AMBFlags
|
MOVNE R1,#AMBFlag_LazyMapIn_disable
STRNE R1,AMBFlags
]
]
MOV R0,#AMBControl_ws
STR R12,[R0] ;now initialisation is complete
......
......@@ -42,30 +42,10 @@
;
;exit: addr0 updated to end of range ( = addr1)
;
[ SAcleanflushbroken
MACRO
AMB_ARMAcleanflushrange $addr0,$addr1
01
ARMA_clean_DCentry $addr0
ARMA_flush_DCentry $addr0
ADD $addr0,$addr0,#32
ARMA_clean_DCentry $addr0
ARMA_flush_DCentry $addr0
ADD $addr0,$addr0,#32
ARMA_clean_DCentry $addr0
ARMA_flush_DCentry $addr0
ADD $addr0,$addr0,#32
ARMA_clean_DCentry $addr0
ARMA_flush_DCentry $addr0
ADD $addr0,$addr0,#32
CMP $addr0,$addr1
BLO %BT01
MEND
|
MACRO
AMB_ARMAcleanflushrange $addr0,$addr1
01
ARMA_cleanflush_DCentry $addr0 ;when are Digital going to restore this?
ARMA_cleanflush_DCentry $addr0
ADD $addr0,$addr0,#32
ARMA_cleanflush_DCentry $addr0
ADD $addr0,$addr0,#32
......@@ -76,7 +56,6 @@
CMP $addr0,$addr1
BLO %BT01
MEND
]
[ AMB_LazyMapIn
......@@ -165,71 +144,6 @@ AMB_LazyFixUp ROUT
] ;AMB_LazyMapIn
[ {FALSE} ;debug :LAND: debugAMB
; ----------------------------------------------------------------------------------
;
;AMB_ConsistencyCheck
;
; entry: r0 = arbitrary tag (identifies caller in trace)
;
AMB_ConsistencyCheck ROUT
Push "r0-r12,lr"
MOV r12,#AMBControl_ws
LDR r12,[r12]
CMP r12,#0
BEQ %FT90
LDR r1,AMBMappedInNpages
LDR r2,AMBMappedInNode
CMP r2,#0
MOVEQ r3,#0
LDRNE r3,[r2,#AMBNode_Npages]
MOV r4,#0
MOV r5,#0
Push "r3"
ADD r3,r3,#1
ADR r6,AMBMappedInRegister
LDR r7,[r6],#4
MOV r8,#1
10
SUBS r3,r3,#1
BEQ %FT20
TST r7,r8
ADDNE r4,r4,#1
MOVS r8,r8,LSL #1
LDREQ r7,[r6],#4
MOVEQ r8,#1
B %BT10
20
LDR r3,[sp]
ADD r3,r3,#1
MOV r6,#L2PT
ADD r6,r6,#ApplicationStart:SHR:(Log2PageSize-2)
30
SUBS r3,r3,#1
BEQ %FT40
LDR r7,[r6],#4
CMP r7,#0
ADDNE r5,r5,#1
B %BT30
40
Pull "r3"
CMP r1,r4
CMPEQ r1,r5
BEQ %FT90
CMP r2,#0
MOVEQ r4,#-1
MOVEQ r5,#-1
Debug AMB,"AMB_ConsistencyCheck **OOPS**, tag = ",r0
Debug AMB," MappedInNode, Npages = ",r2,r3
Debug AMB," MappedInNpages value,found in bitmap,found in L2PT = r1,r4,r5
90
Pull "r0-r12,pc"
] ;debug :LAND: debugAMB
; ----------------------------------------------------------------------------------
;
......@@ -505,8 +419,13 @@ AMB_SetMemMapEntries ROUT
LDR r2,[r10] ;page number of 1st page
MOV r7,#0
LDR r7,[r7,#CamEntriesPointer] ;r7 -> CAM
ADD r1,r7,r2,LSL #3
ADD r1,r7,r2,LSL #3 ;r1 -> CAM entry for 1st page
[ AMB_LimpidFreePool
LDR r4,[r1] ;fetch old logical addr. of 1st page from CAM
LDR r3,[r1,#4] ;fetch old PPL of 1st page from CAM
|
LDR r4,[r1] ;fetch old logical addr. of 1st page from CAM
]
CMP r5,#-1
BEQ AMB_smme_mapout
......@@ -516,9 +435,24 @@ AMB_SetMemMapEntries ROUT
BEQ AMB_smme_mapin
;map from somewhere to somewhere (should be App Space <-> Free Pool)
;could be an optimise here if source is FreePool and we know that FreePool
;has not been used - ie. no need to clean/flush cache(s) - not done yet (requires
;sorting of Wimp_ClaimFreeMemory)
;
[ AMB_LimpidFreePool
;can avoid cache clean/flush for moving pages out from FreePool, since FreePool pages are uncacheable
;
TST r3, #&20 ;test NotCacheable bit of PPL of 1st page
BEQ AMB_smme_mapnotlimpid ;if clear, must do full map somewhere with cache clean/flush
;
;this should be map FreePool -> App Space then
;
MOV r3,r5
BL AMB_movepagesout_L2PT
BL AMB_movepagesin_L2PT
BL AMB_movepagesin_CAM
ARM_flush_TLB r0 ;no cache clean/flush, just TLB flush
Pull "r0-r4,r7-r11, pc"
AMB_smme_mapnotlimpid
]
;
[ ARM810support
BL AMB_cachecleanflush_ifARM810
]
......@@ -533,20 +467,12 @@ AMB_smme_mapin
MOV r3,r5
BL AMB_movepagesin_L2PT
BL AMB_movepagesin_CAM
;
;don't need to flush cache at end of mapin (already coherent, since
;nothing mapped in before), but do need to flush TLBs (eg. TLBs will cache
;access denial for app space after mapout)
[ ARM810support
;there is a general macro, should have used this before anyway
;
ARM_flush_TLB r0
|
ARM_read_ID r0
AND r0,r0,#&F000
CMP r0,#&A000
ARM67_flush_TLB NE
ARMA_flush_TLBs EQ
]
Pull "r0-r4,r7-r11, pc"
;all pages destined for same new logical page 'nowhere'
......@@ -672,12 +598,6 @@ AMB_ccf_StrongARM_flushrange
;
AMB_SetMemMapEntries_SparseMapOut ROUT
[ {FALSE} ;debug :LAND: debugAMB
Push "r0,lr"
MOV r0,#1
BL AMB_ConsistencyCheck
Pull "r0,lr"
]
CMP r3,#0
MOVEQ pc,lr
Push "r0-r11,lr"
......
......@@ -50,11 +50,6 @@ AMBsrv_memorymoved ROUT
STRNE R6,[R4,#AMBNode_Npages] ;update Npages
[ AMB_LazyMapIn
Pull "R3-R6,R12,PC",EQ,^ ;done if Npages same
[ {FALSE} ;debug
LDR r5,[r4,#AMBNode_handle]
Debug AMB,"AMBsrv MappedInNode handle",R5
Debug AMB,"AMBsrv Npages old new",R3,R6
]
BLT %FT22 ;shrink
|
Pull "R3-R6,R12,PC",LE,^ ;done if Npages same, or shrink
......@@ -114,12 +109,6 @@ AMBsrv_memorymoved ROUT
LDR R4,[R6],#4
B %BT10
20
[ {FALSE} ; debug :LAND: debugAMB
Push "r0,lr"
MOV r0,#2
BL AMB_ConsistencyCheck
Pull "r0,lr"
]
21
Pull "R3-R6,R12,PC",,^
......@@ -167,12 +156,6 @@ AMBsrv_memorymoved ROUT
LDR R4,[R6],#4
B %BT30
40
[ {FALSE} ;debug :LAND: debugAMB
Push "r0,lr"
MOV r0,#3
BL AMB_ConsistencyCheck
Pull "r0,lr"
]
41
] ;AMB_LazyMapIn
......
This diff is collapsed.
......@@ -192,11 +192,7 @@ sv7 = "Sys$$DateFormat", 0, VarType_String
ALIGN
& sv8-.-4
[ {TRUE}
= "%24:%mi:%se %dy-%m3-%ce%yr", 10
|
= "%w3,%dy %m3 %ce%yr.%24:%mi:%se", 10
]
sv8 = 0
......@@ -282,11 +278,7 @@ SetRC Push "lr"
BICLSS PC, lr, #V_bit
ADRGT R0, ErrorBlock_RCExc
ADRLT R0, ErrorBlock_RCNegative
[ International
BL TranslateError
|
SETV
]
Pull "PC"
MakeErrorBlock RCExc
MakeErrorBlock RCNegative
......@@ -652,7 +644,6 @@ GSREAD_XPandGotQuote
CMP R1, #"""" ; "" in string?
BEQ GSREAD_ReturnWithChar ; yup
[ Fix16
; TMD 25-Sep-89: Fix termination here
......@@ -661,12 +652,6 @@ GSREAD_XPandGotQuote
LDREQB R1, [R0], #1
BEQ %BT10
SUB R0, R0, #1
|
10 LDRB R1, [R0], #1
CMP R1, #" "
BEQ %BT10
]
ORR lr, lr, #C_bit ; got terminator (second ")
ExitSWIHandler ; and out
......@@ -721,11 +706,9 @@ ZeroLengthVar
GSREAD_BadStringError
ADR R0, BadStrErr
[ International
Push "lr"
BL TranslateError
Pull "lr"
]
ORR lr, lr, #V_bit :OR: C_bit
ExitSWIHandler
......@@ -908,9 +891,7 @@ ReadVarVal_BufWillOFlow
; Have determined that the buffer will overflow, so generate an error
; and shorten down to the buffer's size
ADR r0, BufferOFloError
[ International
BL TranslateError
]
STR r0, [stack, #Proc_LocalStack + 0*4]
LDR lr, [stack, #Proc_LocalStack + 2*4]
ORR lr, lr, #V_bit ; set for return
......@@ -966,9 +947,7 @@ ReadVarVal_ExpandedWanted
BCC ReadVarVal_OKExit
ADR R0, BufferOFloError
[ International
BL TranslateError
]
B ReadVarVal_SetVExit
......@@ -993,13 +972,9 @@ ReadVarVal_TestVExit
B SLVK_TestV
RVVNotFound
[ International
MOV r4, r0
ADR r0, RVVNFError
BL TranslateError_UseR4
|
ADR R0, RVVNFError
]
MOV r2, #0 ; indicate not found.
ReadVarVal_SetVExit
......@@ -1066,11 +1041,9 @@ CvtToDecimal ROUT
B %BT05
10
ADR R0, BufferOFloError
[ International
Push "lr"
BL TranslateError
Pull "lr"
]
Pull "R3" ; discard R0 in
Pull "R3-R5"
B SLVK_SetV
......@@ -1939,11 +1912,9 @@ SetVarValueTestExit
Pull "R1, R2, R4, lr"
TST lr, #V_bit
ADRNE R0, ErrorBlock_VarTooLong
[ International
Push "lr",NE
BLNE TranslateError
Pull "lr",NE
]
ExitSWIHandler
MakeErrorBlock VarTooLong
......
......@@ -119,9 +119,7 @@ IF_Code ROUT
NoTHEN ROUT
ADR R0, %FT01
[ International
BL TranslateError
]
IfError
Pull "R2, lr"
ORRS PC, lr, #V_bit
......@@ -136,9 +134,7 @@ WantInteger ROUT
Pull "R2, lr", EQ ; integer returned, so leave expranal error there
ORREQS PC, lr, #V_bit
ADR R0, %FT01
[ International
BL TranslateError
]
B IfError
01
& ErrorNumber_Syntax
......@@ -226,9 +222,7 @@ $label ePull $reglist, $writeback, $cc
ExprBuffOFlo ROUT
ADRL R0, ErrorBlock_BuffOverflow
[ International
BL TranslateError
]
STR R0, [stack]
Pull "R0-R4, lr"
B SLVK_SetV
......@@ -266,14 +260,9 @@ ReadExpression ROUT
CMP R2, #op_Ket
BNE %FT02
LDRB R3, exprBracDif
[ {TRUE} ; TMD 11-Sep-89 - save an instruction
SUBS R3, R3, #1
BCC BadBraErr
|
CMP R3, #0
BEQ BadBraErr
SUB R3, R3, #1
]
STRB R3, exprBracDif
03
......@@ -1002,9 +991,7 @@ operator_table
ExprErrCommon
BumNumber
LDR R13, ExprSVCstack
[ International
BL TranslateError
]
BumNumber2
STR R0, [stack]
Pull "R0-R4, lr"
......@@ -1199,10 +1186,8 @@ AlternateLoud
Config_Special MouseType
]
Config_Field Print, 5, 2, PSITCMOS
[ :LNOT: DriversInKernel
Config_Size PrinterBufferSize, 0, 7, PrinterBufferCMOS
PrinterBufferFrig
]
AlternateQuiet
Config_NoParm Quiet, 1, 0, DBTBCMOS, 0
Config_Size RamFsSize, 0, 6, RAMDiscCMOS
......@@ -1424,9 +1409,7 @@ ConfigGenErr
CMP r0, #1
ADRLO r0, BadConOptError
ADREQ r0, BadConParmError
[ International
BL TranslateError
]
ExitConfig
Pull "lr"
ORRS pc, lr, #V_bit
......@@ -1511,12 +1494,10 @@ ReadSizeParm ROUT
CMPNE r1, #"K"
Pull "r1, r8", NE
BNE BadConParm
[ :LNOT: DriversInKernel
ADRL r14, PrinterBufferFrig-4
TEQ r8, r14 ; if printer buffer size
TEQEQ r2, #1 ; and 1K
MOVEQ r2, #0 ; then use zero (default)
]
ADRL r14, FontSizeFrig-4 ; point at info word for fontsize
TEQ r8, r14 ; if fontsize
MOVEQ r8, #4*1024 ; then use 4K (lucky it's a pagesize!)
......@@ -1581,9 +1562,7 @@ statoptservice
CMP r1, #0
Pull "pc", EQ
ADR r0, %FT03
[ International
BL TranslateError
]
Pull "lr"
ORRS pc, lr, #V_bit
03
......@@ -1602,26 +1581,16 @@ ListAll ROUT
SWI XOS_Byte ; Won't fail
Push "r1"
[ International
SWI XOS_WriteI+14
BL WriteS_Translated
= "Config:Configuration",0
ALIGN
SWIVC XOS_WriteI+" "
|
SWI XOS_WriteS
= 14, "Configuration ", 0 ; paged mode on.
ALIGN
]
Pull "r1, pc", VS ; Wrch can fail
CMP r3, #0
ADREQ r0, %FT06
ADRNE r0, %FT08
[ International
BL Write0_Translated
|
SWI XOS_Write0
]
SWIVC XOS_NewLine
SWIVC XOS_NewLine
Pull "r1, pc", VS
......@@ -1665,17 +1634,10 @@ listalltryfind
ADRL r0, dotstring
B listalltryfind
[ International
06
= "Options:options:",0
08
= "Status:status:",0
|
06
= "options:",0
08
= "status:",0
]
ALIGN
listallservice
......@@ -1686,7 +1648,6 @@ listallservice
MOV r0, #0 ; indicate list wanted
BL Issue_Service
CMP r3, #0
[ International
BEQ %FT20
BL GSWriteS_Translated
= "STail:|J|MUse *Configure to set the options.|J|M",0
......@@ -1702,30 +1663,12 @@ listallservice
= "Use *Status to display the current settings.|J|M",0
ALIGN
30
|
ADRNE r0, statuslastline
ADREQ r0, configlastline
SWI XOS_Write0
]
Pull "r1"
Pull "pc", VS ; return error if set
TST r1, #5
SWIEQ XOS_WriteI+15 ; paged mode off
Pull "pc"
[ :LNOT: International
statuslastline
= 10,13, "Use *Configure to set the options.", 10,13,0
configlastline
= 10,13, "Where:", 10,13