Commit 93f3ac2b authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Increase maximum supported buffer size to 4k

LowFSI: Max_BuffSize define changed.
FileSwBody: Module workspace claim changed to claim Max_BuffSize in addition to the workspace required, so that all the variables in the workspace remain within ADR range.
OSFind: Vetting of acceptable buffer sizes now produced with a WHILE/WEND loop.
StreamBits: Changed to use 'free' flag rather then comparing with 'Nowt'.
MkClean/MkRom: Throwback enabled.

Tested in IOMD ROM, workspace manually inspected as OK.

Version 2.82. Tagged as 'FileSwitch-2_82'
parent 1c07c7cd
No related merge requests found
......@@ -14,5 +14,4 @@
|
Dir <Obey$Dir>
amu_machine clean
ifthere Run:stripdepnd then stripdepnd <Obey$Dir>.Makefile
stripdepnd
......@@ -13,4 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine rom
amu_machine rom THROWBACK=-throwback
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "2.81"
Module_Version SETA 281
Module_MajorVersion SETS "2.82"
Module_Version SETA 282
Module_MinorVersion SETS ""
Module_Date SETS "13 Jan 2013"
Module_ApplicationDate SETS "13-Jan-13"
Module_Date SETS "11 Mar 2013"
Module_ApplicationDate SETS "11-Mar-13"
Module_ComponentName SETS "FileSwitch"
Module_ComponentPath SETS "castle/RiscOS/Sources/FileSys/FileSwitch"
Module_FullVersion SETS "2.81"
Module_HelpVersion SETS "2.81 (13 Jan 2013)"
Module_FullVersion SETS "2.82"
Module_HelpVersion SETS "2.82 (11 Mar 2013)"
END
/* (2.81)
/* (2.82)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 2.81
#define Module_MajorVersion_CMHG 2.82
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 13 Jan 2013
#define Module_Date_CMHG 11 Mar 2013
#define Module_MajorVersion "2.81"
#define Module_Version 281
#define Module_MajorVersion "2.82"
#define Module_Version 282
#define Module_MinorVersion ""
#define Module_Date "13 Jan 2013"
#define Module_Date "11 Mar 2013"
#define Module_ApplicationDate "13-Jan-13"
#define Module_ApplicationDate "11-Mar-13"
#define Module_ComponentName "FileSwitch"
#define Module_ComponentPath "castle/RiscOS/Sources/FileSys/FileSwitch"
#define Module_FullVersion "2.81"
#define Module_HelpVersion "2.81 (13 Jan 2013)"
#define Module_LibraryVersionInfo "2:81"
#define Module_FullVersion "2.82"
#define Module_HelpVersion "2.82 (11 Mar 2013)"
#define Module_LibraryVersionInfo "2:82"
......@@ -85,18 +85,13 @@ $label._FSInfoBlock
; The variable Max_BuffSize determines the maximum permitted value for the
; "natural block size" returned by a Filing System to FileSwitch when
; FSEntry_Open is called.
; FSEntry_Open is called. The value must be a power of 2.
;
; In versions of FileSwitch prior to 2.28, this was hard-coded as 1024.
;
; The value must be a power of 2, and is set to 2048 in 2.28. This is of
; considerable benefit to CDFS, since the sector size on CD-ROMs is
; 2048 bytes.
;
; If any value other than 1024 or 2048 is chosen, code in s.OSFind will also
; need to be changed (search for Max_BuffSize and it's obvious).
; From FileSwitch 2.28 it is 2048, which is of considerable benefit to CDFS.
; From FileSwitch 2.82 it is 4096, for Advanced Format '4Kn' harddiscs.
Max_BuffSize * 2048
Max_BuffSize * 4096
; Offsets from start of FS information block in a FS module
......
......@@ -395,11 +395,12 @@ streamtable # streamtable_size
! 0, "Change ShowHeap streamtable to &":CC:(:STR:(:INDEX: streamtable))
]
[ sparebuffer
SpareBufferArea # Max_BuffSize + 4*4
ASSERT bcb_size = 4*4
SpareBuffer # 4
]
EnvStringAddr # 4 ; Only needed when we're not bound to kernel
EnvTimeAddr # 4
SVCSTK # 4
SysHeapStart # 4
ptr_DomainId # 4 ; Pointer to kernel's DomainId var
; Byte size global variables
......@@ -409,15 +410,12 @@ copy_n_upcalls # 1 ; Reference count on UpCallV
[ StrongARM
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
ptr_DomainId # 4 ; Pointer to kernel's DomainId var
# 1 ; Pad
[ sparebuffer
SpareBufferFree # 1 ; Flag, non zero denotes free for use
AlignSpace 16
SpareBufferArea # 0 ; Must be last, it's Max_BuffSize long
]
; No need to align end of global workspace; saves alloc when rounded!
......@@ -767,7 +765,13 @@ FileSwitch_Init Entry "r7"
DLINE "Hard Init"
]
MOV r0, #ModHandReason_Claim
[ sparebuffer
LDR r3, =FileSwitchWorkspace_size + Max_BuffSize + (4*4)
ASSERT bcb_size = (4*4)
ASSERT :INDEX:SpareBufferArea = FileSwitchWorkspace_size
|
LDR r3, =FileSwitchWorkspace_size
]
SWI XOS_Module
EXIT VS
......@@ -842,11 +846,12 @@ fsw_varcount SETA fsw_varcount + 4
BNE %BT10
[ sparebuffer
ADR r14, SpareBufferArea ; Nobody owns this yet
STR r14, SpareBuffer
MOV r14, #Max_BuffSize ; bufmask for this buffer is permanent
SUB r14, r14, #1
STR r14, SpareBufferArea + :INDEX: bcb_actualsize
MVN r14, #0 ; Nobody owns this yet
STRB r14, SpareBufferFree
ADR r14, SpareBufferArea
MOV r0, #Max_BuffSize ; bufmask for this buffer is permanent
SUB r0, r0, #1
STR r0, [r14, #:INDEX:bcb_actualsize]
]
[ debuginittime
Pull "r1"
......
......@@ -663,14 +663,12 @@ StuffTheStreamInfo Entry "r1"
ORREQ r14, r14, #scb_unbuffered
STR r14, scb_status ; Store access mode, buffer state, EOF clear
[ Max_BuffSize >= 2048
TEQNE r2, #2048 ; vital for efficient CDFS access
]
TEQNE r2, #1024 ; Limited range of sensible buffer sizes
TEQNE r2, #512
TEQNE r2, #256
TEQNE r2, #128
TEQNE r2, #64 ; Below this seems senseless !
GBLA buffsize
buffsize SETA Max_BuffSize
WHILE buffsize >= 64 ; Below this seems senseless !
TEQNE r2, #buffsize ; Range of sensible buffer sizes
buffsize SETA buffsize / 2
WEND
BNE %FA85 ; Deallocate stream if failed
; Store the path strings for this object
......
......@@ -385,10 +385,11 @@ ClaimBuffer Entry "r0-r3, bufmask"
EXIT NE
[ sparebuffer
LDR bcb, SpareBuffer ; Try our spare buffer
TEQ bcb, #Nowt
MOVNE r14, #Nowt
STRNE r14, SpareBuffer ; Claim it
LDRB r14, SpareBufferFree ; Try our spare buffer
TEQ r14, #0
MOVNE r14, #0
STRNEB r14, SpareBufferFree ; Claim it
ADRNE bcb, SpareBufferArea
[ debugstream
BEQ %FT00
DREG bcb,"Using SpareBuffer:"
......@@ -538,7 +539,8 @@ DeallocateBuffer EntryS "r2"
[ sparebuffer
ADR r14, SpareBufferArea ; Freeing our spare ?
CMP r14, r2 ; VClear
STREQ r14, SpareBuffer
MVNEQ r14, #0
STREQB r14, SpareBufferFree
BLNE SFreeArea
|
BL SFreeArea
......
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