Commit a7892833 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Expose CLREX via OS_PlatformFeatures

To account for ARM changing their minds about how to clear the exclusive lock on different architectures, provide a function pointer with a known good implementation. This is similar to the run of NOPs returned by OS_PlatformFeatures 0 for those that need it.
If in the future any errata or similar are needed, then there's only 1 place to change it, plus clients don't need their own CPU type detection logic.

Version 5.77. Tagged as 'Kernel-5_77'
parent b375500e
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.76"
Module_Version SETA 576
Module_MajorVersion SETS "5.77"
Module_Version SETA 577
Module_MinorVersion SETS ""
Module_Date SETS "11 Jan 2017"
Module_ApplicationDate SETS "11-Jan-17"
Module_Date SETS "09 Feb 2017"
Module_ApplicationDate SETS "09-Feb-17"
Module_ComponentName SETS "Kernel"
Module_ComponentPath SETS "castle/RiscOS/Sources/Kernel"
Module_FullVersion SETS "5.76"
Module_HelpVersion SETS "5.76 (11 Jan 2017)"
Module_FullVersion SETS "5.77"
Module_HelpVersion SETS "5.77 (09 Feb 2017)"
END
/* (5.76)
/* (5.77)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 5.76
#define Module_MajorVersion_CMHG 5.77
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 11 Jan 2017
#define Module_Date_CMHG 09 Feb 2017
#define Module_MajorVersion "5.76"
#define Module_Version 576
#define Module_MajorVersion "5.77"
#define Module_Version 577
#define Module_MinorVersion ""
#define Module_Date "11 Jan 2017"
#define Module_Date "09 Feb 2017"
#define Module_ApplicationDate "11-Jan-17"
#define Module_ApplicationDate "09-Feb-17"
#define Module_ComponentName "Kernel"
#define Module_ComponentPath "castle/RiscOS/Sources/Kernel"
#define Module_FullVersion "5.76"
#define Module_HelpVersion "5.76 (11 Jan 2017)"
#define Module_LibraryVersionInfo "5:76"
#define Module_FullVersion "5.77"
#define Module_HelpVersion "5.77 (09 Feb 2017)"
#define Module_LibraryVersionInfo "5:77"
......@@ -22,6 +22,7 @@ OSPlatformFeatures_ReadCodeFeatures * 0
OSPlatformFeatures_ReadProcessorVectors * 32
OSPlatformFeatures_ReadCacheInfo * 33
OSPlatformFeatures_ReadCPUFeatures * 34
OSPlatformFeatures_ReadClearExclusive * 35
; These flags are returned by OS_PlatformFeatures 0 (Read code features)
......
......@@ -1433,6 +1433,7 @@ Issue_Service_SWI ROUT
; 32 -> read processor vectors location
; 33 -> read cache information
; 34 -> read CPU features
; 35 -> read routine to clear the exclusive monitor lock
PlatFeatSWI ROUT
Push lr
......@@ -1442,8 +1443,10 @@ PlatFeatSWI ROUT
BEQ %FT40
CMP r0, #OSPlatformFeatures_ReadCPUFeatures
BEQ PlatFeatSWI_ReadCPUFeatures
CMP r0, #OSPlatformFeatures_ReadClearExclusive
BEQ %FT50
CMP r0, #OSPlatformFeatures_ReadCodeFeatures
BNE %FT50 ;No, so send out a service call
BNE %FT75 ; No, so error
;Ok, it's the 'code_features' reason code.
[ ZeroPage <> 0
......@@ -1493,20 +1496,24 @@ platfeat_irqinsert
B SLVK
50
[ {FALSE}
Push "r1-r8"
MOV r1, #Service_UnknownPlatformFeatures
Pull "r2-r9"
BL Issue_Service
CMP r1, #0
Push "r2-r9"
Pull "r1-r8"
BNE %FT75
; Read clear the exclusive routine
LDR r14, =ZeroPage
LDR r14, [r14, #ProcessorFlags]
TST r14, #CPUFlag_LoadStoreEx :OR: CPUFlag_LoadStoreClearExSizes
ADRNE r1, platfeat_clrex ; Can set the lock, so point R1 to the clear routine
MOVEQ r1, #0
Pull lr
B SLVK ;Return
]
B SLVK
platfeat_clrex
; => SP = a full descending stack
; LR = return address
; <= all registers preserved, lock cleared
Push "r0, lr"
MyCLREX r0, r14
Pull "r0, pc"
75 ;Get here if the service call isn't claimed.
75 ; Get here if bad reason
ADR R0, ErrorBlock_BadPlatReas
[ International
BL TranslateError
......
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