Commit 3ef9cca5 authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Clear the exclusive monitor when returning to a pre-empted task

Detail:
  s/Taskman - As described in the ARM ARM, the local exclusive monitor is allowed to be a bit dumb when it comes to comparing addresses, and so a manual CLREX is required whenever we return to code that has been unwillingly pre-empted
Admin:
  Tested on Raspberry Pi


Version 0.79. Tagged as 'TaskWindow-0_79'
parent 5e279358
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.78"
Module_Version SETA 78
Module_MajorVersion SETS "0.79"
Module_Version SETA 79
Module_MinorVersion SETS ""
Module_Date SETS "28 May 2016"
Module_ApplicationDate SETS "28-May-16"
Module_Date SETS "15 Jun 2016"
Module_ApplicationDate SETS "15-Jun-16"
Module_ComponentName SETS "TaskWindow"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/TaskWindow"
Module_FullVersion SETS "0.78"
Module_HelpVersion SETS "0.78 (28 May 2016)"
Module_FullVersion SETS "0.79"
Module_HelpVersion SETS "0.79 (15 Jun 2016)"
END
/* (0.78)
/* (0.79)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.78
#define Module_MajorVersion_CMHG 0.79
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 28 May 2016
#define Module_Date_CMHG 15 Jun 2016
#define Module_MajorVersion "0.78"
#define Module_Version 78
#define Module_MajorVersion "0.79"
#define Module_Version 79
#define Module_MinorVersion ""
#define Module_Date "28 May 2016"
#define Module_Date "15 Jun 2016"
#define Module_ApplicationDate "28-May-16"
#define Module_ApplicationDate "15-Jun-16"
#define Module_ComponentName "TaskWindow"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/TaskWindow"
#define Module_FullVersion "0.78"
#define Module_HelpVersion "0.78 (28 May 2016)"
#define Module_LibraryVersionInfo "0:78"
#define Module_FullVersion "0.79"
#define Module_HelpVersion "0.79 (15 Jun 2016)"
#define Module_LibraryVersionInfo "0:79"
......@@ -34,6 +34,7 @@
GET Hdr:FPEmulator
GET Hdr:PublicWS
GET Hdr:OSRSI6
GET Hdr:OSMisc
GET VersionASM
GBLL CheckBufferPointers
......@@ -81,6 +82,29 @@ CheckBufferPointers SETL {FALSE}
]
MEND
MACRO
MyCLREX $temp1, $temp2
; Returning to code that was pre-empted, so CLREX required
[ NoARMv6
[ SupportARMv6
; Need to support both old and new architectures
LDR $temp1, GlobalWS
LDR $temp2, [$temp1, #:INDEX:PlatFeatures]
TST $temp2, #CPUFlag_LoadStoreEx
SUB $temp1, r13, #4
STREXNE $temp2, $temp1, [$temp1]
]
ELIF NoARMK
; ARMv6, need dummy STREX
; Use the word below SP
SUB $temp1, r13, #4
STREX $temp2, $temp1, [$temp1]
|
; ARMv6K+, have CLREX
CLREX
]
MEND
GBLL StrongARM
GBLL SASTMhatbroken
StrongARM SETL {TRUE}
......@@ -518,6 +542,13 @@ Code_InitEntry ROUT
LDREQ r2, =&01F033FC
STR r2, SvcTable
[ NoARMv6 :LAND: SupportARMv6
MOV r0, #OSPlatformFeatures_ReadCodeFeatures
SWI XOS_PlatformFeatures
MOVVS r0, #0
STR r0, PlatFeatures
]
[ DoingSwi
BL Claim_SWIs
]
......@@ -3846,6 +3877,7 @@ Code_CallBackHandler ROUT
CheckOut
]
MyCLREX r0, r1
ADR r14, CallBackRegs
LDMIA r14, {r0-r14}^ ; get USR registers
NOP
......@@ -3874,6 +3906,7 @@ Code_CallBackHandler ROUT
40
CheckOut
50
MyCLREX r0, r1
ADR r14, CallBackRegs
TEQ PC,PC
LDREQ r0, [r14, #16*4] ; The CPSR
......@@ -5273,6 +5306,9 @@ MyWriteEnv Word 2 ; space for RAM code
MyWriteEnv_CodeAddr Word ; must follow MyWriteEnv
MOS_WriteEnv Word ; previous OS_WriteEnv handler
SvcTable Word ; address of Kernel SWI despatch table
[ NoARMv6 :LAND: SupportARMv6
PlatFeatures Word ; OS_PlatformFeatures 0 flags
]
GlobalWorkSpaceSize * :INDEX:@
......
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