Commit 36062ff5 authored by Jeffrey Lee's avatar Jeffrey Lee

Tweak handling of zero page compatibility page

Detail:
  s/MemInfo, hdr/KernelWS - Rather than peeking L2PT to determine if the compatibility page is enabled, use a workspace var to track its state. This ensures we won't get confused if other software decides to map something of its own to &0.
  s/NewReset - Ensure the CompatibilityPageEnabled flag is initialised correctly
Admin:
  Tested in Iyonix ROM softload


Version 5.90. Tagged as 'Kernel-5_90'
parent ac1ea0f5
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.89"
Module_Version SETA 589
Module_MajorVersion SETS "5.90"
Module_Version SETA 590
Module_MinorVersion SETS ""
Module_Date SETS "09 Sep 2017"
Module_ApplicationDate SETS "09-Sep-17"
Module_Date SETS "07 Oct 2017"
Module_ApplicationDate SETS "07-Oct-17"
Module_ComponentName SETS "Kernel"
Module_ComponentPath SETS "castle/RiscOS/Sources/Kernel"
Module_FullVersion SETS "5.89"
Module_HelpVersion SETS "5.89 (09 Sep 2017)"
Module_FullVersion SETS "5.90"
Module_HelpVersion SETS "5.90 (07 Oct 2017)"
END
/* (5.89)
/* (5.90)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 5.89
#define Module_MajorVersion_CMHG 5.90
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 09 Sep 2017
#define Module_Date_CMHG 07 Oct 2017
#define Module_MajorVersion "5.89"
#define Module_Version 589
#define Module_MajorVersion "5.90"
#define Module_Version 590
#define Module_MinorVersion ""
#define Module_Date "09 Sep 2017"
#define Module_Date "07 Oct 2017"
#define Module_ApplicationDate "09-Sep-17"
#define Module_ApplicationDate "07-Oct-17"
#define Module_ComponentName "Kernel"
#define Module_ComponentPath "castle/RiscOS/Sources/Kernel"
#define Module_FullVersion "5.89"
#define Module_HelpVersion "5.89 (09 Sep 2017)"
#define Module_LibraryVersionInfo "5:89"
#define Module_FullVersion "5.90"
#define Module_HelpVersion "5.90 (07 Oct 2017)"
#define Module_LibraryVersionInfo "5:90"
......@@ -1235,6 +1235,11 @@ DebuggerSpace_Size * ?DebuggerSpace
|
DebuggerSpace * &2000 ; Debugger gets a page all to itself!
DebuggerSpace_Size * &1000
[ CompatibilityPage
CompatibilityPageEnabled # 1 ; 0 or 1 as appropriate
]
AlignSpace
]
IICBus_Count * 5 ; 5 buses is enough for all current machines
......
......@@ -1182,8 +1182,8 @@ MAI_CompatibilityPage
[ CompatibilityPage
MOV r1, #0
MOV r2, #4096
LDR r0, =L2PT
LDR r3, [r0]
LDR r0, =ZeroPage
LDRB r3, [r0,#CompatibilityPageEnabled]
CMP r3, #0
MOVNE r3, #4096
]
......@@ -1368,15 +1368,20 @@ ChangeCompatibility ROUT
MOV pc, lr
|
Entry "r0-r11", DANode_NodeSize
; Peek L2PT to see if anything's mapped to &0
LDR r8, =L2PT
LDR r0, [r8]
CMP r0, #0
MOVNE r0, #1
FRAMSTR r0,,r1 ; return pre-change state in r1
LDR r12, =ZeroPage
LDRB r0, [r12, #CompatibilityPageEnabled]
FRAMSTR r0,,r1 ; return pre-change state in r1 (will be updated later, as necessary)
CMP r1, #-1
CMPNE r0, r1
EXIT EQ
; If we're attempting to enable it, make sure nothing else has mapped itself in to page zero
LDR r8, =L2PT
CMP r1, #0
LDRNE r0, [r8]
CMPNE r0, #0
MOVNE r1, #-1
FRAMSTR r1,NE
EXIT NE
; Set up temp DANode on the stack so we can use a Batcall to manage the mapping
MOV r2, sp
MOV r0, #DynAreaFlags_NotCacheable
......@@ -1398,6 +1403,7 @@ ChangeCompatibility ROUT
; If we just enabled the page, fill it with the special value and then change it to read-only
FRAMLDR r1
RSBS r1, r1, #1 ; invert returned state, to be correct for the above action
STRB r1, [r12, #CompatibilityPageEnabled] ; Also update our state flag
FRAMSTR r1
EXIT EQ
MOV r0, #0
......@@ -1408,7 +1414,6 @@ ChangeCompatibility ROUT
STR r2, [r0], #4
CMP r0, #4096
BNE %BT10
LDR r12, =ZeroPage
LDR r7, [r12, #MaxCamEntry]
MOV r4, #0
BL logical_to_physical
......@@ -1509,8 +1514,8 @@ CheckMemoryAccess ROUT
|
[ CompatibilityPage
; Zero page compatibility page
LDR r3, =L2PT
LDR r3, [r3]
LDR r3, =ZeroPage
LDRB r3, [r3, #CompatibilityPageEnabled]
CMP r3, #0
BEQ %FT05
MOV r3, #0
......
......@@ -211,8 +211,11 @@ DatCopy
LDR r0, =ZeroPage
STR r2, [r0, #ResetIndirection]
MOV r3, #0 ; initialise abort list
MOV r3, #0 ; zero-initialise abort list, and other key workspace
STR r3, [r0, #AbortIndirection]
[ CompatibilityPage
STRB r3, [r0, #CompatibilityPageEnabled]
]
; Now the SWI despatch + low part of SWI table
ADRL R3, DirtyBranch
......
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