Commits (2)
  • Robert Sprowson's avatar
    Fix for missing monitor name after load · 5cf8ee42
    Robert Sprowson authored
    The code path that filing systems the register with dontuseload omitted the line printed when *OPT 1 is non-zero.
    In particular this meant FileCore (which has the fsinfo word flag set) didn't report any monitor name.
    For dontusesave, the initial call to do the equivalent of *Create covers the output even though it's a bit early. However, the flag check appeared to be inverted, so an FS with it set would call OS_File, and one clear would call OS_GBPB.
    
    FileSwHdr.s: Remove use_fsfile_Save and use_fsfile_Load switches, since clients declare at runtime what their preference is (since RISC OS 3).
    LowLevel.s: Extract monitor name reporting code, replace with function call to common code.
    FSShared.s: Common function ReportMonitor.
    OSFile.s: After doing a load via OS_GBPB call the monitor name reporting code. Tune up the StrongARM code flush code a little to not need R5 as a temporary. Fix inverted sense of dontusesave.
    
    Version 2.87. Tagged as 'FileSwitch-2_87'
    5cf8ee42
  • Timothy E Baldwin's avatar
    Use normal spaces instead of hard spaces in debug messages. · dc166065
    Timothy E Baldwin authored
    This makes editing the source easier on other operating systems.
    
    
    Version 2.87. Not tagged
    dc166065
