Commit 28968ea5 authored by Ben Avison's avatar Ben Avison
Browse files

Loading to/saving from top-bit-set addresses should now work.

Detail:
  The problem was in the API definition of the scatter lists used in
  background data transfer. These consist of a sequence of word pairs,
  holding addresses and lengths; any negative (ie top-bit-set) address word
  is defined to mean that the list continues at an location that is offset
  by that amount. To get around this, the check is now made not on whether
  the address word is negative, but on whether it is equal to or greater
  than (less negative than) &FFFF0000. This means that accesses to these
  addresses will still fail, but such addresses should be reserved for
  system use anyway.
Admin:
  Tested briefly.

Version 3.33. Tagged as 'ADFS-3_33'
parent 83c6bab3
......@@ -8,11 +8,17 @@
GBLS Module_FullVersion
GBLS Module_ApplicationDate2
GBLS Module_ApplicationDate4
Module_MajorVersion SETS "3.32"
Module_Version SETA 332
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "3.33"
Module_Version SETA 333
Module_MinorVersion SETS ""
Module_Date SETS "11 Jul 2000"
Module_ApplicationDate2 SETS "11-Jul-00"
Module_ApplicationDate4 SETS "11-Jul-2000"
Module_FullVersion SETS "3.32"
Module_Date SETS "17 Nov 2000"
Module_ApplicationDate2 SETS "17-Nov-00"
Module_ApplicationDate4 SETS "17-Nov-2000"
Module_ComponentName SETS "ADFS"
Module_ComponentPath SETS "RiscOS/Sources/FileSys/ADFS/ADFS"
Module_FullVersion SETS "3.33"
Module_HelpVersion SETS "3.33 (17 Nov 2000)"
END
/* (3.32)
/* (3.33)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 3.32
#define Module_MajorVersion_CMHG 3.33
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 11 Jul 2000
#define Module_Date_CMHG 17 Nov 2000
#define Module_MajorVersion "3.32"
#define Module_Version 332
#define Module_MajorVersion "3.33"
#define Module_Version 333
#define Module_MinorVersion ""
#define Module_Date "11 Jul 2000"
#define Module_Date "17 Nov 2000"
#define Module_ApplicationDate2 "11-Jul-00"
#define Module_ApplicationDate4 "11-Jul-2000"
#define Module_ApplicationDate2 "17-Nov-00"
#define Module_ApplicationDate4 "17-Nov-2000"
#define Module_FullVersion "3.32"
#define Module_ComponentName "ADFS"
#define Module_ComponentPath "RiscOS/Sources/FileSys/ADFS/ADFS"
#define Module_FullVersion "3.33"
#define Module_HelpVersion "3.33 (17 Nov 2000)"
......@@ -819,8 +819,13 @@ BreakOffExit
MOV R7, R3 ;loop to find start of scatter block
84
LDR LR, [R7, #8]!
[ FixTBSAddrs
CMN LR, #ScatterListNegThresh
BCC %BT84
|
TEQS LR, #0
BPL %BT84
]
ADD R7, R7, LR
STMDB R7, {R0,R5} ;set ProcessError and ProcessStatus
;THIS ALLOWS RESTARTING SO CAN'T RELY ON WINNIE WORKSPACE
......@@ -964,9 +969,15 @@ PrepareForNextBlock ROUT
BEQ %FT70
LDMIA R5, {R0,R1}
[ FixTBSAddrs
CMN R0, #ScatterListNegThresh
ADDCS R5, R5, R0
LDMCSIA R5, {R0,R1}
|
TEQS R0, #0
ADDMI R5, R5, R0
LDMMIIA R5, {R0,R1}
]
ADD R0, R0, R4
SUBS R1, R1, R4
STRNE R5, WScatter
......@@ -1707,10 +1718,17 @@ WriteCase ROUT ; 2 - write data to disc
BEQ %FT22
20
LDMIA R3, {R5,LR}
[ FixTBSAddrs
CMN R5, #ScatterListNegThresh
ADDCS R3, R3, R5
ADDCS R4, R3, #2*4
BCS %BT20
|
TEQS R5, #0
ADDMI R3, R3, R5
ADDMI R4, R3, #2*4
BMI %BT20
]
TEQS LR, #0
ADD R3, R3, #2*4
BNE %BT15
......@@ -1719,8 +1737,13 @@ WriteCase ROUT ; 2 - write data to disc
BNE %FT30
25
LDMIA R3!,{R5,LR}
[ FixTBSAddrs
CMN R5, #ScatterListNegThresh
BCC %BT25
|
TEQS R5, #0
BPL %BT25
]
ADD R4, R3, R5
30
[ Debug6
......@@ -1764,9 +1787,15 @@ BackgroundWriteResume
SUB R2, R2, R4
55
LDMIA R3, {R1,R5}
[ FixTBSAddrs
CMN R1, #ScatterListNegThresh
ADDCS R3, R3, R1
BCS %BT55
|
TEQS R1, #0
ADDMI R3, R3, R1
BMI %BT55
]
ADD R1, R1, R4
SUBS R4, R4, R5
ADDHS R3, R3, #8
......
......@@ -1170,9 +1170,15 @@ PrepareForNextBlock ROUT
BEQ %FT70
LDMIA R5, {R0,R1}
[ FixTBSAddrs
CMN R0, #ScatterListNegThresh
ADDCS R5, R5, R0
LDMCSIA R5, {R0,R1}
|
TEQS R0, #0
ADDMI R5, R5, R0
LDMMIIA R5, {R0,R1}
]
ADD R0, R0, R4
SUBS R1, R1, R4
STRNE R5, WScatter
......@@ -2102,10 +2108,17 @@ WriteCase ROUT ; 2 - write data to disc
BEQ %FT22
20
LDMIA R3, {R5,LR}
[ FixTBSAddrs
CMN R5, #ScatterListNegThresh
ADDCS R3, R3, R5
ADDCS R4, R3, #2*4
BCS %BT20
|
TEQS R5, #0
ADDMI R3, R3, R5
ADDMI R4, R3, #2*4
BMI %BT20
]
TEQS LR, #0
ADD R3, R3, #2*4
BNE %BT15
......@@ -2114,8 +2127,13 @@ WriteCase ROUT ; 2 - write data to disc
BNE %FT30
25
LDMIA R3!,{R5,LR}
[ FixTBSAddrs
CMN R5, #ScatterListNegThresh
BCC %BT25
|
TEQS R5, #0
BPL %BT25
]
ADD R4, R3, R5
30
[ Debug6
......@@ -2190,9 +2208,15 @@ BackgroundWriteResume
SUB R2, R2, R4
55
LDMIA R3, {R1,R5}
[ FixTBSAddrs
CMN R1, #ScatterListNegThresh
ADDCS R3, R3, R1
BCS %BT55
|
TEQS R1, #0
ADDMI R3, R3, R1
BMI %BT55
]
ADD R1, R1, R4
SUBS R4, R4, R5
ADDHS R3, R3, #8
......
......@@ -304,9 +304,15 @@ WinIDEDoForeground ROUT
10
LDMIA R3,{R0,R5} ; get scatter list entry
[ FixTBSAddrs
CMN R0,#ScatterListNegThresh; addr < 0 ?
ADDCS R3,R3,R0 ; if yes, add in...
BCS %BT10 ; and go again
|
TEQS R0,#0 ; addr < 0 ?
ADDMI R3,R3,R0 ; if yes, add in...
BMI %BT10 ; and go again
]
; got non-negative address from scatter list entry, check for 0 len
......@@ -477,9 +483,15 @@ WinIDEDoBackground ROUT
10
LDMIA R3,{R0,R5} ; get scatter list entry
[ FixTBSAddrs
CMN R0,#ScatterListNegThresh; offset backwards?
ADDCS R3,R3,R0 ; if yes, add in...
BCS %BT10 ; and go again
|
TEQS R0,#0 ; offset backwards?
ADDMI R3,R3,R0 ; if yes, add in...
BMI %BT10 ; and go again
]
; got non-negative address from scatter list entry, check for 0 len
......@@ -625,9 +637,15 @@ WinIDEStartTransfer ROUT
MOV R1,#0 ; bytes found in scatter list
10
LDMIA R3,{R0,R5} ; get scatter entry
[ FixTBSAddrs
CMN R0,#ScatterListNegThresh ; wrap around?
ADDCS R3,R3,R0 ; yes, add it in
BCS %BT10 ; and go again
|
TEQS R0,#0 ; wrap around?
ADDMI R3,R3,R0 ; yes, add it in
BMI %BT10 ; and go again
]
; found real entry in scatter list
......@@ -1060,9 +1078,15 @@ WinIDEIRQHandler ROUT
ADD R3,R3,#8 ; step to next entry
05
LDMIA R3,{R4,R5} ; get the entry
[ FixTBSAddrs
CMN R4,#ScatterListNegThresh; address < 0
ADDCS R3,R3,R4 ; add it in if so
BCS %BT05 ; and go again
|
TEQS R4,#0 ; address < 0
ADDMI R3,R3,R4 ; add it in if so
BMI %BT05 ; and go again
]
; Got a scatter list entry with a proper address.
; No need to check length as that was done when we determined the
......@@ -1284,9 +1308,15 @@ WinIDEIRQHandler ROUT
ADD R3,R3,#8 ; step to next entry
35
LDMIA R3,{R4,R5} ; get the entry
[ FixTBSAddrs
CMN R4,#ScatterListNegThresh; address < 0
ADDCS R3,R3,R4 ; add it in if so
BCS %BT35 ; and go again
|
TEQS R4,#0 ; address < 0
ADDMI R3,R3,R4 ; add it in if so
BMI %BT35 ; and go again
]
; Got a scatter list entry with a proper address - check length
......@@ -1623,9 +1653,15 @@ WinIDEUpdateScatterList ROUT
10
LDMIA R3,{R4,R5} ; get scatter list entry
[ FixTBSAddrs
CMN R4,#ScatterListNegThresh; wrap?
ADDCS R3,R3,R4 ; add in if so
BCS %BT10 ; and go again
|
TEQS R4,#0 ; wrap?
ADDMI R3,R3,R4 ; add in if so
BMI %BT10 ; and go again
]
; found non-negative scatter list entry
......@@ -1747,8 +1783,13 @@ WinIDECallbackBg ROUT
MOV R4,R3 ; R4 -> scatter list
10
LDR R5,[R4,#8]! ; get next entry
[ FixTBSAddrs
CMN R5,#ScatterListNegThresh; backwards offset?
BCC %BT10 ; branch if not
|
TEQS R5,#0 ; backwards offset?
BPL %BT10 ; branch if not
]
; found negative buffer address - must be offset to start of scatter list
; store process error & status
......@@ -1833,8 +1874,13 @@ WinIDECallbackBg_LockFailed ROUT
MOV R4,R3 ; R4 -> scatter list
10
LDR R5,[R4,#8]! ; get next entry
[ FixTBSAddrs
CMN R5,#ScatterListNegThresh; backwards offset?
BCC %BT10 ; branch if not
|
TEQS R5,#0 ; backwards offset?
BPL %BT10 ; branch if not
]
; found negative buffer address - must be offset to start of scatter list
; store process error & status
......
......@@ -824,9 +824,15 @@ NotDrq ROUT
STREQ R7, [SP,#ScatterPtr] ; No then save scatter ptr
BEQ %FT60 ; And jump, all done
05
[ FixTBSAddrs
CMN Ram,#ScatterListNegThresh;if reached end of buffer pairs
ADDCS R7, R7, Ram ;then wrap back to start
LDMCSIA R7, {Ram,End}
|
TEQS Ram, #0 ;if reached end of buffer pairs
ADDMI R7, R7, Ram ;then wrap back to start
LDMMIIA R7, {Ram,End}
]
STR R7, [SP,#ScatterPtr]
SUBS R0, End, #0 ;finished when reach zero length pair
BEQ %FT50
......@@ -1238,8 +1244,13 @@ FiqEscape
MOV R1, R7
55 ;loop to search for end of background scatter pairs
LDR R2, [R1,#8]!
[ FixTBSAddrs
CMN R2, #ScatterListNegThresh
BCC %BT55
|
TEQS R2, #0
BPL %BT55
]
ADD R1, R1, R2
[ T ;marking process complete now done on FIQ downgrade
......
......@@ -519,10 +519,17 @@ FlpReadFIQ_2xSectorSize1
; This sector's entry has = 2xSectorSize hence we must check the next
; scatter entry for being present
LDR R9, [R12, #8]
[ FixTBSAddrs
CMN R9, #ScatterListNegThresh
ADDCS R9, R12, R9
LDRCS R9, [R9, #8+4]
LDRCC R9, [R12, #8+4]
|
TEQ R9, #0
ADDMI R9, R12, R9
LDRMI R9, [R9, #8+4]
LDRPL R9, [R12, #8+4]
]
20
TEQ R9, #0
SUBEQ R11, R10, #1 ; Terminate on last byte of next sector
......@@ -532,8 +539,13 @@ FlpReadFIQ_2xSectorSize1
; This scatter entry has 1xSectorSize in it, hence r8 is wrong
ADD R10, R12, #8
LDR R8, [R10]
[ FixTBSAddrs
CMN R8, #ScatterListNegThresh
LDRCS R8, [R10, R8]!
|
TEQ R8, #0
LDRMI R8, [R10, R8]!
]
STR R10, FlpReadThisRover
LDR R9, [R10, #4]
FlpReadFIQ_1xSectorSize5
......@@ -542,8 +554,13 @@ FlpReadFIQ_1xSectorSize7
MOVHI R10, #&3FC0 ; 1xSectorSize
retfiq HI
LDR R9, [R10, #8]!
[ FixTBSAddrs
CMN R9, #ScatterListNegThresh
ADDCS R10, R10, R9
|
TEQ R9, #0
ADDMI R10, R10, R9
]
LDR R9, [R10, #4]
FlpReadFIQ_1xSectorSize6
MOV R10, #&3FC0 ; 1xSectorSize
......@@ -829,10 +846,17 @@ FlpWriteFIQ_2xSectorSize1
; This sector's entry has = 2xSectorSize hence we must check the next
; scatter entry for being present
LDR R9, [R12, #8]
[ FixTBSAddrs
CMN R9, #ScatterListNegThresh
ADDCS R9, R12, R9
LDRCS R9, [R9, #8+4]
LDRCC R9, [R12, #8+4]
|
TEQ R9, #0
ADDMI R9, R12, R9
LDRMI R9, [R9, #8+4]
LDRPL R9, [R12, #8+4]
]
20
TEQ R9, #0
SUBEQ R11, R10, #1 ; Terminate on last byte of next sector
......@@ -843,8 +867,13 @@ FlpWriteFIQ_2xSectorSize1
; This scatter entry has 1xSectorSize in it, hence r8 is wrong
ADD R10, R12, #8
LDR R8, [R10]
[ FixTBSAddrs
CMN R8, #ScatterListNegThresh
LDRCS R8, [R10, R8]!
|
TEQ R8, #0
LDRMI R8, [R10, R8]!
]
STR R10, FlpWriteThisRover
LDR R9, [R10, #4]
FlpWriteFIQ_1xSectorSize5
......@@ -854,8 +883,13 @@ FlpWriteFIQ_1xSectorSize7
MOVHI R10, #&3FC0 ; 1xSectorSize
retfiq HI
LDR R9, [R10, #8]!
[ FixTBSAddrs
CMN R9, #ScatterListNegThresh
ADDCS R10, R10, R9
|
TEQ R9, #0
ADDMI R10, R10, R9
]
LDR R9, [R10, #4]
FlpWriteFIQ_1xSectorSize6
MOV R10, #&3FC0 ; 1xSectorSize
......@@ -1294,9 +1328,15 @@ FlpHandlerData_ExecuteCommand
LDMIA lr, {r0,r1}
DREG r0, " ",cc
DREG r1, ",",cc
[ FixTBSAddrs
CMN r0, #ScatterListNegThresh
ADDCS lr, lr, r0
BCS %BT02
|
TEQ r0, #0
ADDMI lr, lr, r0
BMI %BT02
]
ADD lr, lr, #8
TEQ r1, #0
BNE %BT02
......@@ -1338,9 +1378,15 @@ FlpHandlerData_ExecuteCommand
LDMIA lr, {r0,r1}
DREG r0, " ",cc
DREG r1, ",",cc
[ FixTBSAddrs
CMN r0, #ScatterListNegThresh
ADDCS lr, lr, r0
BCS %BT02
|
TEQ r0, #0
ADDMI lr, lr, r0
BMI %BT02
]
ADD lr, lr, #8
TEQ r1, #0
BNE %BT02
......@@ -1622,8 +1668,13 @@ FIQSetupWrite_BG ROUT
; 1xSectorSize in this sector's entry - find the next sector's entry
LDR R9, [R12, #8]!
[ FixTBSAddrs
CMN R9, #ScatterListNegThresh
ADDCS R12, R12, R9
|
TEQ R9, #0
ADDMI R12, R12, R9
]
LDR R9, [R12, #4]
CMP R9, #0
50
......@@ -1746,8 +1797,13 @@ FIQSetupRead_BG ROUT
; 1xSectorSize in this sector's entry - find the next sector's entry
LDR R9, [R12, #8]!
[ FixTBSAddrs
CMN R9, #ScatterListNegThresh
ADDCS R12, R12, R9
|
TEQ R9, #0
ADDMI R12, R12, R9
]
LDR R9, [R12, #4]
CMP R9, #0
50
......@@ -2002,9 +2058,15 @@ FlpAdvanceBackgroundTransfer ROUT
TEQ r0, r1
BEQ %FT20
LDR lr, [r0, #0]
[ FixTBSAddrs
CMN lr, #ScatterListNegThresh
ADDCS r0, r0, lr
ADDCC r0, r0, #8
|
TEQ lr, #0
ADDMI r0, r0, lr
ADDPL r0, r0, #8
]
TEQ r0, r1
B %BT10
20
......@@ -2097,8 +2159,13 @@ FlpAdvanceScatter ROUT
TEQ r5, #0
BEQ %FT20
LDR r3, [r1]
[ FixTBSAddrs
CMN r3, #ScatterListNegThresh
ADDCS r1, r1, r3
|
TEQ r3, #0
ADDMI r1, r1, r3
]
20
CMP r0, #0
BHI %BT10
......
......@@ -1256,8 +1256,13 @@ FlpLowDataPost ROUT
; Search for end of list
MOV R9, R7 ; Save pointer to last pair
50 LDR R8, [R7, #8]! ; Get next buffer address from list
[ FixTBSAddrs
CMN R8,#ScatterListNegThresh; End of list?
BCC %BT50 ; No then loop
|
TEQS R8, #0 ; End of list?
BPL %BT50 ; No then loop
]
ADD R7, R7, R8 ; R7-> start of list
; Update process status block
......
......@@ -48,4 +48,10 @@ IDEPower SETL {TRUE}
GBLL ServicePolice
ServicePolice SETL {TRUE}
; updated semantics of scatter list to allow background transfer
; to/from top-bit set logical addresses
GBLL FixTBSAddrs
FixTBSAddrs SETL {TRUE}
ScatterListNegThresh * &10000
END
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