Commit 3a6c3d47 authored by Kevin Bracey's avatar Kevin Bracey
Browse files

More 32-bit fixes; all to do with coping with the system heap, ROM etc being...

More 32-bit fixes; all to do with coping with the system heap, ROM etc being in new places - these are now checked at run-time.

Version 2.65. Tagged as 'FileSwitch-2_65'
parent 0c40540e
;
; This file is automatically maintained by srccommit, do not edit manually.
; Last processed by srccommit version: 1.68.
;
GBLS Module_MajorVersion
GBLA Module_Version
GBLS Module_MinorVersion
GBLS Module_Date
GBLS Module_FullVersion
GBLS Module_ApplicationDate2
GBLS Module_ApplicationDate4
GBLS Module_ApplicationDate
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "2.64"
Module_Version SETA 264
Module_MajorVersion SETS "2.65"
Module_Version SETA 265
Module_MinorVersion SETS ""
Module_Date SETS "20 Aug 2001"
Module_ApplicationDate2 SETS "20-Aug-01"
Module_ApplicationDate4 SETS "20-Aug-2001"
Module_Date SETS "12 Dec 2002"
Module_ApplicationDate SETS "12-Dec-02"
Module_ComponentName SETS "FileSwitch"
Module_ComponentPath SETS "RiscOS/Sources/FileSys/FileSwitch"
Module_FullVersion SETS "2.64"
Module_HelpVersion SETS "2.64 (20 Aug 2001)"
Module_FullVersion SETS "2.65"
Module_HelpVersion SETS "2.65 (12 Dec 2002)"
END
/* (2.64)
/* (2.65)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.68.
*
*/
#define Module_MajorVersion_CMHG 2.64
#define Module_MajorVersion_CMHG 2.65
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 20 Aug 2001
#define Module_Date_CMHG 12 Dec 2002
#define Module_MajorVersion "2.64"
#define Module_Version 264
#define Module_MajorVersion "2.65"
#define Module_Version 265
#define Module_MinorVersion ""
#define Module_Date "20 Aug 2001"
#define Module_Date "12 Dec 2002"
#define Module_ApplicationDate2 "20-Aug-01"
#define Module_ApplicationDate4 "20-Aug-2001"
#define Module_ApplicationDate "12-Dec-02"
#define Module_ComponentName "FileSwitch"
#define Module_ComponentPath "RiscOS/Sources/FileSys/FileSwitch"
#define Module_FullVersion "2.64"
#define Module_HelpVersion "2.64 (20 Aug 2001)"
#define Module_FullVersion "2.65"
#define Module_HelpVersion "2.65 (12 Dec 2002)"
#define Module_LibraryVersionInfo "2:65"
......@@ -160,7 +160,8 @@ heap_freelist * 4
heap_highwatermark * 8
heap_end * 12
LDR r1, =SysHeapStart + heap_highwatermark
LDR r1, SysHeapStart
ADD r1, r1, #heap_highwatermark
LDMIA r1, {r1, r14}
SUB r1, r14, r1 ; Amount left at end of heap
......@@ -205,7 +206,8 @@ MTSH_SGetArea Entry "r0, r1, r3"
EXIT NE ; r2 -> block (or VS fail)
EXIT VS ; VS -> bad fail
LDR r1, =SysHeapStart + heap_highwatermark
LDR r1, SysHeapStart
ADD r1, r1, #heap_highwatermark
LDMIA r1, {r1, r14}
SUB r1, r14, r1 ; Amount left at end of heap
......@@ -224,7 +226,7 @@ MTSH_SGetArea Entry "r0, r1, r3"
MTSH_STrySysHeap Entry "r0, r1, r3"
MOV r0, #HeapReason_Get
LDR r1, =SysHeapStart
LDR r1, SysHeapStart
SWI XOS_Heap ; Corrupts r3 !
CMPVC pc, #0 ; VC, NE -> ok
EXIT VC
......@@ -314,7 +316,7 @@ STrySysHeap Entry "r0, r1, r3"
] ;MercifulToSysHeap
MOV r0, #HeapReason_Get
LDR r1, =SysHeapStart
LDR r1, SysHeapStart
SWI XOS_Heap ; Corrupts r3 !
[ debugheap
BVS %FT00
......@@ -371,8 +373,8 @@ SFreeArea EntryS "r0, r1"
CheckHeapBlockFree
]
LDR r1, =SysHeapStart ; SysHeap address > RMA address
CMP r1, r2
LDR r1, SysHeapStart
CMP r1, r2 ; if before start, then must be in RMA
BHI %FT50
LDR r0, [r1, #heap_end] ; r0 = size of heap
ADD r0, r0, r1 ; r0 -> end of heap +1
......@@ -397,7 +399,7 @@ SFreeArea EntryS "r0, r1"
BVC %FT30
;free block to heap
25
LDR r1,=SysHeapStart
LDR r1,SysHeapStart
] ;MercifulToSysHeap
MOV r0, #HeapReason_Free
......@@ -1575,6 +1577,9 @@ ValidateR2R5_ReadFromCore Entry "r0, r1"
SWI XOS_ValidateAddress
EXIT CC
TEQ pc, pc ; 32-bit system?
BEQ %FT20
CMP r2, #&03800000 ; Is block within ROM area ?
RSBCSS r14, r5, #&04000000 ; Rare occurence, so don't put
EXIT CS ; before ValidateAddress call
......@@ -1582,6 +1587,11 @@ ValidateR2R5_ReadFromCore Entry "r0, r1"
40 addr r0, ErrorBlock_CoreNotReadable
B %FT95
20 CMP r2, #&FC000000 ; Is block within ROM area ?
SUBCS r14, r5, r2
RSBCSS r14, r14, #OSROM_ImageSize*1024
EXIT CS
B %BA40
; .............................................................................
;
......
......@@ -343,6 +343,8 @@ Run_UndatedFile
MOV r1, r0 ; NB. Our strings are all dead now
BL SkipOverNameAndSpaces ; r1 -> copy of command tail
LDR r10, SVCSTK ; remember top of stack
;Check whether it's a squeezed app.
CMP r2, #&8000
BNE %FT77 ;Not an 'APP' (type FF8)
......@@ -437,7 +439,7 @@ Run_UndatedFile
]
77
LDR sp, =SVCSTK ; Flatten superstack, we don't return
MOV sp, r10 ; Flatten superstack, we don't return
WritePSRc 0, r12 ; USR mode, all ints on
MOV r12, #&80000000 ; Cause address extinction if used
......
......@@ -294,7 +294,7 @@ AddFSEntry NewSwiEntry "r0-r8, fscb"
TEQ r0, #0 ; No entry point for this routine ?
MOVEQ r0, r7 ; Give default 'dunno' entry if so
ADDNE r0, r0, r5
TST r0, #ARM_CC_Mask ; Formed a real ARM address ?
TST r0, #3 ; Formed a real ARM address ?
; This MUST be word aligned (code)
MOVNE r0, r8 ; Give default 'hate' entry if not
STR r0, [r2, r1] ; Dest = real address in module
......@@ -453,7 +453,7 @@ AddImageFSEntry NewSwiEntry "r0-r8, fscb"
TEQ r0, #0 ; No entry point for this routine ?
MOVEQ r0, r7 ; Give default 'dunno' entry if so
ADDNE r0, r0, r5
TST r0, #ARM_CC_Mask ; Formed a real ARM address ?
TST r0, #3 ; Formed a real ARM address ?
; This MUST be word aligned (code)
MOVNE r0, r8 ; Give default 'hate' entry if not
TEQ r1, #IFS_func ; fsinfo at start of IFS block
......@@ -788,8 +788,9 @@ PrintFilingSystemText Entry "r0-r5, r6, fscb" ; FSFunc only preserves r6 up
EXIT EQ ; VClear
LDR r0, [fscb, #fscb_startuptext]
CMP r0, #-1
BEQ %FT90
CMP r0, #0
BLT %FT90
BNE %FT40
ADR r0, UntitledFSToken ; Look up untitled FS start up text.
......
......@@ -785,6 +785,8 @@ codeflag # 1 ; 0 if data being loaded, 1 if code
AlignSpace
EnvStringAddr # 4 ; Only needed when we're not bound to kernel
EnvTimeAddr # 4
SVCSTK # 4
SysHeapStart # 4
; No need to align end of global workspace; saves alloc when rounded!
......@@ -800,12 +802,8 @@ EnvTimeAddr # 4
FileSwitchWorkspace_size * :INDEX: @
[ SVCSTK = &01C02000
StaticName_length * 256 ; Limits size of input filename, path etc.
|
StaticName_length * 1024 ; Limits size of input filename, path etc.
; was 256 (changed for Ursula)
]
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; Local workspace allocation: done bottom up!
......@@ -1158,6 +1156,20 @@ FileSwitch_Init Entry "r7"
STR r0, EnvStringAddr ; in soft loaded version
STR r2, EnvTimeAddr
MOV r0, #6
MOV r1, #0
MOV r2, #16
SWI XOS_ReadSysInfo
MOVVS r2, #0
TEQ r2, #0
MOVEQ r2, #&01C00000
ADDEQ r2, r2, #&2000
STR r2, SVCSTK
MOV r0, #0
SWI XOS_ReadDynamicArea
EXIT VS
STR r0, SysHeapStart
; Initialise lots of pointers to Nowt
......@@ -1461,6 +1473,11 @@ CountOptsVariableDefault DCB "~C R ~V", CR
DCB "File$Type_BBC", CR
DCB "BBC ROM", CR
[ Version >= 259
DCB "File$Type_F95", CR
DCB "Code", CR
]
[ Version >= 225
DCB "File$Type_FAE", CR ; AMcC 27-Feb-95: for Toolbox
DCB "Resource", CR
......@@ -2222,7 +2239,7 @@ ReleaseHBlocks ROUT
MOV r0,#0
STR r0,HBlocks_Valid
MOV r0,#HeapReason_Free
LDR r1,=SysHeapStart
LDR r1,SysHeapStart
MOV r3,#0
LDR r2,HBlockArray_32
STR r3,HBlockArray_32
......
......@@ -20,6 +20,7 @@
GET Hdr:System
GET Hdr:Machine.<Machine>
GET Hdr:UserIF.<UserIF>
GET Hdr:ImageSize.<ImageSize>
; Get brutal with 32-bitness - use 26-bit code unless we really mustn't,
; as 32-bit is a performance drain. Can't softload FileSwitch really,
......@@ -37,7 +38,7 @@ No32bitCode SETL {TRUE}
GET Hdr:Variables
GET Hdr:EnvNumbers
GET Hdr:Proc
GET Hdr:PublicWS ; Import SVCSTK, SysHeap, ScratchSpace
GET Hdr:PublicWS ; Import ScratchSpace, DomainId
GET Hdr:Tokens
GET Hdr:FileTypes
GET Hdr:VduExt
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment