Commit a0f4966c authored by Mike Stephens's avatar Mike Stephens
Browse files

Changes to Lazy task swapping to support abort handler in abort mode (now that we can count to 32).

LazyFixup now ensures all app pages are mapped in before handing
on a real (no-lazy) abort. This allows an abort handler in app
space itself, without scrambling the details of the original
abort (via a lazy abort in abort mode).
Many a happy minute spent coding and testing for recursive
aborts and fixups, but lets just pretend it doesn't happen
shall we.
Tested with simple popbang code on ARM9 desktop build.

Version 5.35, 4.79.2.36. Tagged as 'Kernel-5_35-4_79_2_36'
parent f35516b7
......@@ -13,12 +13,12 @@
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.35"
Module_Version SETA 535
Module_MinorVersion SETS "4.79.2.35"
Module_MinorVersion SETS "4.79.2.36"
Module_Date SETS "13 Jun 2001"
Module_ApplicationDate2 SETS "13-Jun-01"
Module_ApplicationDate4 SETS "13-Jun-2001"
Module_ComponentName SETS "Kernel"
Module_ComponentPath SETS "RiscOS/Sources/Kernel"
Module_FullVersion SETS "5.35 (4.79.2.35)"
Module_HelpVersion SETS "5.35 (13 Jun 2001) 4.79.2.35"
Module_FullVersion SETS "5.35 (4.79.2.36)"
Module_HelpVersion SETS "5.35 (13 Jun 2001) 4.79.2.36"
END
......@@ -4,12 +4,12 @@
*
*/
#define Module_MajorVersion_CMHG 5.35
#define Module_MinorVersion_CMHG 4.79.2.35
#define Module_MinorVersion_CMHG 4.79.2.36
#define Module_Date_CMHG 13 Jun 2001
#define Module_MajorVersion "5.35"
#define Module_Version 535
#define Module_MinorVersion "4.79.2.35"
#define Module_MinorVersion "4.79.2.36"
#define Module_Date "13 Jun 2001"
#define Module_ApplicationDate2 "13-Jun-01"
......@@ -18,5 +18,5 @@
#define Module_ComponentName "Kernel"
#define Module_ComponentPath "RiscOS/Sources/Kernel"
#define Module_FullVersion "5.35 (4.79.2.35)"
#define Module_HelpVersion "5.35 (13 Jun 2001) (4.79.2.35)"
#define Module_FullVersion "5.35 (4.79.2.36)"
#define Module_HelpVersion "5.35 (13 Jun 2001) (4.79.2.36)"
......@@ -63,19 +63,19 @@ AMB_LazyFixUp ROUT
MOV r12,#AMBControl_ws
LDR r12,[r12]
CMP r12,#0
BEQ %FT20
BEQ %FT90 ;not initialised!
LDR r1,AMBFlags
TST r1,#AMBFlag_LazyMapIn_disable :OR: AMBFlag_LazyMapIn_suspend
BNE %FT20
SUBS r0,r0,#ApplicationStart
BMI %FT20
MOV r0,r0,LSR #Log2PageSize ;address now in terms of pages from ApplicationStart
BNE %FT90 ;not active
LDR r1,AMBMappedInNode
CMP r1,#0
BEQ %FT20
BEQ %FT90 ;no current node
LDR r2,[r1,#AMBNode_Npages]
SUBS r0,r0,#ApplicationStart
BMI %FT20 ;abort not in current app space
MOV r0,r0,LSR #Log2PageSize ;address now in terms of pages from ApplicationStart
CMP r2,r0
BLS %FT20
BLS %FT20 ;abort not in current app space
;
; check/update the MappedIn bitmap
;
......@@ -119,7 +119,28 @@ AMB_LazyFixUp ROUT
STMIA r5,{r0,r1} ;update CAM entry
MOV r12,r7
MOV pc,lr ;r0 is non-zero, NE status
;
; not our abort, but is possible that client abort handler is in app space, so force all
; app space pages in now (so that client abort handler does not cause lazy abort, scribbling over original abort details)
;
ASSERT No26bitCode ;assumes we have an abort stack! (recursive lazy fixup aborts may occur)
20
MOV r1,#ApplicationStart ;good old page walk to provoke lazy fixups
LDR r2,AMBMappedInNode
LDR r2,[r2,#AMBNode_Npages]
CMP r2,#0
BEQ %FT90
MRS r0,SPSR ;preserve SPSR_abort for original abort details
MOV r4,lr ;preserve lr_abort so we can return properly (!)
30
LDR r3,[r1] ;bring that page in by the magic of aborts
SUBS r2,r2,#1
ADD r1,r1,#PageSize
BNE %BT30
MSR SPSR_all,r0 ;SPSR for original abort
MOV lr,r4 ;restore return address
;
90
MOVS r0,#0
MOV r12,r7
MOV pc,lr ;r0 is zero, EQ status
......
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