Commit 70efb18b authored by Robert Sprowson's avatar Robert Sprowson
Browse files

*COUNT and *COPY summaries cope with > 32 bit totals.

Delete dead macro.
Ammend OS_FSControl 28 API to aloow report of 64 bit results.
On failing to get any memory at all for *COPY an attempt is made to grab an 'excessive' amount of RMA to get an error message, but this was only requesting 32MB which is now quite feasible - now asks for 2GB.

Version 2.73. Tagged as 'FileSwitch-2_73'
parent 1c2087e9
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "2.72"
Module_Version SETA 272
Module_MajorVersion SETS "2.73"
Module_Version SETA 273
Module_MinorVersion SETS ""
Module_Date SETS "27 Nov 2011"
Module_ApplicationDate SETS "27-Nov-11"
Module_ComponentName SETS "FileSwitch"
Module_ComponentPath SETS "castle/RiscOS/Sources/FileSys/FileSwitch"
Module_FullVersion SETS "2.72"
Module_HelpVersion SETS "2.72 (27 Nov 2011)"
Module_FullVersion SETS "2.73"
Module_HelpVersion SETS "2.73 (27 Nov 2011)"
END
/* (2.72)
/* (2.73)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 2.72
#define Module_MajorVersion_CMHG 2.73
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 27 Nov 2011
#define Module_MajorVersion "2.72"
#define Module_Version 272
#define Module_MajorVersion "2.73"
#define Module_Version 273
#define Module_MinorVersion ""
#define Module_Date "27 Nov 2011"
......@@ -18,6 +18,6 @@
#define Module_ComponentName "FileSwitch"
#define Module_ComponentPath "castle/RiscOS/Sources/FileSys/FileSwitch"
#define Module_FullVersion "2.72"
#define Module_HelpVersion "2.72 (27 Nov 2011)"
#define Module_LibraryVersionInfo "2:72"
#define Module_FullVersion "2.73"
#define Module_HelpVersion "2.73 (27 Nov 2011)"
#define Module_LibraryVersionInfo "2:73"
......@@ -21,7 +21,7 @@ util_topconfirm * 1 :SHL: 31 ; Top level confirmation
; Bits in the bitset used by utilities: external defs
util_peekdest * 1 :SHL: 14 ; Quick peek at dest before loading src ?
util_userbuffer * 1 :SHL: 13 ; Use punter's buffer as well as apl/rma ?
util_userbuffer * 1 :SHL: 13 ; Use punter's buffer during operation ?
util_newer * 1 :SHL: 12 ; Copy files if newer (or binary) ?
util_structureonly * 1 :SHL: 11 ; Structure only (no files) ?
util_restamp * 1 :SHL: 10 ; Restamp datestamped files ?
......@@ -1082,7 +1082,7 @@ CopyFile Entry
CMP r4, #0 ; Now failed totally? >>>a186<<<
MOVEQ r0, #ModHandReason_Claim ; VClear
MOVEQ r3, #32*1024*1024 ; So make ludicrous claim to get
MOVEQ r3, #&80000000 ; So make ludicrous claim to get
SWIEQ XOS_Module ; a reasonable error message
BLVS CopyErrorExternal
EXIT VS
......@@ -1365,7 +1365,7 @@ CopyDirectory Entry
BL SReadTime ; Stamped now
MOV r4, #35 ; Sensible n entries (not random !)
; Will give &400 dirs on Net
; Ignored by ADFS
; Ignored by FileCore
BL Copy_PromptDest
BLVC CallFSFile_Given ; Doesn't corrupt util_attr
BLVC CopyDirectory_VerboseCDir
......@@ -1390,28 +1390,27 @@ CopyDirectory Entry
BL CallFSFile_Given
EXIT VS
50
; Copy contents of dir, saving info on stack
50 ; Copy contents of dir, saving info on stack
LDR r1, util_totalsize ; Save total so far this level
Push r1
ADR r1, util_totalsize ; Save total so far this level
LDMIA r1, {r1, r14}
Push "r1, r14"
BL Util_IntoDirectory
[ debugcopy
DREG sp, "Leaving CopyDirectory; sp = "
]
BL CopyWildObject
[ debugcopy
DREG sp, "Back in CopyDirectory; sp = "
]
BLVC CopyWildObject
BL Util_OutOfDirectory
Pull r2 ; Restore size copied at this level
STR r2, util_totalsize
ADDVS r2, r2, r1 ; add here if error
STRVS r2, util_totalsize
EXIT VS
Pull "r3, r4" ; Restore size copied at this level
ADR r14, util_totalsize
STMVCIA r14, {r3-r4}
BVC %FT60
ADDS r3, r3, r1
ADC r4, r4, r2 ; add here if error
STMIA r14, {r3-r4}
SETV ; Ensure V still set
EXIT
60
; Contents copied. Shall we (or can we) delete the source ?
CMP r0, #0 ; Did we skip any in there ? VClear
......@@ -1773,26 +1772,25 @@ CopyDirectory_Confirm ALTENTRY
; Out VS: error
CopyFile_Verbose Entry "r0, r1, r2, r9"
BL Util_IncrementFiles_TestVerbose
ADR r1, fsw_file_copied_as
ADR r2, fsw_file_moved_as
CopyFile_Verbose Entry "r0, r2, r3-r5, r9"
30 LDR r9, util_length ; Always increment size copied
LDR r14, util_totalsize
ADD r14, r14, r9
STR r14, util_totalsize
LDR r9, util_length ; Always increment size copied
ADR r5, util_totalsize
LDMIA r5, {r3-r4}
ADDS r3, r3, r9
ADC r4, r4, #0
STMIA r5, {r3-r4}
BL Util_IncrementFiles_TestVerbose
EXIT EQ ; EQ -> ~verbose, so leave
LDR r14, util_bitset
TST r14, #util_deletesrc
MOVEQ r2, r1
BL Util_PrintNameNL
ADREQ r2, fsw_file_copied_as
ADRNE r2, fsw_file_moved_as
99 BLVS CopyErrorExternal
BL Util_PrintNameNL
BLVS CopyErrorExternal
EXIT
......@@ -1810,19 +1808,34 @@ fsw_Created_directory_space DCB "CC19", 0 ; Created directory %1
; CopyDirectory_Verbose
; =====================
; Copied the directory, so print
; Copied the directory; always print info
; In util_length = size of dir copied. To be added to totalsize
; In util_popsize = size of dir copied. To be added to totalsize
; Out VS: error
CopyDirectory_Verbose ALTENTRY
CopyDirectory_Verbose Entry "r0, r2, r3-r5, r9-r10"
ADR r9, util_popsize ; Always increment size copied
LDMIA r9, {r9-r10}
ADR r5, util_totalsize
LDMIA r5, {r3-r4}
ADDS r3, r3, r9
ADC r4, r4, r10
STMIA r5, {r3-r4}
BL Util_IncrementDir_TestVerbose
EXIT EQ ; EQ -> ~verbose, so leave
LDR r14, util_bitset
TST r14, #util_deletesrc
ADREQ r2, fsw_directory_copied_as
ADRNE r2, fsw_directory_moved_as
ADR r1, fsw_directory_copied_as
ADR r2, fsw_directory_moved_as
B %BT30
BL Util_PrintName64
SWIVC XOS_NewLine
BLVS CopyErrorExternal
EXIT
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;
......
......@@ -66,11 +66,21 @@ CountEntry NewSwiEntry "r0-r1, r4-r10",utils
BL Util_FilesDone ; Say '65 files counted, total 1234 bytes'
BLVS CopyErrorExternal
BVS %FT99
95
ADR r2, util_totalsize
LDMIA r2, {r2-r3}
95 LDRVC r2, util_totalsize
LDRVC r3, util_nfiles
LDR r14, util_bitset
TST r14, #util_userbuffer
LDRNE r14, [fp, #6 * 4] ; Get r8in
STMNEIA r14, {r2-r3} ; Full 64 bit result if user supplies buffer
99 SwiExit
TEQ r3, #0 ; When overflowed a 32 bit result at least guarantee
MOVNE r2, #&7FFFFFFF ; some number that is 'lots' rather than modulo 4G bytes
LDR r3, util_nfiles
99
SwiExit
fsw_files_counted
DCB "Cc4", 0 ; 0
......@@ -269,17 +279,24 @@ CountDirectory Entry
; Count contents of dir, saving quite a bit of info on stack
LDR r1, util_totalsize ; How much so far this level
Push r1
ADR r1, util_totalsize ; Save total so far this level
LDMIA r1, {r1, r14}
Push "r1, r14"
BL Util_IntoDirectory
BLVC CountWildObject
BL Util_OutOfDirectory
Pull r2 ; Restore size copied at this level
ADD r2, r2, r1 ; Add here because CountDir_Verbose
STR r2, util_totalsize ; mustn't do it (verbose problems)
Pull "r3, r4" ; Restore size counted at this level
ADR r14, util_totalsize
STMVCIA r14, {r3-r4}
BVC %FT10
ADDS r3, r3, r1
ADC r4, r4, r2 ; add here if error
STMIA r14, {r3-r4}
SETV ; Ensure V still set
EXIT
10
BLVC CountDirectory_Verbose ; Tell them count dir complete
EXIT
......@@ -336,25 +353,28 @@ CountDirectory_ConfirmAll ALTENTRY
; Counted the file, so print copied info if being verbose. nfiles++
; In util_length = size of file encountered. To be added to totalsize
; Out VS: error
fsw_file_counted DCB "Cc2", 0
fsw_directory_counted DCB "Cc3", 0
ALIGN
CountFile_Verbose Entry "r0, r2, r9"
CountFile_Verbose Entry "r0, r2, r3-r5, r9"
LDR r9, util_length ; Always increment size copied
LDR r14, util_totalsize
ADD r14, r14, r9
STR r14, util_totalsize
LDR r9, util_length ; Always increment size counted
ADR r5, util_totalsize
LDMIA r5, {r3-r4}
ADDS r3, r3, r9
ADC r4, r4, #0
STMIA r5, {r3-r4}
BL Util_IncrementFiles_TestVerbose
EXIT EQ ; EQ -> ~verbose
EXIT EQ ; EQ -> ~verbose, so leave
ADR r2, fsw_file_counted
30
BL Util_PrintNameNL
BLVS CopyErrorExternal
EXIT
......@@ -366,19 +386,29 @@ CountFile_Verbose Entry "r0, r2, r9"
; Counted the directory; always print info
; In util_popsize = size of dir counted. To be added to totalsize
; Out VS: error
CountDirectory_Verbose ALTENTRY
CountDirectory_Verbose Entry "r0, r2, r3-r5, r9-r10"
BL Util_IncrementDir_TestVerbose ; Ignore verbose flag here !!!
ADR r9, util_popsize ; Always increment size counted
LDMIA r9, {r9-r10}
ADR r5, util_totalsize
LDMIA r5, {r3-r4}
ADDS r3, r3, r9
ADC r4, r4, r10
STMIA r5, {r3-r4}
LDR r14, util_bitset ; If ~print then exit (must have added
TST r14, #util_printok ; totalsize in CountDirectory). Don't
EXIT EQ ; change without knowing why this is.
BL Util_IncrementDir_TestVerbose
EXIT EQ ; EQ -> ~verbose, so leave
LDR r9, util_length
ADR r2, fsw_directory_counted
B %BT30
BL Util_PrintName64
SWIVC XOS_NewLine
BLVS CopyErrorExternal
EXIT
] ; hascount
......@@ -426,7 +456,8 @@ Util_CommonStart Entry
STR r14, util_ndir
STR r14, util_nfiles
STR r14, util_nskipped
STR r14, util_totalsize
STR r14, util_totalsize + 0
STR r14, util_totalsize + 4
BL Process_WildPathname
EXIT VS
......@@ -464,7 +495,7 @@ Util_CommonStart Entry
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; Prints tagged string with %0=util_nfiles in decimal and %1=util_totalsize
; in convert-file-size. NewLine appended
; in comma separated. NewLine appended
; In r1 = address of tag list for (0, 1, 2, many files)
; tagged string has %0 = number of files and %1 for bytes message
......@@ -472,16 +503,20 @@ Util_CommonStart Entry
; Out VS: r0 -> error
; VC: r0 corrupt
Util_FilesDone Entry "r0-r5", 96
Util_FilesDone Entry "r0-r5", 112
LDR r0, util_nfiles
ADR r0, util_nfiles
MOV r1, sp
MOV r2, #16
SWI XOS_ConvertCardinal4
LDRVC r0, util_totalsize
ADDVC r1, sp, #16
MOVVC r2, #16
SWIVC XOS_ConvertCardinal4
MOV r2, #16 ; Worst 10^9 plus 3 commas
MOV r3, #4 ; 32 bits
MOV r4, #ConvertToPunctCardinal
SWI XOS_ConvertVariform
ADRVC r0, util_totalsize
ADDVC r1, sp, #16 ; Don't overwrite last conversion
MOVVC r2, #32 ; Worst 10^18 plus 6 commas
MOVVC r3, #8 ; 64 bits
MOVVC r4, #ConvertToPunctCardinal
SWIVC XOS_ConvertVariform
BVS %FT90
[ debugutil
......@@ -489,10 +524,14 @@ Util_FilesDone Entry "r0-r5", 96
]
ADR r0, bytetags
LDR r1, util_totalsize
ADR r1, util_totalsize
LDMIA r1, {r1, r14}
TEQ r14, #0
MOVNE r1, #-1 ; That's 'many' by anyone's measure
BL Util_PluralAdvanceTag
ADD r1, sp, #32
MOV r2, #Proc_LocalStack - 32
ADD r1, sp, #48
MOV r2, #Proc_LocalStack - 48
ADD r4, sp, #16
BL message_lookup21_into_buffer
BVS %FT90
......@@ -507,7 +546,7 @@ Util_FilesDone Entry "r0-r5", 96
BL Util_PluralAdvanceTag
MOV r4, sp
ADD r5, sp, #32
ADD r5, sp, #48
[ debugutil
DSTRING r0, "About to write with tag "
DSTRING r4, "p0:"
......@@ -750,11 +789,17 @@ Util_AppendGivenLeafToDir ALTENTRY
; r7 = record of file to substitute into %0
; r8 = record of file to substitute into %1
; r9 = size to substitute into %2
; r10= high word of size for 64 bit version
; Out VC: r0 corrupt
; VS: r0 -> error block
Util_PrintName Entry "r1-r7, fscb"
ASSERT fscb = r10
MOV r10, #0
B %FT05
Util_PrintName64 ALTENTRY
[ debugutil
DLINE "Util_PrintName",cc
......@@ -764,6 +809,9 @@ Util_PrintName Entry "r1-r7, fscb"
DREG r11, " r11 in is ",cc
DREG r12, " r12 in is "
]
05
; Keep length for later conversion
Push "r9-r10"
; Get the parameters of the name
LDMIA r7, {r1, r6, fscb}
......@@ -792,15 +840,19 @@ Util_PrintName Entry "r1-r7, fscb"
MOV r5, sp
10
SUB sp, sp, #16
MOV r0, r9
MOV r1, sp
Push "r3-r4"
MOV r0, r7 ; Reach up to r9,r10
ADD r1, sp, #2 * 4 ; Temp buffer
MOV r2, #16
SWI XOS_ConvertFileSize
MOV r3, #8 ; 64 bit
MOV r4, #ConvertToFileSize
SWI XOS_ConvertVariform
Pull "r3-r4"
BVS %FT90
MOV r6, sp
LDR r0, [r7, #1*4] ; r2 in
LDR r0, [r7, #3*4] ; r2 in
[ debugutil
DSTRING r0,"about to tag:"
DSTRING r4,"p0:"
......@@ -810,8 +862,8 @@ Util_PrintName Entry "r1-r7, fscb"
BL message_write03
90
; Drop the stack frame
MOV sp, r7
; Drop the stack frame and r9/r10
ADD sp, r7, #2 * 4
[ debugutil
DREG r8, " r8 out is ",cc
DREG r9, " r9 out is ",cc
......@@ -820,6 +872,7 @@ Util_PrintName Entry "r1-r7, fscb"
DREG r12, " r12 out is "
]
EXIT
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
;
; Util_PrintNameNL
......@@ -888,7 +941,8 @@ Util_IntoDirectory ROUT
STRNE r14, [r8, #copy_leafname]
MOV r14, #0
STR r14, util_nskipped ; Nothing skipped at this level
STR r14, util_totalsize ; Nothing copied at this level
STR r14, util_totalsize + 0 ; Nothing copied at this level
STR r14, util_totalsize + 4
LDMIA r7, {r1,r6,fscb}
BL EnsureCanonicalObject
......@@ -911,14 +965,14 @@ Util_IntoDirectory ROUT
;
; Out Contexts unnested, stack freed
; r0 = old value of util_nskipped
; r1 = old value of util_totalsize
; r1,r2 = old value of util_totalsize
Util_OutOfDirectory
Entry "r2-r6,r9-r10"
Entry "r3-r6,r9-r10"
TEQ r8, #0
ADDEQ r14, sp, #8*4 + 9*4
ADDNE r14, sp, #8*4 + 13*4
ADDEQ r14, sp, #7*4 + 9*4
ADDNE r14, sp, #7*4 + 13*4
LDMNEDB r14!, {r0-r3}
STRNE r0, [r8, #copy_dirprefix]
STRNE r1, [r8, #copy_leafname]
......@@ -939,8 +993,10 @@ Util_OutOfDirectory
STR r9, util_nskipped
STR r10, [r7, #copy_fscb]
LDR r1, util_totalsize
STR r1, util_length
ADR r1, util_totalsize
LDMIA r1, {r1-r2}
ADR r14, util_popsize
STMIA r14, {r1-r2} ; Verbose mode needs size of popped dir
Pull "$Proc_RegList.,r14"
ADDEQ sp, sp, #9*4
......
......@@ -306,14 +306,6 @@ $label
B$cond FileSwitchExit
MEND
[ False ; Probably won't ever need this one again
MACRO
$label LethalSwiExit $cond
$label PullSwiEnv $cond
B$cond LethalFileSwitchExit
MEND
]
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; Record for copy block
......@@ -464,9 +456,9 @@ StaticName_length * 1024 ; Limits size of input filename, path etc.
; size of buffer for enumerating dirs has been increased to allow filenames up to 256 characters
[ UseDynamicAreas
copylocalframesize * &208 ; Change this if changing ANY frame size
copylocalframesize * &210 ; Change this if changing ANY frame size
|
copylocalframesize * &200 ; Change this if changing ANY frame size
copylocalframesize * &208 ; Change this if changing ANY frame size
]
^ -copylocalframesize, fp
......@@ -535,6 +527,7 @@ util_endtime # 8 ; Top 3 bytes cleared to zero when used
util_ndir # 4 ; Global to util operation
util_nfiles # 4
util_totalsize # 8 ; 64 bit totals
util_popsize # 8 ; Size of last directory popped
util_bitset # 4 ; Localled in dir recursion
util_direntry # 4
......@@ -1632,11 +1625,12 @@ FileSwitchExit ROUT
Pull lr, EQ
BICEQS pc, lr, #V_bit ; Return to punter, NZC flags intact
]
; Fall through for NE
; .............................................................................
; In r14 -> error block
LethalFileSwitchExit
FileSwitchErrorExit
MOV r0, r14 ; r0 -> error block
[ No26bitCode
......@@ -1654,7 +1648,7 @@ LethalFileSwitchExit
FileSwitchExitSettingC ROUT
TEQ r14, #0 ; Careful to preserve C !
BNE LethalFileSwitchExit
BNE FileSwitchErrorExit
[ No26bitCode
CLRPSR V_bit, lr ; clear V carefully, preserving C
......
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