Commit e8206b6d authored by Robert Sprowson's avatar Robert Sprowson

Comment clarifications and tidy up

Lots of missing function entry/exit register comments added/corrected.
Drive number extraction all now (32-3) to help see where changes are needed in future for more drives.
Removed redundant Tools/basic/BASH (see Test/BASH).
InitDieSvc/BigDirCode/DebugOpts/FileCore25: Comments
FileCore05: Use of DREG with no preceding text
FileCore15: Use of 'mess' with too few arguments
FileCore20: Fetching of NZones made consistent, 3 bit drive number made consistent
FileCore30/FileCore32: Simplify debug switches, driver number extraction, comments
FileCore31: Fetching of NZones made consistent
FileCore40/FileCore33/FileCore35: NZones, function arguments commented
FileCore45: Function arguments commented, debug reinstated
FileCore70/FileCore60: Function arguments commented, drive number extraction
FormSWIs: NZones
Identify/GenSWIs: Drive number extraction, debug tidy
MyMacros: Unused Align16 removed. Hacked DebugError macro to not try loading from internal error numbers all the time, which are often not aligned, or not in sensible memory places

Relatively few code changes, no expected issues.


Version 3.55. Tagged as 'FileCore-3_55'
parent 12326543
| Copyright 1996 Acorn Computers Ltd
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
wimpslot -min 800k
amu -f amu.makefile -k %*0
| Copyright 1996 Acorn Computers Ltd
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
fsbash scsi::jroach_a.$.testdir.log 20000 scsi::jroach_a.$.testdir.testdir
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "3.54"
Module_Version SETA 354
Module_MajorVersion SETS "3.55"
Module_Version SETA 355
Module_MinorVersion SETS ""
Module_Date SETS "12 Nov 2012"
Module_ApplicationDate SETS "12-Nov-12"
Module_Date SETS "21 Feb 2013"
Module_ApplicationDate SETS "21-Feb-13"
Module_ComponentName SETS "FileCore"
Module_ComponentPath SETS "castle/RiscOS/Sources/FileSys/FileCore"
Module_FullVersion SETS "3.54"
Module_HelpVersion SETS "3.54 (12 Nov 2012)"
Module_FullVersion SETS "3.55"
Module_HelpVersion SETS "3.55 (21 Feb 2013)"
END
/* (3.54)
/* (3.55)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 3.54
#define Module_MajorVersion_CMHG 3.55
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 12 Nov 2012
#define Module_Date_CMHG 21 Feb 2013
#define Module_MajorVersion "3.54"
#define Module_Version 354
#define Module_MajorVersion "3.55"
#define Module_Version 355
#define Module_MinorVersion ""
#define Module_Date "12 Nov 2012"
#define Module_Date "21 Feb 2013"
#define Module_ApplicationDate "12-Nov-12"
#define Module_ApplicationDate "21-Feb-13"
#define Module_ComponentName "FileCore"
#define Module_ComponentPath "castle/RiscOS/Sources/FileSys/FileCore"
#define Module_FullVersion "3.54"
#define Module_HelpVersion "3.54 (12 Nov 2012)"
#define Module_LibraryVersionInfo "3:54"
#define Module_FullVersion "3.55"
#define Module_HelpVersion "3.55 (21 Feb 2013)"
#define Module_LibraryVersionInfo "3:55"
......@@ -86,7 +86,7 @@ SanityCheckBigDirHeader ROUT
]
LDR r1, SBProven ; get "SBPr"
LDR lr, [r5, #BigDirStartName] ; and get StarName from Dir
LDR lr, [r5, #BigDirStartName] ; and get StartName from Dir
TEQS r1,lr ; is it broke?
[ DebugX
BEQ %FT01
......@@ -1492,7 +1492,7 @@ GrowBigDir ROUT
LDR R5, [SP, #5*4]
SUB R4, R6, R5
ADD R4, R4, #BigDirMinSize ; size required
BL DiscAddToRec ; get disc record
BL DiscAddToRec ;(R3->LR) get disc record
LDR R7, [LR, #DiscRecord_Log2SectorSize] ; sector size
LDR LR, [LR, #DiscRecord_BigMap_ShareSize] ; share size
ADD R7, R7, LR
......@@ -1574,7 +1574,7 @@ GrowBigDir ROUT
BL ReadIndDiscAdd ; (R4->LR)
DREG LR, "Ind disc add of entry:"
]
BL ReadLen ; (R4->LR)
BL ReadLen ; (R3,R4->LR)
MOV R10, LR ; length to claim
MOV R11,#fsfile_Save ; reason code to ClaimFreeSpace
LDR R5, [SP, #5*4] ; get the dir
......@@ -1912,7 +1912,7 @@ GrowBigDir ROUT
[ DebugXg
DLINE "It's the root dir - updating the FS map"
]
BL DiscAddToRec ; get disc record
BL DiscAddToRec ;(R3->LR) get disc record
STR R7, [LR, #DiscRecord_BigDir_RootDirSize] ; store the root dir size in the disc record
......@@ -1952,7 +1952,7 @@ GrowBigDir ROUT
B %BT60
75
BL WriteLen ; write the length
BL WriteLen ;(R0,R3,R4) write the length
70
BL WriteDir ; write the dir
......@@ -2179,7 +2179,7 @@ ShrinkBigDir ROUT
; alter the size in the disc record
BL DiscAddToRec ; get disc record
BL DiscAddToRec ;(R3->LR) get disc record
STR R7, [LR, #DiscRecord_BigDir_RootDirSize] ; store the root dir size in the disc record
......@@ -2216,7 +2216,7 @@ ShrinkBigDir ROUT
85
; found dir entry, write updated length
MOV R0, R7
BL WriteLen
BL WriteLen ;(R0,R3,R4)
BL WriteDir
95
......@@ -2304,7 +2304,7 @@ DoOsFunRenameBigDir ROUT
]
BL ReadIntAtts ;(R3,R4->LR)
MOV R11,LR
BL ReadLen ;(R4->LR)
BL ReadLen ;(R3,R4->LR)
MOV R10,LR
MOV R2, R9
BL ReallyShared ;(R2-R5->Z)
......@@ -3055,12 +3055,12 @@ ReturnSpaceNotFudged ROUT
TEQS R6, #0
BNE %FT90 ;IF not returning whole obj then done
Push "R6"
LDR R6, [SP, #6*4]
LDR R6, [SP, #6*4] ;recover entry R4
BL ReallySharedNotFudged ;(R2-R6->Z)
Pull "R6"
BEQ %FT90 ;IF frag shared then done
BIC R2, R2, #&FF
BIC R2, R2, #&FF
15
BL CritInitReadNewFs ;(->R10,R11)
......@@ -3082,7 +3082,6 @@ ReturnSpaceNotFudged ROUT
CMPS R6, R7 ;loop until whole file returned
BLT %BT20 ;LT rather than LO as R7 may be -ve
BL InvalidateFragCache
90
MOV R0, #0
95
......
......@@ -75,10 +75,10 @@ ScatterListNegThresh * &10000
GBLL FixTruncateOnBigDiscs
FixTruncateOnBigDiscs SETL {TRUE}
GBLL RO3Paths
GBLL RO3Paths ; Assume fileswitch does path resolution
RO3Paths SETL {TRUE}
GBLL ReadMapDuringIdentify
GBLL ReadMapDuringIdentify ; Save time by prereading the map
ReadMapDuringIdentify SETL {TRUE}
GBLL Dev ; Extra code to do postmortem when things go bang
......@@ -141,9 +141,9 @@ DebugH switch {FALSE} ; terse file cache
DebugI switch {FALSE} ; terse FIQ claim/release
DebugJ switch {FALSE} ; file cache consistency checks
DebugK switch {FALSE} ; setting of Interlocks
DebugL switch {TRUE} ; Mounting/Identifying/Dismounting/Verifying
DebugL switch {FALSE} ; Mounting/Identifying/Dismounting/Verifying
DebugLi switch {FALSE} ; Changes to DiscId information in disc records
DebugLm switch {FALSE} ; matching disc agianst other records
DebugLm switch {FALSE} ; matching disc against other records
DebugM switch {FALSE} ; MultiFS extensions
DebugMt switch {FALSE} ; MultiFS extensions (terse)
DebugN switch {FALSE} ; Disc insertion / request for insertion thread
......
......@@ -640,8 +640,8 @@ SortPair
BHS %FT02
LDMIA R0!, {R2, R3}
DREG R3, "",cc
DREG R2, ""
DREG R3, " ",cc
DREG R2
B %BT01
02
Pull "R0,R1,R2,R3"
......@@ -711,8 +711,8 @@ SortPair
BHS %FT02
LDMIA R0!, {R2, R3}
DREG R3, "",cc
DREG R2, ""
DREG R3, " ",cc
DREG R2
B %BT01
02
Pull "R0,R1,R2,R3"
......
......@@ -246,7 +246,7 @@ ExceptionCommon
DREG R13
mess ,NL
mess ,,NL
Push "r0-r2"
MOV r0, #6
MOV r1, #0
......
......@@ -155,7 +155,6 @@ CheckDriveNumber ROUT
CMP r1, lr
[ Debug4
BLO %FT01
DREG r1, "Bad drive specified:"
01
]
......@@ -784,7 +783,7 @@ MountDiscOnDrive ROUT
[ DebugL
DREG r2, "Setting RootDir from "
]
MOV lr, r2, ASL #32-3
MOV lr, r2, ASL #(32-3)
STR lr, [r5, #DiscRecord_Root]
; Fill in old density
......@@ -1111,10 +1110,12 @@ AdjustFsSpace ROUT
Push "r0,r2,r3,r7-r10,lr"
; Work out the map's size
LDRB r9, [r5, #DiscRecord_NZones]
[ BigMaps
LDRB r9, [r5, #DiscRecord_NZones]
LDRB r7, [r5, #DiscRecord_BigMap_NZones2]
ADD r9, r9, r7, LSL #8
|
LDRB r9, [r5, #DiscRecord_NZones]
]
LDRB r7, [r5, #DiscRecord_Log2SectorSize]
MOVS r8, r9, LSL r7
......@@ -1305,15 +1306,12 @@ ReadFsMap ROUT
LDRB r7, [r5, #DiscRecord_BigMap_NZones2]
LDRB r9, [r5, #DiscRecord_NZones]
ADD r9, r9, r7, LSL #8
; Determine old/new-ness of map by number of zones recorded
LDRB r7, [r5, #DiscRecord_Log2SectorSize]
|
; Keep DiscRecord_Log2SectorSize in r7
LDRB r9, [r5, #DiscRecord_NZones]
]
LDRB r7, [r5, #DiscRecord_Log2SectorSize]
; Determine old/new-ness of map by number of zones recorded
LDRB r9, [r5, #DiscRecord_NZones]
]
TEQ r9, #0
BNE %FT30
......@@ -1386,7 +1384,7 @@ FileType_FileCoreFloppyDiscStore
; Location &200 (L_Root) on old dir discs, &400 (D_Root) on new dir discs
MOVEQ r0, #L_Root
MOVNE r0, #D_Root
ORR r0, r0, r2, ASL #32-3
ORR r0, r0, r2, ASL #(32-3)
[ DebugL
DREG r0, "Setting RootDir to (FileCore20, 1394) "
]
......@@ -1443,7 +1441,7 @@ FileType_FileCoreFloppyDiscStore
BL MapDiscAdd
BIC r2, r2, #DiscBits
ORR r2, r2, r1, ASL #32-3
ORR r2, r2, r1, ASL #(32-3)
MOV r1, #DiscOp_CachedReadSecs
[ DynamicMaps
LDR r3, [r4, #DrvsFsMapAddr]
......@@ -1466,7 +1464,7 @@ FileType_FileCoreFloppyDiscStore
ADD r2, r2, r9, ASL r7 ; MapDiscAdd + Zones<<DiscRecord_Log2SectorSize
]
BIC r2, r2, #DiscBits
ORR r2, r2, r1, ASL #32-3
ORR r2, r2, r1, ASL #(32-3)
MOV r1, #DiscOp_CachedReadSecs
[ DynamicMaps
LDR r3, [r4, #DrvsFsMapAddr]
......@@ -1516,7 +1514,7 @@ FileType_FileCoreFloppyDiscStore
STRB lr, [r5, #DiscRecord_ZoneSpare+1]
LDR r0, [r0, #DiscRecord_Root]
BIC r0, r0, #DiscBits
ORR r0, r0, r2, ASL #32-3
ORR r0, r0, r2, ASL #(32-3)
[ DebugL
DREG r0, "Setting RootDir to (FileCore20, 1509) "
]
......@@ -1658,7 +1656,7 @@ StartupNonFileCoreDisc ROUT
; Set up RootDir to be start of disc
LDR lr, [sp, #2*4]
MOV lr, lr, ASL #32-3
MOV lr, lr, ASL #(32-3)
[ DebugL
Push "r5"
MOV r5, lr
......@@ -1782,7 +1780,7 @@ Mount
]
MOV r2, #DefectListDiscAdd
ORR r2, r2, r1, ASL #32-3
ORR r2, r2, r1, ASL #(32-3)
EOR r2, r2, #bit31
MOV r3, #ScratchSpace
MOV r4, #SzDefectList
......@@ -2215,7 +2213,7 @@ FindDiscRec ROUT
[ Debug4
DLINE "Result Disc Disc Rec - Leave FindDiscRec"
DREG R0,"",cc
DREG R0,,cc
DREG R2," ",cc
DREG R3," "
]
......
......@@ -62,7 +62,7 @@ FindDirCommon
[ DebugC
BL SanityCheckDirCache
]
; If disc isn't FileCore comlain bitterly
; If disc isn't FileCore complain bitterly
BL DiscMustBeFileCore ;(R3->V,R0)
BVS %FT95
......
......@@ -76,14 +76,7 @@ MoveData
DREG R2
DREG R3
DREG R4
mess ,NL
]
[ BigDisc
[ Debug
DLINE "********** MoveData **************"
]
;01
; B %BT01
mess ,,NL
]
LDMIA SP, {R6-R10}
......@@ -161,7 +154,7 @@ MoveData
DREG R3
DREG R4
DREG R0,VS
mess ,NL
mess ,,NL
]
STRVS R0, [SP]
Pull "R0-R11,PC"
......@@ -233,7 +226,7 @@ ReadHex64 ROUT
B %BT10
90
[ Debug
[ DebugQ
DREG R1, "L.S. word"
DREG R2, "M.S. word"
]
......@@ -263,11 +256,10 @@ FindBuffer ROUT
Push "R0-R3,R4-R11,LR"
[ DebugD
mess ,"options |min buf |max buf |blk size - FindBuffer",NL
DREG R0
DREG R1
DREG R2
DREG R3
mess ,NL
DREG R0, " ", cc
DREG R1, " ", cc
DREG R2, " ", cc
DREG R3, " "
]
BL ReturnBuffer ;return any chunks still claimed
Pull "R4-R7"
......@@ -384,7 +376,7 @@ FindBuffer ROUT
DREG R0
DREG R1
DREG R2
mess ,NL
mess ,,NL
]
Pull "R4-R11,PC"
......@@ -896,9 +888,9 @@ FindErrBlock ROUT
LDR r0, [r0, #8]
|
LDR r1, [r0, #4]
MOV r0, r1, LSR #29 ; drive bits
MOV r0, r1, LSR #(32-3) ; drive bits
EOR r0,r0,#4
EOR r0,r0,#4 ; external to internal
DrvRecPtr lr,r0
LDRB lr, [lr,#DrvsDisc]
AND lr, lr, #7
......@@ -1308,7 +1300,7 @@ InternalFromParent
60 BIC R0, R0, #ExternalErrorBit+DiscErrorBit
LDRB R2, [R0, #0]
LDR R4, [R0, #4]
MOV R3, R4, LSR #29
MOV R3, R4, LSR #(32-3)
ORR R2, R3, R2, LSL #8
BIC R4, R4, #DiscBits
EOR LR, R3, #4
......@@ -1542,9 +1534,6 @@ OnlySysXOS_Heap ;(R0,R2,R3->R0-R3,V)
BL OnlyExternal
LDR R1,SysHeapStart
SWI XOS_Heap
[ Debug
DebugError "XOS_Heap on system heap error:"
]
BL Internal
Pull "R1,PC"
......@@ -1553,9 +1542,6 @@ OnlyXOS_Module
Push "LR"
BL OnlyExternal
SWI XOS_Module
[ Debug
DebugError "XOS_Module error:"
]
B InternalCommon
......
......@@ -1284,10 +1284,12 @@ Stacked4d * 3*4
MOV R0, R0, LSR LR
MOV R0, R0, LSR #3
ADD R0, R0, #1
LDRB LR, [R10,#ZoneHead+DiscRecord_NZones]
[ BigMaps
LDRB LR, [R10,#ZoneHead+DiscRecord_NZones]
LDRB R11, [R10, #ZoneHead+DiscRecord_BigMap_NZones2] ; R11 safe cos InitZoneObj will hit it
ADD LR, LR, R11, LSL #8
|
LDRB LR, [R10,#ZoneHead+DiscRecord_NZones]
]
CMPS R0, LR
MOVHSS R0, #0
......
......@@ -228,7 +228,7 @@ CompactZone ROUT
CMPS R0, LR
[ DebugF
BLO %FT01
DREG R7, "gab big enough created: "
DREG R7, "gap big enough created: "
01
]
15 BHS %FT94 ;no more to do if gap big enough
......@@ -255,7 +255,7 @@ CompactZone ROUT
STMIA R6!,{R4,R5,R7,R8,R11,LR}
[ DebugF
DLINE "Pre Frag.Pre Id .Post Len.Post Id .PostFrag.Gap Off"
DREG R4,"",cc
DREG R4,,cc
DREG R5," ",cc
DREG R7," ",cc
DREG R8," ",cc
......@@ -905,7 +905,7 @@ Stacked0a * 9*4
DREG R6
DREG R7
DREG R8
mess ,NL
mess ,,NL
]
CMPS R8,#0
BLE %FT30 ;no move to add
......@@ -1790,18 +1790,13 @@ DoCompMoves ROUT
DoCompMoves ROUT
Push "R0-R2,R4-R10,R11,LR"
[ DebugF :LAND: {FALSE}
[ DebugF
DREG R3
DREG R9
DREG R10
mess ,">DoCompMoves",NL
]
[ Debug
DLINE "********* DoCompMoves ***********"
]
CMPS R3, R9 ; check for nothing to do
BLS %FT95 ; and if nothing to do then do nothing
......@@ -1841,7 +1836,7 @@ DoCompMoves ROUT
STR R0, [LR] ; shove the value away
MOV R8, R0 ; keep copy of zone base for arithmetic
; get sector size into R7
MOV R7, R3, LSR #29
MOV R7, R3, LSR #(32-3)
DiscRecPtr R7,R7
LDRB R7, [R7, #DiscRecord_Log2SectorSize]
]
......@@ -2368,7 +2363,7 @@ DoCompBufSize # 4
[ BigDisc
ADR LR, DoCompZoneBase
LDR LR, [LR]
MOV R0, LR, LSR #29
MOV R0, LR, LSR #(32-3)
DiscRecPtr R0,R0
LDRB R0, [R0, #DiscRecord_Log2SectorSize] ; and sector size
ADD R2, LR, R2, LSR R0 ; reconstruct disc address
......@@ -2446,7 +2441,7 @@ DoCompBufSize # 4
[ BigDisc
ADR LR, DoCompZoneBase ;
LDR LR, [LR] ; get zone base addr
MOV R0, LR, LSR #29
MOV R0, LR, LSR #(32-3)
DiscRecPtr R0,R0
LDRB R0, [R0, #DiscRecord_Log2SectorSize] ; and sector size
ADD R2, LR, R2, LSR R0 ; reconstruct disc address
......
......@@ -246,12 +246,12 @@ FindFragment ROUT
BLO %BT25 ;loop while more objects in zone
ADD R0, R0, #1 ;otherwise move onto next zone
LDRB LR, [R10,#ZoneHead+DiscRecord_NZones]
[ BigMaps
Push "R0"
LDRB R0, [R10,#ZoneHead+DiscRecord_BigMap_NZones2]
ADD LR, LR, R0, LSL #8
Pull "R0"
LDRB LR, [R10,#ZoneHead+DiscRecord_NZones]
LDRB R11, [R10,#ZoneHead+DiscRecord_BigMap_NZones2]
ADD LR, LR, R11, LSL #8 ; R11 returned by InitZoneObj so is free for use here
|
LDRB LR, [R10,#ZoneHead+DiscRecord_NZones]
]
TEQS R0, LR
MOVEQ R0, #0
......@@ -1372,7 +1372,7 @@ NextFree ROUT
DLINE ")"
]
[ BigMaps
BL FreeRdLinkBits ;(R10,R11->R8,Z)
BL FreeRdLinkBits ;(R10,R11->R8,Z)
|
BL RdLinkBits ;(R10,R11->R8,Z)
]
......@@ -1412,7 +1412,7 @@ NextFree ROUT
MOV R11,R9, LSL LR
ADD R11,R11,#FreeLink*8
[ BigMaps
BL FreeRdLinkBits ;(R10,R11->R8,Z)
BL FreeRdLinkBits ;(R10,R11->R8,Z)
|
BL RdLinkBits ;(R10,R11->R8,Z)
]
......@@ -1420,7 +1420,7 @@ NextFree ROUT
MOV R9, R11
ADD R11,R11,R8
CMPS PC, #0 ;Z=0, C=1
B %BT05
B %BT05
......@@ -2290,12 +2290,15 @@ IndDiscAddToZone ROUT
Pull "R1,R2,PC"
50 LDRB R0, [R10,#ZoneHead+DiscRecord_NZones]
50
[ BigMaps
LDRB R0, [R10,#ZoneHead+DiscRecord_NZones]
LDRB R1, [R10,#ZoneHead+DiscRecord_BigMap_NZones2]
ADD R0, R0, R1, LSL #8
|
LDRB R0, [R10,#ZoneHead+DiscRecord_NZones]
]
MOV R0, R0, LSR #1
MOV R0, R0, LSR #1 ;the map zone
[ DebugE
DREG R0, "<-IndDiscAddToZone(zone:",cc
DLINE ")"
......@@ -2469,8 +2472,8 @@ DefChainClaim
; ==========
;entry
; R2 link bits in bits 8-22
; R4 length to claim
; R2 link bits in bits 8-22 [BigMaps bits 8-28]
; R4 length to claim in map bits
; R5 do not use first gap of this size
; R6 predecessor gap of gap to start at
; R10 -> map start
......@@ -2548,7 +2551,7 @@ ChainClaim ROUT
TEQS R7, R5 ;IF this is gap asked not to use
MOVEQ R1, R6
MOVEQ R0, R11
BLEQ WrFreeNext ; point last unused gap at it
BLEQ WrFreeNext ;(R0,R1,R10) point last unused gap at it
MOVEQ R6, R11 ; re-init last unused gap
MOVEQ R5, #-1 ; prevent further matches
BEQ %BT05
......@@ -2603,10 +2606,10 @@ ChainClaim ROUT
MOV R1, R6 ;point previous gap at correct next
MOVLO R0, R8 ;not splitting=>next gap is new next gap
ADDHS R0, R11, R4 ;splitting=>2nd half of this gap is new next gap
BL WrFreeNext
BL WrFreeNext ;(R0,R1,R10)
MOVHS R1, R0 ;if splitting point new fragment at next
MOVHS R0, R8
BLHS WrFreeNext
BLHS WrFreeNext ;(R0,R1,R10)
ADD LR, R3, R4 ;return amount claimed in LR
[ DebugE :LOR: DebugEa