;
; This file is automatically maintained by srccommit, do not edit manually.
; Last processed by srccommit version: 1.1.
;
GBLS Module_MajorVersion
GBLA Module_Version
......@@ -10,14 +9,12 @@
GBLS Module_ApplicationDate
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "2.86"
Module_Version SETA 286
Module_MajorVersion SETS "2.87"
Module_Version SETA 287
Module_MinorVersion SETS ""
Module_Date SETS "03 Sep 2017"
Module_ApplicationDate SETS "03-Sep-17"
Module_Date SETS "12 Oct 2019"
Module_ApplicationDate SETS "12-Oct-19"
Module_ComponentName SETS "FileSwitch"
Module_ComponentPath SETS "castle/RiscOS/Sources/FileSys/FileSwitch"
Module_FullVersion SETS "2.86"
Module_HelpVersion SETS "2.86 (03 Sep 2017)"
Module_FullVersion SETS "2.87"
Module_HelpVersion SETS "2.87 (12 Oct 2019)"
END
/* (2.86)
/* (2.87)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 2.86
#define Module_MajorVersion_CMHG 2.87
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 03 Sep 2017
#define Module_Date_CMHG 12 Oct 2019
#define Module_MajorVersion "2.86"
#define Module_Version 286
#define Module_MajorVersion "2.87"
#define Module_Version 287
#define Module_MinorVersion ""
#define Module_Date "03 Sep 2017"
#define Module_Date "12 Oct 2019"
#define Module_ApplicationDate "03-Sep-17"
#define Module_ApplicationDate "12-Oct-19"
#define Module_ComponentName "FileSwitch"
#define Module_ComponentPath "castle/RiscOS/Sources/FileSys/FileSwitch"
#define Module_FullVersion "2.86"
#define Module_HelpVersion "2.86 (03 Sep 2017)"
#define Module_LibraryVersionInfo "2:86"
#define Module_FullVersion "2.87"
#define Module_HelpVersion "2.87 (12 Oct 2019)"
#define Module_LibraryVersionInfo "2:87"
......@@ -1249,7 +1249,7 @@ AccessEntry NewSwiEntry "r0-r9,fscb"
SwiExit VS
[ debugcontrol
DSTRING r1, "Tail from process etc is "
DSTRING r7, "Leaf from .. is"
DSTRING r7, "Leaf from .. is "
]
LDR lr, [fscb, #fscb_info]
......@@ -1337,7 +1337,7 @@ AccessEntry NewSwiEntry "r0-r9,fscb"
[ debugcontrol
DSTRING r1, "Tail after read entries is "
DSTRING r7, "Leaf after read entries is"
DSTRING r7, "Leaf after read entries is "
]
TEQ r3, #0
BEQ %FT75
......
......@@ -14,8 +14,6 @@
;
SUBT > Sources.FSShared
SharedCodeStart ROUT
; Make sure these are consistent with those used in OSUtils
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
......@@ -105,6 +103,109 @@ PrintR0Decimal Entry "r0-r3"
STRVS r0, [sp]
EXIT
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; Report a monitor name based on OPT1 settings
; In r2 = load addr
; r3 = exec addr
; r4 = length
; r6 -> unwildcarded leafname
; r7 = opt 1 value
;
; Out regs preserved
ReportMonitor Entry "r0-r2, r8"
CMP r7, #0
EXIT EQ ; VClear
; Must copy name away in case of reentrancy (very low lifetime object anyway)
ADR r0, OptFilenameString
MOV r1, r6
BL SGetLinkedString_excludingspaces ; Stop on CtrlChar/space
EXIT VS
; Always print name. r1 -> copy of filename. r7 = OPT 1 value
MOV r8, #0 ; Print name in field of 10
20 LDRB r0, [r1], #1
CMP r0, #0 ; Now zero terminated
ADDNE r8, r8, #1 ; Another one bites the dust
SWINE XOS_WriteC ; WriteC preserves Z
BVS %FT95
BNE %BT20 ; Loop over all of name
; OPT 1, 2 or higher ?
CMP r7, #1 ; OPT 1,1 -> just filename, no trailers
BEQ %FT85
; Must now pad out in field of 10, 'cos here comes the info
26 CMP r8, #10 ; Must allow for name overflowing !
ADDLO r8, r8, #1 ; Finished spacing yet ?
SWILO XOS_WriteI+space
BVS %FT95
BLO %BT26
27 SWIVC XOS_WriteI+space ; Two spaces please in any case
SWIVC XOS_WriteI+space
BVS %FT95
CMP r7, #2 ; OPT 1, 2 -> Hex Load/Exec/Length
BNE %FT50 ; OPT 1, 4 and above identical to 3
30 MOV r0, r2 ; Load address in hex. Entry from below
BL HexR0LongWord
SWIVC XOS_WriteI+space
MOVVC r0, r3 ; Exec address in hex
BLVC HexR0LongWord
B %FT80 ; Print the length as well
50 ; Interpret the load and exec addresses suitably
CMP r2, r3 ; Load = exec -> BBC utility
BEQ %BT30
CMP r2, #&FFF00000 ; Undated ones are given in hex
BCC %BT30
Push "r2, r3"
MOV r2, r2, LSR #8 ; File type in bottom 12 bits
BL DecodeFileType
MOV r0, r2
BL PrintR0Chars
MOVVC r0, r3
BLVC PrintR0Chars
Pull "r2, r3"
SUB sp, sp, #64
SWIVC XOS_WriteI+space
MOVVC r0, sp
STRVC r3, [sp]
STRVCB r2, [sp, #4]
ADDVC r1, sp, #8 ; rv^
MOVVC r2, #64-8
SWIVC XOS_ConvertStandardDateAndTime
ADDVC r0, sp, #8
SWIVC XOS_Write0
ADD sp, sp, #64
; Exit for OPT 1, 2 and above - print a space, then the length
80 SWIVC XOS_WriteI+space
MOVVC r0, r4 ; Length in hex
BLVC HexR0LongWord
; Exit for OPT 1, 1
85 SWIVC XOS_NewLine ; Tidy up the output line
95 BLVS CopyErrorExternal
ADR r0, OptFilenameString ; Always deallocate string
BL SFreeLinkedArea
EXIT
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; Shared output routines; present in OS version
......
......@@ -51,12 +51,6 @@ kludgeforNFS SETL {FALSE}
StrongARM SETL {TRUE}
SASTMhatbroken SETL {TRUE} :LAND: StrongARM
GBLL Use_fsfile_Save
Use_fsfile_Save SETL {TRUE} ; Indicates whether fsfile_Save reason is used, or create, open, GBPB, close
GBLL Use_fsfile_Load
Use_fsfile_Load SETL {TRUE} ; Indicates whether fsfile_Load reason is used, or open, GBPB, close
GBLL UseDynamicAreas
UseDynamicAreas SETL {TRUE}
......
......@@ -340,115 +340,16 @@ CallFSFile_Given Entry "r0-r12" ; Never (ever) trust lower level routines
00
]
; Only Load/Save/Create give monitor messages from OPT 1
LDRB r7, lowfile_opt1 ; Nothing to do if OPT 1, 0
CMP r7, #0
EXIT EQ ; VClear
CMP r1, #fsfile_Save ; Print data that was used in save
CMPNE r1, #fsfile_Create ; or create, not what comes back
ADREQ r14, fileblock_base
LDMEQIA r14, {r2-r5} ; Get original parms in r2-r5
SUBEQ r4, r5, r4 ; Form length, you dead grey elf pillok
CMPNE r1, #fsfile_Load ; Order !
EXIT NE ; VClear
; Must copy name away in case of reentrancy (very low lifetime object anyway)
Push "r2, r3"
ADR r0, OptFilenameString
MOV r1, r6
BL SGetLinkedString_excludingspaces ; Stop on CtrlChar/space
Pull "r2, r3" ; >>>a186<<<
EXIT VS
; Always print name. r1 -> copy of filename. r7 = OPT 1 value
MOV r8, #0 ; Print name in field of 10
20 LDRB r0, [r1], #1
CMP r0, #0 ; Now zero terminated
ADDNE r8, r8, #1 ; Another one bites the dust
SWINE XOS_WriteC ; WriteC preserves Z
BVS %FT95
BNE %BT20 ; Loop over all of name
; OPT 1, 2 or higher ?
CMP r7, #1 ; OPT 1,1 -> just filename, no trailers
BEQ %FT85
; Must now pad out in field of 10, 'cos here comes the info
26 CMP r8, #10 ; Must allow for name overflowing !
ADDLO r8, r8, #1 ; Finished spacing yet ?
SWILO XOS_WriteI+space
BVS %FT95
BLO %BT26
27 SWIVC XOS_WriteI+space ; Two spaces please in any case
SWIVC XOS_WriteI+space
BVS %FT95
CMP r7, #2 ; OPT 1, 2 -> Hex Load/Exec/Length
BNE %FT50 ; OPT 1, 4 and above identical to 3
30 MOV r0, r2 ; Load address in hex. Entry from below
BL HexR0LongWord
SWIVC XOS_WriteI+space
MOVVC r0, r3 ; Exec address in hex
BLVC HexR0LongWord
B %FT80 ; Print the length as well
50 ; Interpret the load and exec addresses suitably
CMP r2, r3 ; Load = exec -> BBC utility
BEQ %BT30
CMN r2, #&000100000 ; Undated ones are given in hex
BCC %BT30
Push "r2, r3"
MOV r2, r2, LSR #8 ; File type in bottom 12 bits
BL DecodeFileType
MOV r0, r2
BL PrintR0Chars
MOVVC r0, r3
BLVC PrintR0Chars
Pull "r2, r3"
SUB sp, sp, #64
SWIVC XOS_WriteI+space
MOVVC r0, sp
STRVC r3, [sp]
STRVCB r2, [sp, #4]
ADDVC r1, sp, #8 ; rv^
MOVVC r2, #64-8
SWIVC XOS_ConvertStandardDateAndTime
ADDVC r0, sp, #8
SWIVC XOS_Write0
ADD sp, sp, #64
; Exit for OPT 1, 2 and above - print a space, then the length
80 SWIVC XOS_WriteI+space
MOVVC r0, r4 ; Length in hex
BLVC HexR0LongWord
; Exit for OPT 1, 1
85 SWIVC XOS_NewLine ; Tidy up the output line
95 BLVS CopyErrorExternal
ADR r0, OptFilenameString ; Always deallocate string
BL SFreeLinkedArea
LDREQB r7, lowfile_opt1 ; Get original OPT 1 value
BLEQ ReportMonitor
EXIT
LTORG
......
......@@ -275,20 +275,11 @@ DoTheLoad
; Store the file's info now, while we still have them
[ StrongARM
Push r5
LDR r14, [fp, #4*3]
[ debugsarm
DREG r14, "R3 was read as being "
]
TST r14, #1<<31 ;Is the top bit set?
MOVEQ r5, #0
MOVNE r5, #1
STRB r5, codeflag
AND r14, r14, #&ff ;Get r14 to the 'ldrb' state
Pull r5
|
LDRB r14, [fp, #4*3]
MOV r14, r14, LSR #31 ; Is the top bit set? It's code then
STRB r14, codeflag
]
LDRB r14, [fp, #4*3]
TEQ r14, #0 ; LSB of exec = 0 -> load at specified
LDREQ r14, [fp, #4*2]
......@@ -709,13 +700,6 @@ int_DoLoadFile Entry "r0,r1,r2,r3,r5,r7"
BL TryGetFileClosed
EXIT VS
[ StrongARM
[ debugsarm
DLINE "int_DoLoadFile entered"
]
]
[ Use_fsfile_Load
LDR r14, [fscb, #fscb_info]
TST r14, #&ff
BEQ %FT10
......@@ -752,8 +736,7 @@ int_DoLoadFile Entry "r0,r1,r2,r3,r5,r7"
EXIT
10
; Load MultiFS file
]
; Load from a MultiFS file (or opted out with dontuseload)
[ debugosfile
DLINE "Doing Open etc to do load"
]
......@@ -806,6 +789,20 @@ int_DoLoadFile Entry "r0,r1,r2,r3,r5,r7"
; Close it, even if the GBPB gave an error
BL CloseThisFile
; Deal with monitor name
LDR r4, [sp, #1*4]
20
LDRB r14, [r4], #1
TEQ r14, #"."
MOVEQ r6, r4 ; Leaf
TEQ r14, #0
BNE %BT20
ADD r0, fp, #2*4
LDMIA r0, {r2-r4} ; Prefilled by DoTheLoad
LDRB r7, [fscb, #fscb_opt1]
BL ReportMonitor
EXIT
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
......@@ -837,16 +834,26 @@ int_DoSaveFile Entry "r0,r1,r2,r3,r5,r7,scb"
BLEQ SetErrorNoSelectedFilingSystem
EXIT VS
[ Use_fsfile_Save
; This section should be enabled to continue use of fsfile_Save
LDR r14, [fscb, #fscb_info]
TST r14, #&ff
BEQ %FT20
TST r14, #fsinfo_dontusesave
BEQ %FT20
]
BNE %FT20
; Save non-MultiFS file (traditional method)
TST r0, #object_directory
LDRNE r1, PassedFilename
addr r0, MagicErrorBlock_CreateFileOntoDir, NE
BLNE MagicCopyError
BLVC TryGetFileClosed
MOVVC r0, #fsfile_Save
BLVC CallFSFile_Given
; *save into a MultiFS area - do a create, openup, GBPB, Close sequence
EXIT
20
; Save into a MultiFS area (or opted out with dontusesave)
; Do a create, openup, GBPB, Close sequence
MOV r7, #fsfile_Create
BL int_DeleteCreateFileOp
......@@ -894,20 +901,6 @@ int_DoSaveFile Entry "r0,r1,r2,r3,r5,r7,scb"
EXIT
[ Use_fsfile_Save
; This section should be enabled to continue use of fsfile_Save
20
TST r0, #object_directory
LDRNE r1, PassedFilename
addr r0, MagicErrorBlock_CreateFileOntoDir, NE
BLNE MagicCopyError
BLVC TryGetFileClosed
MOVVC r0, #fsfile_Save
BLVC CallFSFile_Given
EXIT
]
LTORG
END