Commit 9aee4207 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Fix wildly inaccurate sizes in PhysRamTable when split_block needed

When Subtractv1v2fromRAMtable is called to remove a region that results in one of the RAM blocks being split in the middle the resulting size was incorrect.
The shuffle up loop was reusing v6 as an iterator not realising that it's needed to calculate the size of the 2nd half later, the error introduced was the difference between the physical address where PhysRamTable is located and the block being split - these could be a long way apart for example when there are two SDRAM banks.
Even if the PhysRamTable is nearby (eg. 1 SDRAM bank) the result would be some weird sized entries which ultimately mean some dynamic area address space is "leaked".

Fixed by swapping to v7, and for symmetry also adjusted the shuffle down loop to match.

Version 5.35, 4.79.2.224. Tagged as 'Kernel-5_35-4_79_2_224'
parent fa2003c1
......@@ -13,11 +13,11 @@
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.35"
Module_Version SETA 535
Module_MinorVersion SETS "4.79.2.223"
Module_Date SETS "20 Apr 2014"
Module_ApplicationDate SETS "20-Apr-14"
Module_MinorVersion SETS "4.79.2.224"
Module_Date SETS "30 Apr 2014"
Module_ApplicationDate SETS "30-Apr-14"
Module_ComponentName SETS "Kernel"
Module_ComponentPath SETS "castle/RiscOS/Sources/Kernel"
Module_FullVersion SETS "5.35 (4.79.2.223)"
Module_HelpVersion SETS "5.35 (20 Apr 2014) 4.79.2.223"
Module_FullVersion SETS "5.35 (4.79.2.224)"
Module_HelpVersion SETS "5.35 (30 Apr 2014) 4.79.2.224"
END
......@@ -5,19 +5,19 @@
*
*/
#define Module_MajorVersion_CMHG 5.35
#define Module_MinorVersion_CMHG 4.79.2.223
#define Module_Date_CMHG 20 Apr 2014
#define Module_MinorVersion_CMHG 4.79.2.224
#define Module_Date_CMHG 30 Apr 2014
#define Module_MajorVersion "5.35"
#define Module_Version 535
#define Module_MinorVersion "4.79.2.223"
#define Module_Date "20 Apr 2014"
#define Module_MinorVersion "4.79.2.224"
#define Module_Date "30 Apr 2014"
#define Module_ApplicationDate "20-Apr-14"
#define Module_ApplicationDate "30-Apr-14"
#define Module_ComponentName "Kernel"
#define Module_ComponentPath "castle/RiscOS/Sources/Kernel"
#define Module_FullVersion "5.35 (4.79.2.223)"
#define Module_HelpVersion "5.35 (20 Apr 2014) 4.79.2.223"
#define Module_FullVersion "5.35 (4.79.2.224)"
#define Module_HelpVersion "5.35 (30 Apr 2014) 4.79.2.224"
#define Module_LibraryVersionInfo "5:35"
......@@ -282,12 +282,12 @@ Subtractv1v2fromRAMtable
; we've completely covered a block. Remove it.
remove_block
MOV v6, v8
20 TEQ v6, a4 ; shuffle down subsequent blocks in table
LDMNEIA v6, {v3, v4}
STMNEDB v6, {v3, v4}
ADDNE v6, v6, #8
BNE %20
MOV v7, v8
20 TEQ v7, a4 ; shuffle down subsequent blocks in table
LDMNEIA v7, {v3, v4}
STMNEDB v7, {v3, v4}
ADDNE v7, v7, #8
BNE %BT20
SUB v5, v5, #1
SUB a4, a4, #8
STR v5, [a4]
......@@ -306,11 +306,11 @@ not_bottom
B %BT10
split_block
MOV v6, a4
30 TEQ v6, v8 ; shuffle up subsequent blocks in table
LDMNEDB v6, {v3, v4}
STMNEIA v6, {v3, v4}
SUBNE v6, v6, #8
MOV v7, a4
30 TEQ v7, v8 ; shuffle up subsequent blocks in table
LDMNEDB v7, {v3, v4}
STMNEIA v7, {v3, v4}
SUBNE v7, v7, #8
BNE %BT30
ADD v5, v5, #1
ADD a4, a4, #8
......
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