Commit 75de3830 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Fixes to HAL memory info calls and docs

MemInfo.s:
 Several places in this code called the HAL or other ATPCS defined functions like memset() and hoped that the overall result was V clear. If any of them accidentally set V (for example a CMP that straddles 0x80000000) you ended up trying to look up an international error at the address of the reason code to OS_Memory.
 Now, explicitly clear V in the non error cases where an ATPCS function was called.
 Change the HAL_PhysInfo call to expect a physical ROM size back as an inclusive range, to match the RAM range subreason code. Add 1 to correct for this. A value of 0 & 0 is taken to mean "no physical ROM" as before.
Middle.s:
 Document that 255 means "no IOMD" or "no VIDC", that's what the HALs have been using since year dot.

Version 5.35, 4.79.2.248. Tagged as 'Kernel-5_35-4_79_2_248'
parent 10a86092
......@@ -13,11 +13,11 @@
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.35"
Module_Version SETA 535
Module_MinorVersion SETS "4.79.2.247"
Module_Date SETS "13 Nov 2014"
Module_ApplicationDate SETS "13-Nov-14"
Module_MinorVersion SETS "4.79.2.248"
Module_Date SETS "06 Dec 2014"
Module_ApplicationDate SETS "06-Dec-14"
Module_ComponentName SETS "Kernel"
Module_ComponentPath SETS "castle/RiscOS/Sources/Kernel"
Module_FullVersion SETS "5.35 (4.79.2.247)"
Module_HelpVersion SETS "5.35 (13 Nov 2014) 4.79.2.247"
Module_FullVersion SETS "5.35 (4.79.2.248)"
Module_HelpVersion SETS "5.35 (06 Dec 2014) 4.79.2.248"
END
......@@ -5,19 +5,19 @@
*
*/
#define Module_MajorVersion_CMHG 5.35
#define Module_MinorVersion_CMHG 4.79.2.247
#define Module_Date_CMHG 13 Nov 2014
#define Module_MinorVersion_CMHG 4.79.2.248
#define Module_Date_CMHG 06 Dec 2014
#define Module_MajorVersion "5.35"
#define Module_Version 535
#define Module_MinorVersion "4.79.2.247"
#define Module_Date "13 Nov 2014"
#define Module_MinorVersion "4.79.2.248"
#define Module_Date "06 Dec 2014"
#define Module_ApplicationDate "13-Nov-14"
#define Module_ApplicationDate "06-Dec-14"
#define Module_ComponentName "Kernel"
#define Module_ComponentPath "castle/RiscOS/Sources/Kernel"
#define Module_FullVersion "5.35 (4.79.2.247)"
#define Module_HelpVersion "5.35 (13 Nov 2014) 4.79.2.247"
#define Module_FullVersion "5.35 (4.79.2.248)"
#define Module_HelpVersion "5.35 (06 Dec 2014) 4.79.2.248"
#define Module_LibraryVersionInfo "5:35"
......@@ -238,17 +238,16 @@ MemoryConvert ROUT
; ARMs so far).
; *** Also, fix it up to do it page by page.
TST r0, #flush_tlb
EXIT EQ ; If not flush_tlb, can't have flush_cache
BEQ %FT75 ; If not flush_tlb, can't have flush_cache
MOV r1, r0
LDR r0, =ZeroPage
ARMop TLB_InvalidateAll,,,r0
TST r1, #flush_cache ; If any page has been made uncacheable in L2 then flush!
EXIT EQ
BEQ %FT75
LDR r0, =ZeroPage
ARMop Cache_CleanInvalidateAll,,,r0
;75
; Pull "lr"
; MSR CPSR_c, lr
75
CLRV
EXIT
80
......@@ -266,7 +265,7 @@ MemoryConvert ROUT
90
ADRL r0, ErrorBlock_BadAddress
95
STR r0, [sp]
STR r0, [sp, #Proc_RegOffset+0]
SETV
EXIT
......@@ -460,6 +459,7 @@ MemoryPhysSize
ADD r1, sp, #4
CallHAL HAL_PhysInfo
MOV r2, #4*1024
CLRV
EXIT
|
MOV r1, #PhysSpaceSize :SHR: ByteShift
......@@ -593,6 +593,7 @@ MemoryReadPhys ROUT
MOVHS r2, #(OSROM_ImageSize*1024) :SHR: ByteShift
BLHS memset
CLRV
EXIT
......@@ -662,7 +663,8 @@ MemoryAmounts ROUT
MOV r2, sp
CallHAL HAL_PhysInfo
LDMIA sp!, {r0-r1}
SUB r1, r1, r0 ; ROM = ROMPhysTop - ROMPhysBot
SUBS r1, r1, r0
ADDNE r1, r1, #1 ; ROM = ROMPhysTop + 1 - ROMPhysBot
Pull "r0, sb, ip"
B %FT97
40
......@@ -683,6 +685,7 @@ MemoryAmounts ROUT
97
MOV r1, r1, LSR #12 ; Return as number of pages.
MOV r2, #4*1024 ; Return page size.
CLRV
EXIT
99
ADRL r0, ErrorBlock_BadParameters
......
......@@ -1334,12 +1334,15 @@ ReadSysInfo_InvalidReason
; bits 8-15 = I/O control chip type
; 0 => IOC
; 1 => IOMD
; 255 => none
; bits 16-23 = memory control chip type
; 0 => MEMC1/MEMC1a
; 1 => IOMD
; 255 => none
; bits 24-31 = video control chip type
; 0 => VIDC1a
; 1 => VIDC20
; 255 => none
; r1 = hardware configuration word 1
; bits 0-7 = I/O chip type
; 0 => absent
......@@ -1350,10 +1353,10 @@ ReadSysInfo_InvalidReason
; 0 => absent
; 1 => present (type 1) eg A4 portable
; 2 => present (type 2) eg Stork portable
; bits 8-15 = IOMD variant
; bits 8-15 = IOMD variant (when marked as present in word 0)
; 0 => IOMD
; 1 => IOMDL ie ARM7500 (Morris)
; bits 16-23 = VIDC20 variant
; bits 16-23 = VIDC20 variant (when marked as present in word 0)
; 0 => VIDC20
; 1 => VIDC2L ie ARM7500 (Morris)
; bits 24-31 = miscellaneous flags
......
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