Commit fb4d7cd3 authored by Mike Stephens's avatar Mike Stephens
Browse files

added support for Sparse dynamic areas fixed performance disaster caused by...

added support for Sparse dynamic areas fixed performance disaster caused by naff API for Shrinkable areas implemented clamps for dynamic areas max size configured kernel to not own or create RAMFS area (needs new RAMFS)

AMBControl now uses system heap for space, not RMA
AMBControl enables Lazy task swapping if running on rev T or better SA
kernel now assumes there could be code above 64M
SWIS for limited 32 bit user code support implemented
Long command lines implemented (1k instead of 256)
Fast service call distribution implemented (uses Ursula module format)
*fx,*key etc now allow missing space before first parameter
*configure is reinstated (bug fix)
parent 5804de48
......@@ -13,7 +13,7 @@ OSVersionID SETA &A6
|
Version SETA 380
VString SETS "3.80"
Date SETS "04 Dec 1997" ; version for RISC OS on desktop computers
Date SETS "24 Mar 1998" ; version for RISC OS on desktop computers
OSVersionID SETA &A8 ; was &A7 for 3.70,3.71
]
......
......@@ -215,16 +215,18 @@ OldOpt SETA {OPT}
^ 0
DANode_Link # 4 ; points to next node
DANode_Number # 4 ; number of this area
DANode_Base # 4 ; base address of area (points in middle of doubly-mapped areas)
DANode_Flags # 4 ; various flags
DANode_Size # 4 ; current size of area
DANode_MaxSize # 4 ; maximum size of area
DANode_Workspace # 4 ; workspace pointer when calling handlers
DANode_Handler # 4 ; pointer to handler routine for area
DANode_Title # 4 ; pointer to area title (variable length)
DANode_NodeSize # 0
DANode_Link # 4 ; points to next node
DANode_Number # 4 ; number of this area
DANode_Base # 4 ; base address of area (points in middle of doubly-mapped areas)
DANode_Flags # 4 ; various flags
DANode_Size # 4 ; current size of area (not counting holes, if Sparse area)
DANode_MaxSize # 4 ; maximum size of area
DANode_Workspace # 4 ; workspace pointer when calling handlers
DANode_Handler # 4 ; pointer to handler routine for area
DANode_Title # 4 ; pointer to area title
DANode_SubLink # 4 ; next node in any disjoint sublist (currently used for Shrinkables only)
DANode_SparseHWM # 4 ; high water mark, if Sparse area (highest base+size claimed for area)
DANode_NodeSize # 0
AplWorkMaxSize * &01C00000 ; 28M
......@@ -254,6 +256,11 @@ FreePoolAddress * &08800000 ; Changed for Ursula, was &06000000
; PhysRam * &05000000 Redundant (commented out for Ursula)
;Ursula
;following dynamic area only used if LongCommandLines is {TRUE}
KbuffsBaseAddress * &2078000 ;just above reserved area for fake 480k screen
KbuffsMaxSize * &0088000 ;544k (takes us up to start of RMA)
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; system variables
......@@ -1005,10 +1012,17 @@ CommonSilentError_ws # 4 ;workspace for common error handling, witho
]
Oscli_CmdHashSum # 4 ;for hashed command lookup
! 0, "Oscli_CmdHashSum at ":CC::STR:(Oscli_CmdHashSum)
Oscli_CmdHashLists # 4 ;anchor for hashed command lists structure
! 0, "Oscli_CmdHashSum at ":CC::STR:(Oscli_CmdHashSum)
! 0, "Oscli_CmdHashLists at ":CC::STR:(Oscli_CmdHashLists)
Serv_SysChains # 4 ;anchor for block handling 'system' service numbers, in range 1 to 255
Serv_UsrChains # 4 ;anchor for block handling 'user' service numbers, > 255
Serv_AwkwardChain # 4 ;anchor for chain handling non-compliant modules (no service table)
! 0, "Serv_SysChains at ":CC::STR:(Serv_SysChains)
! 0, "Serv_UsrChains at ":CC::STR:(Serv_UsrChains)
! 0, "Serv_AwkwardChain at ":CC::STR:(Serv_AwkwardChain)
[ mjsServiceTrace
mjsServiceTrace_ws # 4
! 0, ""
......@@ -1154,6 +1168,7 @@ ROMModuleChain # 4 ; pointer to head of ROM module chain
KeyWorkSpaceSize * &200
KeyWorkSpace # KeyWorkSpaceSize
! 0, "&&&KeyWorkSpace at ":CC::STR:(KeyWorkSpace)
; The following were reordered on 26-Jul-91. Old ordering was:
; GeneralMOSBuffer
......@@ -1211,7 +1226,12 @@ ExceptionDump # 4
; *If expression to be evaluated to control the *If
; Command line to be submited on the expression
; evaluating to non-zero (the THEN clause).
GeneralMOSBuffer # 256+4
[ LongCommandLines
OldGeneralMOSBuffer # 256+4 ;spare
|
GeneralMOSBuffer # 256+4
! 0, "&&&GeneralMOSBuffer at ":CC::STR:(GeneralMOSBuffer)
]
[ AssemblingArthur
! 0,"16 ":CC::STR:@
......@@ -1265,7 +1285,12 @@ MonitorLeadType # 1 ; some function of the monitor lead inputs, as y
AlignSpace
[ LongCommandLines
OldEnvString # 256 ;spare
|
EnvString # 256
! 0, "&&&EnvString at ":CC::STR:(EnvString)
]
DUMPER # 16 * 4
......@@ -1287,6 +1312,9 @@ ModuleSWI_HashTab # 4*ModuleSHT_Entries
;
SysVars_StickyPointers # (10+1)*4 ;used if ChocolateSysVars is TRUE (1 dummy pointer for 0 size)
! 0, "SysVars_StickyPtrs at ":CC::STR:(SysVars_StickyPointers)
;
Abort32_dumparea # 6*4 ;info for OS_ReadSysInfo 7 - 32-bit PSR, fault address, 32-bit PC (room for two copies)
! 0, "Abort32_dumparea at ":CC::STR:(Abort32_dumparea)
;
[ mjsSysHeapNodesTrace
mjsSHNodesTrace_ws # 0
......@@ -1306,9 +1334,9 @@ mjsSHNT_vfh_total # 4 ;total SysVar FreeVNode calls that dropped a node to t
! 0, "**WARNING** compiling in code to trace some SysHeap node statistics (mjsSysHeapNodesTrace TRUE)"
! 0, ""
! 0, "mjsSHNodesTrace_ws at ":CC::STR:(mjsSHNodesTrace_ws)
ModuleSHT_Padding1 # 752-12-4*ModuleSHT_Entries-11*4-12*4 ;spare
ModuleSHT_Padding1 # 752-12-4*ModuleSHT_Entries-11*4-6*4-12*4 ;spare
|
ModuleSHT_Padding1 # 752-12-4*ModuleSHT_Entries-11*4 ;spare
ModuleSHT_Padding1 # 752-12-4*ModuleSHT_Entries-11*4-6*4 ;spare
]
;
ASSERT @ = &C34 + 752
......@@ -1448,26 +1476,43 @@ MacExEndPtrs # 44
; are called while the buffer is held. Also used for module prefixes:
; Module called twice in this case.
AliasExpansionBuffer # 100
[ LongCommandLines
OldAliasExpansionBuffer # 100 ;spare, mjs: shouldn't this have been &100 ??!??
|
AliasExpansionBuffer # 100 ;mjs: shouldn't this be &100 ??!??
! 0, "&&&AliasExpansionBuffer at ":CC::STR:(AliasExpansionBuffer)
; *list/*type need an argument expansion buffer: ReadArgs called with it.
ArgumentBuffer * AliasExpansionBuffer
]
ArgumentBuffer * AliasExpansionBuffer
; EvaluateExpression space. Calls ReadUnsigned, BinaryToDecimal and ReadVarVal.
ExprWSpace * @
! 0, "&&&ExprWSpace at ":CC::STR:(ExprWSpace)
^ 0, R12
[ LongCommandLines
;ExprBuff moved to Kernel buffers area
|
ExprBuff # &100
]
exprBracDif # 2 ; keep exprSTRACC aligned
tos_op # 2 ; 1 byte for use as STRACC-1
ExprSVCstack # 4
exprSTRACC * @ - ExprBuff + ExprWSpace
[ LongCommandLines
;exprSTRACC moved to Kernel buffers area
ExprStackLimit * @ - exprBracDif + ExprWSpace + &100 ;keep 256 buffer zone for stack overflow
ExprStackStart * ScratchSpace + ScratchSpaceSize
|
exprSTRACC * @ - ExprBuff + ExprWSpace
ExprStackLimit * exprSTRACC + &100
ExprStackStart * ScratchSpace + ScratchSpaceSize
]
! 0, "&&&ExprStackLimit at ":CC::STR:(ExprStackLimit)
! 0, "&&&ExprStackStart at ":CC::STR:(ExprStackStart)
; Tutu needs some for argument substitution + expansion for run/load types
; Only OS call during xform is XOS_SubstituteArgs and XOS_Heap(Claim,SysHeap)
......@@ -1547,6 +1592,7 @@ Sound3BuffSize * 4
SpeechBuffSize * 4
MouseBuffSize * &40
KeyBuff |#| KeyBuffSize
! 0, "&&&KeyBuff at ":CC::STR:(KeyBuff)
RS423InBuff |#| RS423InBuffSize
RS423OutBuff |#| RS423OutBuffSize
PrintBuff |#| PrintBuffSize
......@@ -1559,11 +1605,16 @@ MouseBuff |#| MouseBuffSize
; Oscli buffering
[ LongCommandLines
OldOscliBuffs |#| (16+1)*&100 ;spare
|
OscliBuffSize * &100
OscliNoBuffs * 16
OscliCircBuffLimit |#| 0
OscliCircBuffStart |#| OscliBuffSize * OscliNoBuffs
RedirectBuff |#| OscliBuffSize
! 0, "&&&OscliCircBuffStart at ":CC::STR:(OscliCircBuffStart)
]
; Default IRQ despatch moved here as a result of IOMD having an extra
; 6 interrupts for I/O and sound DMA (this is really IOMD specific, not
......@@ -1593,17 +1644,65 @@ IRQSTK # 0 ; Overflow will give abort
; High system workspace
; *****************************************************************************
;;;mjs change for Ursula:
;;;SVCSTK and SysHeapStart are no longer exported, there is a run-time mechanism to get
;;;these values, via OS_ReadSysInfo 6, these values themselves have changed for Ursula
^ SysHeapChunkAddress
# SVCStackSize ; svcstk size. Overflow will give abort
Export_SVCSTK # 0
ASSERT Export_SVCSTK = SVCSTK
ASSERT ?Export_SVCSTK = ?SVCSTK
Export_SysHeapStart # 0
ASSERT Export_SysHeapStart = SysHeapStart
ASSERT ?Export_SysHeapStart = ?SysHeapStart
^ SysHeapChunkAddress
# SVCStackSize
SVCSTK # 0
SysHeapStart # 0
! 0, "SVCSTK at ":CC::STR:(SVCSTK)
! 0, "SysHeapStart at ":CC::STR:(SysHeapStart)
; *****************************************************************************
[ LongCommandLines
ASSERT LongCLISize >= 256+4 ;minimum size of GeneralMOSBuffer
;Kernel buffers area
^ KbuffsBaseAddress
GeneralMOSBuffer # LongCLISize
EnvString # LongCLISize
AliasExpansionBuffer # LongCLISize
ArgumentBuffer * AliasExpansionBuffer
ExprBuff # LongCLISize
exprSTRACC # LongCLISize
OscliBuffSize * LongCLISize
OscliNoBuffs * 16
RedirectBuff # OscliBuffSize
OscliCircBuffStart # OscliBuffSize * OscliNoBuffs
OscliCircBuffLimit # 0
KbuffsEnd # 0
KbuffsSize * KbuffsEnd - KbuffsBaseAddress ;size of Kernel buffers area
ASSERT KbuffsSize <= KbuffsMaxSize
! 0, "Kbuffs at ":CC::STR:(KbuffsBaseAddress)
! 0, "Kbuffs Size is ":CC::STR:(KbuffsSize)
! 0, "&&&GeneralMOSBuffer at ":CC::STR:(GeneralMOSBuffer)
! 0, "&&&EnvString at ":CC::STR:(EnvString)
! 0, "&&&AliasExpansionBuffer at ":CC::STR:(AliasExpansionBuffer)
! 0, "&&&ArgumentBuffer at ":CC::STR:(ArgumentBuffer)
! 0, "&&&ExprBuff at ":CC::STR:(ExprBuff)
! 0, "&&&exprSTRACC at ":CC::STR:(exprSTRACC)
! 0, "&&&RedirectBuff at ":CC::STR:(RedirectBuff)
! 0, "&&&OscliCircBuffStart at ":CC::STR:(OscliCircBuffStart)
] ;LongCommandLines
OPT OldOpt
END
......@@ -78,9 +78,11 @@ VduDriverWorkSpace # &3000
^ &00004000
ScratchSpace # &4000
;;;mjs change for Ursula:
;;;SVCSTK and SysHeapStart are no longer exported, there is a run-time mechanism to get
;;;these values, via OS_ReadSysInfo 6, the values themselves have changed for Ursula
^ &01C08000 ; changed for Ursula, was &01C02000
SVCSTK # 0
^ &01C08000 ; changed for Ursula, was &01C02000
SysHeapStart # 0
^ &01F033FC
SvcTable # &400
......
......@@ -14,59 +14,47 @@
;
; > s.Memory
; lifted from Wimp source (v3.67)
; Small veneer between AMBControl's memory block requirements and OS_Heap,
; using system heap. This is changed since Ursula - used to call OS_Module
; and claim blocks from RMA, which is an anachronism since code is in
; the kernel.
; this OS_Module equivalent looks at ptr-4 which the Heap Manager uses
; to store the real size of the block. In this way the memory use is
; more efficient (especially when extending a block) and RMA should
; fragment less often.
XROS_Module ENTRY
TEQ R0,#6
TEQNE R0,#7
TEQNE R0,#13
SWINE XOS_Module
EXIT NE
TEQ R0,#6
BEQ ros_claim
TEQ R0,#7
BEQ ros_free
; extend
Push "R3-R5"
LDR R4,[R2,#-8]
LDR R5,[R2,#-4]!
ADD R5,R5,R3 ; R5 is proposed new size
SUB R4,R4,#4
CMP R4,R5
CMPGE R3,#0
BLT %FT02
STR R5,[R2],#4 ; enough space so just store
Pull "R3-R5"
; can never error
EXITS
02
SUB R3,R5,R4
SWI XOS_Module
STRVC R5,[R2],#4
Pull "R3-R5"
EXITS VC
EXIT
; quantise sizes to reduce heap stress
;
AMBblockQ * 64
ros_free
SUB R2,R2,#4
SWI XOS_Module
EXITS VC
EXIT
;in: r3=size
;out: r2 -> block, r0 corrupted
;
AMB_BlockClaim ROUT
Push "r1,r3,lr"
ADD r3,r3,#AMBblockQ - 1
BIC r3,r3,#AMBblockQ - 1
BL ClaimSysHeapNode
Pull "r1,r3,pc"
;in: r2 -> block
;out: r0 corrupted
;
AMB_BlockFree ROUT
Push "r1,lr"
BL FreeSysHeapNode
Pull "r1,pc"
ros_claim
ADD R3,R3,#4
SWI XOS_Module
STRVC R3,[R2],#4 ; so modptr-4 = amount asked for + 4
SUB R3,R3,#4 ; needs to be preserved
EXITS VC
EXIT
;in: r2 -> block, r3 = new size
;out: r2 -> new block, r0 corrupted
;
AMB_BlockResize ROUT
Push "r1,r3,lr"
ADD r3,r3,#AMBblockQ - 1
BIC r3,r3,#AMBblockQ - 1
LDR r1,[r2,#-4] ;pick up OS_Heap's size word (naughty!)
SUB r1,r1,#8 ;heap size will be 8 more than quantised size
SUBS r3,r3,r1 ;required size change
MOVNE r0, #HeapReason_ExtendBlock
BLNE DoSysHeapOpWithExtension
Pull "r1,r3,pc"
END
......@@ -51,8 +51,7 @@ allocate
;get memory for node - from RMA
MOV R3,#(AMBNode_pages - AMBNode_id) ;size excluding page list
ADD R3,R3,R1,LSL #2 ;plus one word per page
MOV R0,#ModHandReason_Claim
BL XROS_Module
BL AMB_BlockClaim
BVS alloc_done
;remember handle in node
......@@ -113,8 +112,7 @@ alloc_done
;free page table space and return 0 handle
alloc_zeropages
MOV R0,#ModHandReason_Free
BL XROS_Module
BL AMB_BlockFree
MOV R1,#0
MOV R2,#0
B alloc_done
......
......@@ -78,8 +78,7 @@ deallocate
STREQ R0,AMBMappedInNode
;free node (at R2)
MOV R0,#ModHandReason_Free
BL XROS_Module
BL AMB_BlockFree
dealloc_done
STRVS R0,[SP]
......
......@@ -104,13 +104,12 @@ gs_done
grwshr_node
Push "R0,R3,R4,LR"
CMP R1,#0
BEQ grwshrn_free ;shrunk to nothing
SUB R4,R1,R5
MOV R3,R4,ASL #2
MOV R4,R2 ;so we can check for moved block
MOV R0,#ModHandReason_ExtendBlock
BL XROS_Module
MOVVS R2,R4 ;in case block ptr not preserved on error
BEQ grwshrn_free ;shrunk to nothing
MOV R3,#(AMBNode_pages - AMBNode_id) ;new size excluding page list
ADD R3,R3,R1,LSL #2 ;new size
MOV R4,R2 ;so we can check for moved block
BL AMB_BlockResize
MOVVS R2,R4 ;in case block ptr not preserved on error
BVS grwshrn_done
;fix-up links if block has moved
CMP R4,R2
......@@ -154,8 +153,7 @@ grwshrn_free
MOVEQ R0,#0
STREQ R0,AMBMappedInNode
MOV R0,#ModHandReason_Free
BL XROS_Module
BL AMB_BlockFree
MOVVC R2,#0
B grwshrn_done
......
......@@ -93,16 +93,19 @@ AMBControl_Init
;only allowed for StrongARM (abort fix up = nightmare for ARM 6,7, who cares about ARM8)
;
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
|
AND R0,R1,#&F000
CMP R0,#&A000
MOVNE R1,#AMBFlag_LazyMapIn_disable
STRNE R1,AMBFlags
[ SALDMIBbroken
;for StrongARM of old enough revision, suspend LazyMapIn, since this can go pop
;for apps which use offending form of LDMIB
BNE %FT05
AND R0,R1,#&F
CMP R0,#SALDMIBfixedrev
MOVLO R1,#AMBFlag_LazyMapIn_suspend
STRLO R1,AMBFlags
05
]
]
MOV R0,#AMBControl_ws
......
......@@ -31,9 +31,9 @@ DebugAborts SETL {FALSE}
; Workspace needed for ARM600 work is as follows:
;
; * Level 2 page tables for a logical area starting at zero. This consists of:
; a) a fixed size bit covering 0 to 96M
; b) a variable size bit covering the free pool - 96M to 96M + (memsize rounded up to 4M)
; - Note that the 96M value is sufficient to cover all the fixed size areas (including screen).
; a) a fixed size bit covering 0 to 136M
; b) a variable size bit covering the free pool - 136M to 136M + (memsize rounded up to 4M)
; - Note that the 136M value is sufficient to cover all the fixed size areas (including screen).
; - Free pool must always start at the end of the fixed areas.
; - Level 2 for areas outside this region are allocated dynamically afterwards (eg. to support
; dynamic areas).
......@@ -130,11 +130,11 @@ ARMA_Cleaners_address * 31*1024*1024 + 64*1024
; - this area is used if necessary, on VSync's, to keep cached screen up to date
ARMA_ScreenCleaners_address * 31*1024*1024 + 96*1024
arm600stuff_before_align
ALIGN 4096 ;align to page boundary to allow for easy ROMpatch
;;;arm600stuff_before_align
;;; ALIGN 4096 ;align to page boundary to allow for easy ROMpatch
arm600stuff_startofstuff
! 0, "-- start of (4k aligned) ARM600+ stuff at ":CC::STR:(arm600stuff_startofstuff)
;;;arm600stuff_startofstuff
;;; ! 0, "-- start of (4k aligned) ARM600+ stuff at ":CC::STR:(arm600stuff_startofstuff)
;note that we use the R bit if supported (not 610), so that we can write protect ROM space
;fully (user and supervisor)
......@@ -377,7 +377,8 @@ UsePPLCBBits SETL {TRUE}
;if we can assume no code above 64Mb (ie. 26bit code space), big optimise for StrongARM
GBLL AssumeNoCodeAbove64Mb
AssumeNoCodeAbove64Mb SETL {TRUE}
AssumeNoCodeAbove64Mb SETL {FALSE} ;cannot set this TRUE for Ursula (32-bit code
;allowed in dynamic areas)
;if we just use sledgehammer approach anyway
GBLL AlwaysSledgehammer
......@@ -2553,6 +2554,11 @@ PAbPreVeneer ROUT
; for the time being just merge lr and psr
mrs AL, r1, SPSR_all ; r1 = saved PSR
LDR r2, =Abort32_dumparea
STMIA r2, {r1,lr_abort} ;dump 32-bit PSR, fault address (PC)
STR lr_abort,[r2,#2*4] ;dump 32-bit PC
AND r2, r1, #&F0000003 ; get saved NZCV and 26 bit modes
ORR lr_abort, lr_abort, r2
AND r2, r1, #I32_bit + F32_bit ; extract I and F from new place
......@@ -2621,6 +2627,10 @@ DABP_notchocolate
mrs AL, r1, CPSR_all ; r1 = CPSR
ADD r2, r13_abort, #8*4 ; r2 -> saved register bank for r8 onwards
LDR r4, =Abort32_dumparea+3*4 ;use temp area (avoid overwriting main area for expected aborts)
ARM_read_FAR r3
STMIA r4, {r0,r3,lr_abort} ; dump 32-bit PSR, fault address, 32-bit PC
MOV r4, lr_abort ; move address of aborting instruction into an unbanked register
BIC r1, r1, #&1F ; knock out current mode bits
ANDS r3, r0, #&1F ; extract old mode bits (and test for USR26_mode (=0))
......@@ -3015,6 +3025,16 @@ DABP_notchocolate
90
; copy temp area to real area (we believe this is an unexpected data abort now)
LDR r0, =Abort32_dumparea
LDR r1, [r0,#3*4]
STR r1, [r0]
LDR r1, [r0,#4*4]
STR r1, [r0,#4]
LDR r1, [r0,#5*4]
STR r1, [r0,#2*4]
; for the time being just merge lr and psr
LDR r0, [sp, #8*4] ; r0 = original SPSR (can't have been modified)
......@@ -3576,10 +3596,10 @@ mifp_810
]
;
DCB "GROT" ;spare words marker
ALIGN 4096 ;align to page boundary for easy ROMpatch
arm600stuff_endofstuff
! 0,"-- size of ARM600+ stuff (4k aligned) is ":CC::STR:(arm600stuff_endofstuff - arm600stuff_startofstuff)
;;; DCB "GROT" ;spare words marker
;;; ALIGN 4096 ;align to page boundary for easy ROMpatch
;;;arm600stuff_endofstuff
;;; ! 0,"-- size of ARM600+ stuff (4k aligned) is ":CC::STR:(arm600stuff_endofstuff - arm600stuff_startofstuff)
[ DebugAborts
......
......@@ -1179,11 +1179,21 @@ SetVarValue
BNE SetVarVal_AintExpanded
; Process VarType_Expanded
[ LongCommandLines
MOV r0, stack, LSR #20 ; SVC stack base assumed on 1M boundary
SUB r0, sp, r0, LSL #20 ; amount of stack left
CMP r0, #LongCLISize + 2048 ; insist on 2k left after long buffer
MOVHS r2, #LongCLISize ; ok, got a long buffer
MOVLO r2, #256 ; stack full-ish, use a 256 buffer and hope it's big enough
SUB stack, stack, r2
|
SUB stack, stack, #256
MOV r2, #256
]
MOV r0, r1 ; ptr to expression
MOV r1, stack
MOV r2, #256
SWI XOS_EvaluateExpression
BVS SetVarVal_TestVExit
TEQ r1, #0 ; integer?
......@@ -1233,12 +1243,11 @@ SetVarVal_NodeAlreadyExists
CMP r10, #VarType_Number
BHI SetVarVal_AssignToCodeDoIt
; For both string and number give ourselves a stack frame
SUB stack, stack, #256
MOV r2, #256
BLO SetVarVal_AssignStringToCode
SUB stack, stack, #256 ;buffer
MOV r2, #256
; Assign a number to the code variable
LDRB r0, [r1], #1
LDRB lr, [r1], #1
......@@ -1254,6 +1263,18 @@ SetVarVal_NodeAlreadyExists
SetVarVal_AssignStringToCode
[ LongCommandLines
MOV r0, stack, LSR #20 ; SVC stack base assumed on 1M boundary
SUB r0, sp, r0, LSL #20 ; amount of stack left
CMP r0, #LongCLISize + 2048 ; insist on 2k left after long buffer
MOVHS r2, #LongCLISize ; ok, got a long buffer
MOVLO r2, #256 ; stack full-ish, use a 256 buffer and hope it's big enough
SUB stack, stack, r2
|
SUB stack, stack, #256
MOV r2, #256
]
; Expand string to stack frame then do it
MOV r0, r1
MOV r1, stack
......
......@@ -232,8 +232,13 @@ ReadExpression ROUT
TEQP PC, #SVC_mode ; interrupts on, ta.
LDR R12, =ExprWSpace
STR R13, ExprSVCstack
[ LongCommandLines
LDR R1, =ExprBuff
MOV R2, #LongCLISize
|
ADR R1, ExprBuff