Commit a6c7a3b0 authored by Kevin Bracey's avatar Kevin Bracey
Browse files

32-bit compatible.

Admin:
  Tested on a 32-bit system; untested on 26-bit, and merge with Ursula branch
  untested.

Version 2.52. Tagged as 'FileSwitch-2_52'
parent af0badf9
......@@ -6,9 +6,9 @@
GBLS Module_MinorVersion
GBLS Module_Date
GBLS Module_FullVersion
Module_MajorVersion SETS "2.51"
Module_Version SETA 251
Module_MajorVersion SETS "2.52"
Module_Version SETA 252
Module_MinorVersion SETS ""
Module_Date SETS "20 Mar 2000"
Module_FullVersion SETS "2.51"
Module_FullVersion SETS "2.52"
END
/* (2.51)
/* (2.52)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 2.51
#define Module_MajorVersion_CMHG 2.52
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 20 Mar 2000
#define Module_MajorVersion "2.51"
#define Module_Version 251
#define Module_MajorVersion "2.52"
#define Module_Version 252
#define Module_MinorVersion ""
#define Module_Date "20 Mar 2000"
#define Module_FullVersion "2.51"
#define Module_FullVersion "2.52"
......@@ -158,7 +158,7 @@ ReduceParents ENTRY "r0-r3"
; R2 = unchanged, RMAlloced disc^ or NULL
;
CanonicaliseSpecialAndDisc ENTRY "r0,r3,r4,r5,r6,r7,r8", 4
CanonicaliseSpecialAndDisc EntryS "r0,r3,r4,r5,r6,r7,r8", 4
[ debugcanonical
DSTRING r1, "Canonicalise #",cc
DSTRING r2, "::"
......
......@@ -119,7 +119,8 @@ SimpleReadDir ENTRY "r0-r8", 512
90
STR r1, [sp, #Proc_LocalStack + 1*4]
EXITS
CLRV
EXIT
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;
......@@ -864,7 +865,7 @@ NullString DCB 0
;
; expected uses: from Service_DiscDismounted and rename
AlterMatchingDirs ENTRY "r0-r9"
AlterMatchingDirs EntryS "r0-r9"
[ debugservice
DSTRING r1, "AlterMatchingDirs(",cc
DSTRING r2, ",",cc
......@@ -947,7 +948,7 @@ AlterMatchingDirs ENTRY "r0-r9"
BNE %FT70
; Hot stuff! prefix prefixes path in an interesting way - let's do the business to it
LDR r1, [r9, #2*4]
LDR r1, [r9, #Proc_RegOffset + 2*4]
TEQ r1, #0
BNE %FT40
......@@ -1033,6 +1034,6 @@ UnsetMatchingDirs ENTRY "r1-r3"
BL AlterMatchingDirs
99
EXITS
EXIT
END
......@@ -48,7 +48,7 @@
; The path should be in canonical form.
;
EnsureCanonicalObject ENTRY "r7,r8,r9"
EnsureCanonicalObject EntryS "r7,r8,r9"
[ debugensure
DSTRING r6,"EnsureCanonicalObject ",cc
DSTRING r1," "
......@@ -332,7 +332,7 @@ strcmp_forimagefilepath ENTRY "r1,r2,r3,r4"
; the fscb is correct as it may be the case that a deeper nesting of
; fscbs is required.
AssessDestinationForPath ENTRY "r2,r3,scb"
AssessDestinationForPath EntryS "r2,r3,scb"
[ debugensure
DSTRING r1, "Assessing destination for "
......
......@@ -195,12 +195,12 @@ EnumDir_Code ENTRY "r0-r1, r7, r9-r10" ; Low registers used sp relative
75 ADD sp, sp, #enumdir_bsize ; Destroy local frame
STRVS r0, [sp] ; Return current error (if any) to Sam
MOV r2, psr
SavePSR r2
MOV r0, #0
MOV r1, r7
SWI XOS_Find
STRVS r0, [sp] ; May modify it though
TEQVCP r2, #0 ; V from op/Close
RestPSR r2, VC ; V from op/Close
EXIT
fsw_wildstar ; Used from all over
......@@ -396,9 +396,8 @@ SussCopyOptions ENTRY
TEQ r0, #"a"
MOVEQ r8, #util_noattr
MOVEQ r14, psr ; Invert C as bit wrong way round
TEQEQP r14, #C_bit ; for backwrods compatabilly-T
BEQ %BT05
TOGPSR C_bit, r14, EQ ; Invert C as bit wrong way round
BEQ %BT05 ; for backwrods compatabilly-T
TEQ r0, #"c"
MOVEQ r8, #util_confirm
......@@ -538,13 +537,22 @@ SetAndGetUtilOption ENTRY "r2"
TestBadOption ROUT
CMP r0, #space
[ No26bitCode
MOVLS pc, lr ; V will be clear 'cause r0 is small
|
BICLSS pc, lr, #V_bit
]
Push "lr"
ADRL r0, ErrorBlock_BadCommandOption
BL copy_error
[ No26bitCode
SETV
Pull "pc"
|
Pull "lr"
ORRS pc, lr, #V_bit
]
]
......@@ -672,12 +680,12 @@ Truncate_Code ENTRY
BLVS copy_error
EXIT VS
MOV R3, PC ; save PSR state
SavePSR R3 ; save PSR state
MOV R0, #ReadCMOS
MOV R1, #FileSwitchCMOS
SWI XOS_Byte
EXIT VS
TEQP R3, #0 ; restore PSR state
RestPSR R3 ; restore PSR state
ORRNE R2, R2, #FileSwitchTruncateNamesCMOSBit ; EQ => off, so clear bit
BICEQ R2, R2, #FileSwitchTruncateNamesCMOSBit ; NE => on, so set bit
MOV R0, #WriteCMOS
......@@ -717,11 +725,17 @@ Truncate_Code ENTRY
;
GetOnOff ROUT
[ :LNOT:No26bitCode
BIC R14, R14, #V_bit ; prepare to exit VC
]
LDRB R1, [R0], #1
TEQ R1, #"O"
TEQNE R1, #"o"
[ No26bitCode
BNE %FA20
|
ORRNES PC, R14, #V_bit
]
LDRB R1, [R0], #1
TEQ R1, #"N"
......@@ -730,22 +744,44 @@ GetOnOff ROUT
LDRB R1, [R0], #1
CMP R1, #" "
[ No26bitCode
BHI %FA20
CMP PC, #0 ; NE: found ON
MOV PC, R14
20 SETV
MOV PC, R14
|
ORRHIS PC, R14, #V_bit
BICS PC, R14, #Z_bit ; found ON
]
10
TEQ R1, #"F"
TEQNE R1, #"f"
[ No26bitCode
BNE %BA20
|
ORRNES PC, R14, #V_bit
]
LDRB R1, [R0], #1
TEQ R1, #"F"
TEQNE R1, #"f"
[ No26bitCode
BNE %BA20
|
ORRNES PC, R14, #V_bit
]
LDRB R1, [R0], #1
CMP R1, #" "
[ No26bitCode
BHI %BA20
CMP R0, R0 ; EQ: found OFF
MOV PC, R14
|
ORRHIS PC, R14, #V_bit
ORRS PC, R14, #Z_bit ; found OFF
]
END
......@@ -358,7 +358,7 @@ fsw_GetArea
; Out VC: r2 = Nowt, block freed
; VS: r2 = Nowt, fail or VSet on entry
SFreeArea ENTRY "r0, r1"
SFreeArea EntryS "r0, r1"
[ debugheap
DREG r2,"SFreeArea "
......@@ -638,7 +638,7 @@ SNewLinkedString ENTRY
; Out VC: block freed
; VS: failed to free block, or V set initially
SFreeLinkedArea ENTRY "r0, r2"
SFreeLinkedArea EntryS "r0, r2"
LDR r2, [r0] ; Get this block^
SUB r2, r2, #la_hsize ; Get real memory^
......@@ -688,7 +688,7 @@ SFreeLinkedArea ENTRY "r0, r2"
;
; As SFreeLinkedArea, but checks for NULL/Nowt first
SFreeLinkedString ENTRY
SFreeLinkedString EntryS
LDR r14, [r0]
TEQ r14, #NULL
TEQNE r14, #Nowt
......@@ -699,51 +699,6 @@ SFreeLinkedString ENTRY
EXIT
]
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;
; DelinkLinkedArea
; ================
;
; Unlink the given heap block from global list. Preserves V
; In r2 -> block
DelinkLinkedArea ENTRY "r0, r2"
SUB r2, r2, #la_hsize ; Get real memory^
[ debugheap
DREG r2,"DelinkLinkedArea: "
]
ADR r0, LinkedAreas - la_link
10 LDR r14, [r0, #la_link] ; Is this a pointer to the block we
; want to delink ?
[ debugheap
DREG r14, "Trying against block at "
]
[ paranoid
CMP r14, #Nowt
BNE %FT01
ADR r0, %FT90
BL CopyError
EXIT
90
DCD 0
DCB "Linked area underflow !", 0
ALIGN
01
]
CMP r14, #Nowt ; End of list without finding it ?
EXITS EQ ; [really bad stuff]
CMP r14, r2
MOVNE r0, r14
BNE %BT10 ; Loop till we find it
LDR r14, [r2, #la_link] ; Store block pointer in previous block
STR r14, [r0, #la_link]
EXITS
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;
; SFreeAllLinkedAreas
......@@ -754,7 +709,7 @@ DelinkLinkedArea ENTRY "r0, r2"
; Out VC: blocks freed
; VS: failed to free all blocks
SFreeAllLinkedAreas ENTRY "r0, r2, r3"
SFreeAllLinkedAreas EntryS "r0, r2, r3"
ADR r0, LinkedAreas - la_link
MOV r3, #0 ; Free blocks allocated in this domain
......@@ -789,7 +744,7 @@ SFreeAllLinkedAreas ENTRY "r0, r2, r3"
; Out VC: blocks freed
; VS: failed to free all blocks
SFreeAllLinkedAreasEverywhere ENTRY "r0, r2"
SFreeAllLinkedAreasEverywhere EntryS "r0, r2"
[ debugheap
DLINE "SFreeAllLinkedAreasEverywhere"
......@@ -883,7 +838,7 @@ SGetRMA ENTRY "r0-r1, r3"
; Out r3 = number of chars (can be used as size for Heap)
strlen ENTRY "r0, r4"
strlen EntryS "r0, r4"
MOV r4, #space-1
......@@ -915,7 +870,7 @@ strlenTS ALTENTRY
; Out r3 += number of chars (can be used as size for Heap)
strlen_accumulate ENTRY "r0, r1"
strlen_accumulate EntryS "r0, r1"
MOV r14, #space-1
......@@ -946,7 +901,7 @@ strlenTS_accumulate ALTENTRY
; Out new string in r1 = "r1" :CC: "r2" :CC: 0
strcat ENTRY "r1, r2, r4"
strcat EntryS "r1, r2, r4"
MOV r4, #space-1
......@@ -1006,7 +961,7 @@ strcpyTS ALTENTRY ; Match with strcatTS !!!
;
; r1 advanced to end of new string (points at the terminator).
strcat_advance ENTRY "r2, r4"
strcat_advance EntryS "r2, r4"
MOV r4, #space-1
......@@ -1081,8 +1036,13 @@ strchr ENTRY
BHI %BT10
MOV r1, #0
[ No26bitCode
CMP pc, #0 ; NE
EXIT
|
PullEnv
BICS pc, lr, #Z_bit ; NE
]
[ Version >= 170
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
......@@ -1313,7 +1273,7 @@ FS_SkipSpaces ROUT
; Out r2,r3 updated, flags preserved
SReadTime ENTRY "r0-r1, r4", 8 ; Uses local stack for block
SReadTime EntryS "r0-r1, r4", 8 ; Uses local stack for block
MOV r4, #&FF000000 ; Create &FFFFFttt
ORR r2, r2, r4, ASR #12 ; Fill bits 31-12 with 1's
......@@ -1678,12 +1638,22 @@ ValidateR2R5_WriteToCoreCodeLoad ALTENTRY
; Start in &8000...MemoryLimit ?
CMP r2, #&8000
CMPHS r1, r2
[ No26bitCode
BLO %FT97
|
EXITS LO ; No
]
; Yes, start's in range, is end?
CMP r5, r1
BHI %BA90 ; No - give error
[ No26bitCode
97
CLRV
EXIT
|
EXITS
]
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
......
......@@ -129,8 +129,12 @@ FSControl_BadReason
addr r0, ErrorBlock_BadFSControlReason
BL copy_error
[ No26bitCode
Pull pc ; copy_error sets V
|
Pull lr
ORRS pc, lr, #V_bit
]
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;
......@@ -405,7 +409,7 @@ Run_UndatedFile
]
LDR sp, =SVCSTK ; Flatten superstack, we don't return
TEQP pc, #0 ; USR mode, all ints on
WritePSRc 0, r12 ; USR mode, all ints on
MOV r12, #&80000000 ; Cause address extinction if used
MOV r13, #&80000000 ; (keep 1.20 compat capable)
ADR lr, ReturnFromAbsoluteCode
......@@ -474,7 +478,7 @@ Run_TransientFile
LDR r0, CommandLine
LDR r1, commandtailptr
TEQP pc, #0 ; USR mode, all ints on
WritePSRc 0, wp ; USR mode, all ints on
ADD r5, r3, r5 ; r12 -> transient workspace. Not bank
SUB wp, r5, #transient_code ; Must correct as r5 = info + code
; and r2 = code^
......@@ -512,7 +516,7 @@ Run_TransientFile
ReturnFromPIC
MOV r1, psr ; Remember V, you whalley (SWI clears)
SavePSR r1 ; Remember V, you whalley (SWI clears)
SWI XOS_EnterOS ; Get back to superstate in all cases
......@@ -884,7 +888,8 @@ CopyCommandLineAndReadTime ENTRY "r0-r2"
MOV r14, #3
STR r14, [r1]
SWI XOS_Word ; ReadTime shouldn't give error
EXITS ; So make like it didn't !
CLRV ; So make like it didn't !
EXIT
LTORG
......
......@@ -654,8 +654,14 @@ LookupIFSType ENTRY
IsFSNameTerm
[ No26bitCode
ASSERT space = &20 ; also assume r0 < 256
TST r0, #&E0
MOVEQ pc, lr ; sneaky, huh?
|
CMP r0, #space ; CtrlChar is always term
ORRLOS pc, lr, #Z_bit ; EQ
]
TEQ r0, #":" ; For fsname:
TEQNE r0, #"-" ; For -fsname-
......@@ -1239,7 +1245,6 @@ PrintR0Chars ENTRY
;
; In currentfs is valid fscb^ to reselect
[ Version >= 170
RestoreCurrEntry NewSwiEntry "r0,r2"
BL ReadCurrentFS
MOVVC r2, r0
......@@ -1254,13 +1259,6 @@ RestoreCurrEntry NewSwiEntry "r0,r2"
DREG r0,"globalerror before exit is "
]
SwiExit
|
RestoreCurrEntry ROUT ; NB. No local frame, just dealing with global state
LDR r14, currentfs
STR r14, tempfs
Pull pc,,^ ; Claim vector. Assumes VClear in lr
]
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;
......@@ -1272,7 +1270,6 @@ RestoreCurrEntry ROUT ; NB. No local frame, just dealing with global state
; Out r1 = module base of Filing System, 0 if none selected
; r2 = ptr to private word
[ Version >= 170
ReadTempModEntry NewSwiEntry "r0"
BL ReadTempFS
BVS %FT90
......@@ -1282,16 +1279,6 @@ ReadTempModEntry NewSwiEntry "r0"
LDRNE r2, [r0, #fscb_privwordptr]
90
SwiExit
|
ReadTempModEntry ROUT ; NB. No local frame, just dealing with global state
LDR r2, tempfs
CMP r2, #Nowt
MOVEQ r1, #0
LDRNE r1, [r2, #fscb_modulebase]
LDRNE r2, [r2, #fscb_privwordptr]
Pull pc,,^ ; Claim vector. Assumes VClear in lr
]
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;
......@@ -1304,7 +1291,6 @@ ReadTempModEntry ROUT ; NB. No local frame, just dealing with global state
; Out r1 = secondary module base, 0 if no fs selected
; r2 = ptr to private word
[ Version >= 170
ReadSecModEntry NewSwiEntry "r0"
BL ReadTempFS
BVS %FT10
......@@ -1315,16 +1301,6 @@ ReadSecModEntry NewSwiEntry "r0"
10
SwiExit
|
ReadSecModEntry ROUT ; NB. No local frame, just dealing with global state
LDR r2, tempfs
CMP r2, #Nowt
MOVEQ r1, #0
LDRNE r1, [r2, #fscb_modulebase2]
LDRNE r2, [r2, #fscb_privwordptr2]
Pull pc,,^ ; Claim vector. Assumes VClear in lr
]
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;
......@@ -1354,7 +1330,12 @@ ReadFSHandle ROUT ; NB. No local frame, just dealing with global state
LDREQ r1, [r2, #:INDEX: scb_fshandle] ; Get scb^.fshandle
LDREQ r2, [r2, #:INDEX: scb_fscb] ; Get scb^.fscb
LDREQ r2, [r2, #fscb_info] ; Get fscb^.info
[ No26bitCode
CLRV
Pull pc ; Claim vector.
|
Pull pc,,^ ; Claim vector. Assumes VClear in lr
]
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;
......
......@@ -33,11 +33,12 @@ ErrorBlock_$label
; In r0 -> error block
; fp (may be 0)
; Preserves V
CopyErrorStore ROUT
TEQ fp, #0
STRNE r0, globalerror
MOVS pc, lr
MOV pc, lr
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; Check external error pointer is kosha, replacing with translated
......@@ -46,9 +47,11 @@ CopyErrorStore ROUT
; In r0 -> error block
CopyErrorValidateExternal ROUT
[ :LNOT:No26bitCode
TST r0, #&FC000003
MOVEQS pc, lr
ADRL r0, ErrorBlock_InvalidErrorBlock
]
B copy_error ; Tail folding
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
......@@ -261,8 +264,13 @@ AppendHandleToError ENTRY "r0-r5", (?fsw_on_file_handle + 4 + 12 + 3) :AND: :NOT
80
STR r0, globalerror
[ No26bitCode
85 SETV
EXIT
|
85 PullEnv
ORRS pc, lr, #V_bit
]
fsw_on_file_handle DCB "OnFileHandle", 0
ALIGN
......@@ -394,25 +402,45 @@ SetErrorNotOpenForUpdate ALTENTRY
Lowlevel_UnsupportedFSEntry
ADR r0, ErrorBlock_UnsupportedFSEntry
[ No26bitCode
SETV
MOV pc, lr
|
ORRS pc, lr, #V_bit ; VSet, r0 as if FS
]
Lowlevel_UnalignedFSEntry
ADR r0, ErrorBlock_UnalignedFSEntry
[ No26bitCode
SETV
MOV pc, lr
|
ORRS pc, lr, #V_bit ; VSet, r0 as if FS
]
Lowlevel_NotEnoughStackForFSEntry
ADR r0, ErrorBlock_NotEnoughStackForFSEntry
[ No26bitCode
SETV
MOV pc, lr
|
ORRS pc, lr, #V_bit ; VSet, r0 as if FS
]
Lowlevel_NoFilingSystemsActive
ADR r0, ErrorBlock_NoSelectedFilingSystem
[ No26bitCode
SETV
MOV pc, lr
|
ORRS pc, lr, #V_bit ; VSet, r0 as if FS
]
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; Standard error blocks
......
......@@ -564,8 +564,8 @@ FSPath_AddVarToContext ENTRY "r0,r1,r2,r3,r4,r5,r6"
MOV r3, #FSPathEnum_size + 1 + 1 ; One for each string terminator
BL strlen_accumulate
MOV r4, r1
MOV r1, r0
BL strlen_accumulate
MOVS r1, r0
BLNE strlen_accumulate
MOV r0, r6
LDR r6, [r0]
......@@ -616,7 +616,7 @@ FSPath_PackPath ENTRY "r0,r1"
CMP r14, #delete
CMPNE r14, #space-1
BHI %BT10
EXITS
EXIT
;
; FSPath_StepContext
......@@ -742,7 +742,7 @@ FSPath_AllDone ENTRY "r3"
; <path>: is stripped and the process repeated on the new first