Commit 6f9f922b authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Fix OS_Hardware 3 to be re-entrant

  s/HAL - OS_Hardware 3 (remove HAL device) will now re-scan the device list for the device following the Service_Hardware call, so that the device list won't become corrupt if the service call triggers addition/removal of devices.
  Tested on iMX6
  *HDMIOff now correctly removes the HDMI audio device and SoundDMA's software mixer device (SoundDMA removes mixer in response to the HDMI audio device vanishing, but re-entrancy bug meant that the HDMI device was left on the list)
  Note that this only covers re-entrancy via Service_Hardware. OS_Hardware 2/3/4/5 are not re-entrant from other locations (e.g. IRQ handlers or memory allocation service calls).

Version 6.12. Tagged as 'Kernel-6_12'
parent bcc668c7
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "6.11"
Module_Version SETA 611
Module_MajorVersion SETS "6.12"
Module_Version SETA 612
Module_MinorVersion SETS ""
Module_Date SETS "14 Jul 2018"
Module_ApplicationDate SETS "14-Jul-18"
Module_Date SETS "04 Aug 2018"
Module_ApplicationDate SETS "04-Aug-18"
Module_ComponentName SETS "Kernel"
Module_ComponentPath SETS "castle/RiscOS/Sources/Kernel"
Module_FullVersion SETS "6.11"
Module_HelpVersion SETS "6.11 (14 Jul 2018)"
Module_FullVersion SETS "6.12"
Module_HelpVersion SETS "6.12 (04 Aug 2018)"
/* (6.11)
/* (6.12)
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
#define Module_MajorVersion_CMHG 6.11
#define Module_MajorVersion_CMHG 6.12
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 14 Jul 2018
#define Module_Date_CMHG 04 Aug 2018
#define Module_MajorVersion "6.11"
#define Module_Version 611
#define Module_MajorVersion "6.12"
#define Module_Version 612
#define Module_MinorVersion ""
#define Module_Date "14 Jul 2018"
#define Module_Date "04 Aug 2018"
#define Module_ApplicationDate "14-Jul-18"
#define Module_ApplicationDate "04-Aug-18"
#define Module_ComponentName "Kernel"
#define Module_ComponentPath "castle/RiscOS/Sources/Kernel"
#define Module_FullVersion "6.11"
#define Module_HelpVersion "6.11 (14 Jul 2018)"
#define Module_LibraryVersionInfo "6:11"
#define Module_FullVersion "6.12"
#define Module_HelpVersion "6.12 (04 Aug 2018)"
#define Module_LibraryVersionInfo "6:12"
......@@ -2543,17 +2543,17 @@ HardwareDeviceAdd_Common
ADD r1, r1, #1
B %BT10
HardwareDeviceRemove_Common ROUT
Entry "r4"
LDR lr, =ZeroPage
LDR r3, [lr, #DeviceCount]
LDR r4, [lr, #DeviceTable]
TEQ r3, #0
EXIT EQ ; no devices registered
01 LDR r2, [r4], #4
10 LDR r2, [r4], #4
SUBS r3, r3, #1
TEQNE r2, r0
TEQ r2, r0
EXIT NE ; this device not registered
MOV r0, #1
......@@ -2562,12 +2562,24 @@ HardwareDeviceRemove_Common
CMP r1, #0 ; if service call claimed
CMPEQ r1, #1:SHL:31 ; then set V (r0 already points to error block)
EXIT VS ; and exit
; Search for device again - we may have been re-entered
MOV r0, r2
LDR lr, =ZeroPage
LDR r3, [lr, #DeviceCount]
LDR r4, [lr, #DeviceTable]
TEQ r3, #0
EXIT EQ ; no devices registered
20 LDR r2, [r4], #4
SUBS r3, r3, #1
TEQNE r2, r0
TEQ r2, r0
EXIT NE ; this device not registered
SUBS r3, r3, #1
02 LDRCS r2, [r4], #4 ; copy down remaining devices
30 LDRCS r2, [r4], #4 ; copy down remaining devices
STRCS r2, [r4, #-8]
SUBCSS r3, r3, #1
LDR lr, =ZeroPage
LDR r3, [lr, #DeviceCount]
SUB r3, r3, #1
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