Commit 2b88f4fb authored by Ben Avison's avatar Ben Avison
Browse files

Added OS_Hardware 5

Detail:
  This functions like OS_Hardware 4, but enumerates devices in the
  chronological order of registration.
Admin:
  Builds, but untested.

Version 5.35, 4.79.2.160. Tagged as 'Kernel-5_35-4_79_2_160'
parent c671badb
......@@ -13,11 +13,11 @@
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.35"
Module_Version SETA 535
Module_MinorVersion SETS "4.79.2.159"
Module_Date SETS "04 Jul 2012"
Module_ApplicationDate SETS "04-Jul-12"
Module_MinorVersion SETS "4.79.2.160"
Module_Date SETS "06 Jul 2012"
Module_ApplicationDate SETS "06-Jul-12"
Module_ComponentName SETS "Kernel"
Module_ComponentPath SETS "castle/RiscOS/Sources/Kernel"
Module_FullVersion SETS "5.35 (4.79.2.159)"
Module_HelpVersion SETS "5.35 (04 Jul 2012) 4.79.2.159"
Module_FullVersion SETS "5.35 (4.79.2.160)"
Module_HelpVersion SETS "5.35 (06 Jul 2012) 4.79.2.160"
END
......@@ -5,19 +5,19 @@
*
*/
#define Module_MajorVersion_CMHG 5.35
#define Module_MinorVersion_CMHG 4.79.2.159
#define Module_Date_CMHG 04 Jul 2012
#define Module_MinorVersion_CMHG 4.79.2.160
#define Module_Date_CMHG 06 Jul 2012
#define Module_MajorVersion "5.35"
#define Module_Version 535
#define Module_MinorVersion "4.79.2.159"
#define Module_Date "04 Jul 2012"
#define Module_MinorVersion "4.79.2.160"
#define Module_Date "06 Jul 2012"
#define Module_ApplicationDate "04-Jul-12"
#define Module_ApplicationDate "06-Jul-12"
#define Module_ComponentName "Kernel"
#define Module_ComponentPath "castle/RiscOS/Sources/Kernel"
#define Module_FullVersion "5.35 (4.79.2.159)"
#define Module_HelpVersion "5.35 (04 Jul 2012) 4.79.2.159"
#define Module_FullVersion "5.35 (4.79.2.160)"
#define Module_HelpVersion "5.35 (06 Jul 2012) 4.79.2.160"
#define Module_LibraryVersionInfo "5:35"
......@@ -185,6 +185,7 @@ OSHW_LookupRoutine # 1
OSHW_DeviceAdd # 1
OSHW_DeviceRemove # 1
OSHW_DeviceEnumerate # 1
OSHW_DeviceEnumerateChrono # 1
OSHW_MaxSubreason # 1 ; Used in despatch inside Kernel
; NVMemory
......
......@@ -2314,10 +2314,12 @@ HardwareSWI
BLO HardwareDeviceAdd
BEQ HardwareDeviceRemove
CMP ip, #OSHW_MaxSubreason
ASSERT OSHW_DeviceEnumerate < OSHW_MaxSubreason
CMP ip, #OSHW_DeviceEnumerateChrono
ASSERT OSHW_DeviceEnumerate < OSHW_DeviceEnumerateChrono
ASSERT OSHW_DeviceEnumerateChrono < OSHW_MaxSubreason
BLO HardwareDeviceEnumerate
BHS HardwareBadReason
BEQ HardwareDeviceEnumerateChrono
BHI HardwareBadReason
HardwareCallHAL
Push "v1-v4,sb,lr"
......@@ -2482,6 +2484,33 @@ HardwareDeviceEnumerate
Pull "r3-r4,lr"
ExitSWIHandler
HardwareDeviceEnumerateChrono
Push "r3-r4,lr"
LDR lr, =ZeroPage
LDR r2, [lr, #DeviceCount]
LDR r3, [lr, #DeviceTable]
SUBS r4, r2, r1
MOVLS r1, #-1
BLS %FT90 ; if r1 is out of range then exit
ADD r3, r3, r4, LSL #2
10 ADD r1, r1, #1
LDR r2, [r3, #-4]!
LDR lr, [r2, #HALDevice_Type]
EOR lr, lr, r0
MOVS lr, lr, LSL #16 ; EQ if types match
SUBNES r4, r4, #1
BNE %BT10
TEQ lr, #0
MOVNE r1, #-1
BNE %FT90
LDR lr, [r2, #HALDevice_Version]
MOV lr, lr, LSR #16
CMP lr, r0, LSR #16 ; newer than our client understands?
BHI %BT10
90
Pull "r3-r4,lr"
ExitSWIHandler
HardwareBadReason
ADR r0, ErrorBlock_HardwareBadReason
[ International
......
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