Commit 24b8fc82 authored by Ben Avison's avatar Ben Avison
Browse files

Scatter list entries in the top 64K of memory are treated as list loopback...

Scatter list entries in the top 64K of memory are treated as list loopback indicators, for FileCore compatibility.

Unaligned reads using a bounce buffer should now work correctly.

Version 0.15, 4.4.2.4. Tagged as 'DMA-0_15-4_4_2_4'
parent 58777373
......@@ -13,11 +13,11 @@
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.15"
Module_Version SETA 15
Module_MinorVersion SETS "4.4.2.3"
Module_Date SETS "15 Oct 2002"
Module_ApplicationDate SETS "15-Oct-02"
Module_MinorVersion SETS "4.4.2.4"
Module_Date SETS "25 Oct 2002"
Module_ApplicationDate SETS "25-Oct-02"
Module_ComponentName SETS "DMA"
Module_ComponentPath SETS "RiscOS/Sources/HWSupport/DMA"
Module_FullVersion SETS "0.15 (4.4.2.3)"
Module_HelpVersion SETS "0.15 (15 Oct 2002) 4.4.2.3"
Module_FullVersion SETS "0.15 (4.4.2.4)"
Module_HelpVersion SETS "0.15 (25 Oct 2002) 4.4.2.4"
END
......@@ -5,19 +5,19 @@
*
*/
#define Module_MajorVersion_CMHG 0.15
#define Module_MinorVersion_CMHG 4.4.2.3
#define Module_Date_CMHG 15 Oct 2002
#define Module_MinorVersion_CMHG 4.4.2.4
#define Module_Date_CMHG 25 Oct 2002
#define Module_MajorVersion "0.15"
#define Module_Version 15
#define Module_MinorVersion "4.4.2.3"
#define Module_Date "15 Oct 2002"
#define Module_MinorVersion "4.4.2.4"
#define Module_Date "25 Oct 2002"
#define Module_ApplicationDate "15-Oct-02"
#define Module_ApplicationDate "25-Oct-02"
#define Module_ComponentName "DMA"
#define Module_ComponentPath "RiscOS/Sources/HWSupport/DMA"
#define Module_FullVersion "0.15 (4.4.2.3)"
#define Module_HelpVersion "0.15 (15 Oct 2002) 4.4.2.3"
#define Module_FullVersion "0.15 (4.4.2.4)"
#define Module_HelpVersion "0.15 (25 Oct 2002) 4.4.2.4"
#define Module_LibraryVersionInfo "0:15"
......@@ -33,8 +33,13 @@ CopyToBounceBuffer
MOVEQ r11, r12
10 LDR r8, [r10, #dmar_ScatterList] ; (Re)Load scatter list pointer into r8.
20 LDMIA r8!, {r6,r7} ; Load from, length
CMP r7, r12
MOVHI r7, r12
CMP r6, #ScatterListThresh
TEQHS r7, #0
ADDEQ r8, r8, r6
SUBEQ r8, r8, #8
BEQ %BT20 ; Restart if looped scatter list.
CMP r7, r11
MOVHI r7, r11
SUB r11, r11, r7
SUB r12, r12, r7
Push "r11" ; Need one more working register to make eight.
......@@ -180,13 +185,18 @@ CopyFromBounceBuffer
MOVEQ r11, r12
10 LDR r8, [r10, #dmar_ScatterList] ; (Re)Load scatter list pointer into r8.
20 LDMIA r8!, {r6,r7} ; Load to, length
CMP r7, r12
MOVHI r7, r12
CMP r6, #ScatterListThresh
TEQHS r7, #0
ADDEQ r8, r8, r6
SUBEQ r8, r8, #8
BEQ %BT20 ; Restart if looped scatter list.
CMP r7, r11
MOVHI r7, r11
SUB r11, r11, r7
SUB r12, r12, r7
Push "r11" ; Need one more working register to make eight.
RSB r0, r6, #0
RSB r0, r9, #0
AND r0, r0, #3 ; Number of bytes to next word boundary at source.
CMP r7, r0
MOVLO r0, r7 ; May have to do even less for very short blocks.
......@@ -200,7 +210,7 @@ CopyFromBounceBuffer
STRB r1, [r6], #1
STRHSB r2, [r6], #1
STRHIB r3, [r6], #1
30 TST r9, #3 ; Is destination now word-aligned?
30 TST r6, #3 ; Is destination now word-aligned?
BEQ %FT40 ; Yes, use fast code.
31 SUBS r7, r7, #16
......@@ -557,7 +567,11 @@ DMACreatePageTable
MOV lr, r1
10
LDMIA r0!, {r2,r3} ; Get address,length pair.
TEQ r3, #0 ; Skip 0 length entries.
CMP r2, #ScatterListThresh
TEQHS r3, #0
ADDEQ r0, r0, r2
SUBEQ r0, r0, #8 ; Restart if looped scatter list.
TEQNE r3, #0 ; Skip 0 length entries.
BEQ %BT10
SUBS lr, lr, r3 ; Adjust total transfer length.
ADDCC r3, lr, r3 ; If total length < section length then use total length.
......@@ -584,7 +598,11 @@ DMACreatePageTable
LDR r0, [r10, #dmar_ScatterList] ; Fill length and logical address fields in table.
20
LDMIA r0!, {r4,lr} ; Get address,length pair.
TEQ lr, #0 ; Skip 0 length entries.
CMP r4, #ScatterListThresh
TEQHS lr, #0
ADDEQ r0, r0, r4
SUBEQ r0, r0, #8 ; Restart if looped scatter list.
TEQNE lr, #0 ; Skip 0 length entries.
BEQ %BT20
SUBS r1, r1, lr ; Adjust total transfer length.
ADDCC lr, r1, lr ; If total length < section length then use total length.
......@@ -2323,6 +2341,11 @@ update
LDR lr, [r10, #dmar_ScatterList]
10
LDMIA lr, {r0,r1} ; Get scatter list addr,len.
CMP r0, #ScatterListThresh
TEQHS r1, #0
ADDEQ lr, lr, r0
STREQ lr, [r10, #dmar_ScatterList]
BEQ %BT10 ; Restart if looped scatter list.
TEQ r1, #0 ; If zero length entry then
ADDEQ lr, lr, #8 ; move on to next section.
STREQ lr, [r10, #dmar_ScatterList]
......
......@@ -80,6 +80,9 @@ standalone SETL false
GBLL international
international SETL true
GBLA ScatterListThresh
ScatterListThresh SETA -&10000
;---------------------------------------------------------------------------
; Get the sources.
;
......
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