GitLab has been upgraded to 13.7.4 If you encounter any issues mail code@riscosopen.org

Commit 60741ecc authored by Jeffrey Lee's avatar Jeffrey Lee

Merge with HAL branch

Detail:
  Merge the HAL branch into the RPi branch, prior to merging RPi to HAL
  Brief summary of main changes brought in:
  * Added *cache functionality previously provided by ARM module
  * Added "CMOS RAM reset" message on startup when CMOS has been wiped by keypress
  * Renamed HAL Video entries from HAL_Video_XXX to HAL_VideoXXX
  * Dropped mjsHAL macros, GRAB/STASH macros
  * Fixed pseudo-VRAM allocation when machine has exactly 16MB of RAM
  * Added OS_Hardware 5
  * Use OS_SerialOp GetDeviceName for getting serial device name
  * Drop HAL_MonitorLeadID
  * Rework default GraphicsV_IICOp handler
Admin:
  Tested on Raspberry Pi with high processor vectors


Version 5.35, 4.79.2.147.2.23. Tagged as 'Kernel-5_35-4_79_2_147_2_23'
parents 5c0a0186 3076256e
......@@ -252,6 +252,13 @@ Build_Syntax
= "Syntax: *",TokenEscapeChar,Token0
= " <filename>", 0
Cache_Help
= "*",TokenEscapeChar,Token0
= " turns the cache on or off, or gives the cache state.",13
Cache_Syntax
= "Syntax: *",TokenEscapeChar,Token0
= " [On|Off]", 0
Close_Help
= "*",TokenEscapeChar,Token0
= " closes all files on the current filing system.",13
......@@ -494,6 +501,8 @@ Append_Help DCB "HUTMAPP", 0
Append_Syntax DCB "SUTMAPP", 0
Build_Help DCB "HUTMBUI", 0
Build_Syntax DCB "SUTMBUI", 0
Cache_Help DCB "HUTMCAC", 0
Cache_Syntax DCB "SUTMCAC", 0
Close_Help DCB "HUTMCLO", 0
Close_Syntax DCB "SUTMCLO", 0
Create_Help DCB "HUTMCRE", 0
......
No preview for this file type
......@@ -151,7 +151,8 @@ BadMSFlags:Illegal flags in mode selector
CDATStackOverflow:System stack overflow
NoSuchSWI:SWI not known
BadSav:Incorrect number of parameters for *Save
MonType:Monitor type reconfigured.
CmosRst:CMOS RAM reset, press ESCAPE to continue
MonType:Monitor type reconfigured
NoKbd:No keyboard present - autobooting
BreakPt:Stopped at break point at &%0
STail:|J|MUse *Configure to set the options.|J|M
......
......@@ -151,7 +151,8 @@ BadMSFlags:Illegal flags in mode selector
CDATStackOverflow:System stack overflow
NoSuchSWI:SWI not known
BadSav:Incorrect number of parameters for *Save
MonType:Monitor type reconfigured.
CmosRst:CMOS RAM reset, press ESCAPE to continue
MonType:Monitor type reconfigured
NoKbd:No keyboard present - autobooting
BreakPt:Stopped at break point at &%0
STail:|J|MUse *Configure to set the options.|J|M
......
......@@ -151,7 +151,8 @@ BadMSFlags:Illegal flags in mode selector
CDATStackOverflow:System stack overflow
NoSuchSWI:SWI not known
BadSav:Incorrect number of parameters for *Save
MonType:Monitor type reconfigured.
CmosRst:CMOS RAM reset, press ESCAPE to continue
MonType:Monitor type reconfigured
NoKbd:No keyboard present - autobooting
BreakPt:Stopped at break point at &%0
STail:|J|MUse *Configure to set the options.|J|M
......
......@@ -151,7 +151,8 @@ BadMSFlags:Illegal flags in mode selector
CDATStackOverflow:System stack overflow
NoSuchSWI:SWI not known
BadSav:Incorrect number of parameters for *Save
MonType:Monitor type reconfigured.
CmosRst:CMOS RAM reset, press ESCAPE to continue
MonType:Monitor type reconfigured
NoKbd:No keyboard present - autobooting
BreakPt:Stopped at break point at &%0
STail:|J|MUse *Configure to set the options.|J|M
......
......@@ -13,11 +13,11 @@
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.35"
Module_Version SETA 535
Module_MinorVersion SETS "4.79.2.147.2.22"
Module_MinorVersion SETS "4.79.2.147.2.23"
Module_Date SETS "18 Sep 2012"
Module_ApplicationDate SETS "18-Sep-12"
Module_ComponentName SETS "Kernel"
Module_ComponentPath SETS "castle/RiscOS/Sources/Kernel"
Module_FullVersion SETS "5.35 (4.79.2.147.2.22)"
Module_HelpVersion SETS "5.35 (18 Sep 2012) 4.79.2.147.2.22"
Module_FullVersion SETS "5.35 (4.79.2.147.2.23)"
Module_HelpVersion SETS "5.35 (18 Sep 2012) 4.79.2.147.2.23"
END
......@@ -5,12 +5,12 @@
*
*/
#define Module_MajorVersion_CMHG 5.35
#define Module_MinorVersion_CMHG 4.79.2.147.2.22
#define Module_MinorVersion_CMHG 4.79.2.147.2.23
#define Module_Date_CMHG 18 Sep 2012
#define Module_MajorVersion "5.35"
#define Module_Version 535
#define Module_MinorVersion "4.79.2.147.2.22"
#define Module_MinorVersion "4.79.2.147.2.23"
#define Module_Date "18 Sep 2012"
#define Module_ApplicationDate "18-Sep-12"
......@@ -18,6 +18,6 @@
#define Module_ComponentName "Kernel"
#define Module_ComponentPath "castle/RiscOS/Sources/Kernel"
#define Module_FullVersion "5.35 (4.79.2.147.2.22)"
#define Module_HelpVersion "5.35 (18 Sep 2012) 4.79.2.147.2.22"
#define Module_FullVersion "5.35 (4.79.2.147.2.23)"
#define Module_HelpVersion "5.35 (18 Sep 2012) 4.79.2.147.2.23"
#define Module_LibraryVersionInfo "5:35"
......@@ -40,6 +40,7 @@ HALDevice_GPIO_Size * :INDEX: @
GPIOType_OMAP3_BeagleBoard # 1 ; It's a BeagleBoard or BB-xM
GPIOType_OMAP3_DevKit8000 # 1 ; It's a DevKit 8000
GPIOType_OMAP3_IGEPv2 # 1 ; It's an IGEP v2
GPIOType_OMAP3_Pandora # 1 ; It's a Pandora
; BeagleBoard revision values:
......
......@@ -75,20 +75,20 @@ EntryNo_HAL_IICTransfer # 1 ; 36
EntryNo_HAL_IICMonitorTransfer # 1 ; 37
EntryNo_HAL_VideoFlybackDevice # 1 ; 38
EntryNo_HAL_Video_SetMode # 1 ; 39
EntryNo_HAL_Video_WritePaletteEntry # 1 ; 40
EntryNo_HAL_Video_WritePaletteEntries # 1 ; 41
EntryNo_HAL_Video_ReadPaletteEntry # 1 ; 42
EntryNo_HAL_Video_SetInterlace # 1 ; 43
EntryNo_HAL_Video_SetBlank # 1 ; 44
EntryNo_HAL_Video_SetPowerSave # 1 ; 45
EntryNo_HAL_Video_UpdatePointer # 1 ; 46
EntryNo_HAL_Video_SetDAG # 1 ; 47
EntryNo_HAL_Video_VetMode # 1 ; 48
EntryNo_HAL_Video_PixelFormats # 1 ; 49
EntryNo_HAL_Video_Features # 1 ; 50
EntryNo_HAL_Video_BufferAlignment # 1 ; 51
EntryNo_HAL_Video_OutputFormat # 1 ; 52
EntryNo_HAL_VideoSetMode # 1 ; 39
EntryNo_HAL_VideoWritePaletteEntry # 1 ; 40
EntryNo_HAL_VideoWritePaletteEntries # 1 ; 41
EntryNo_HAL_VideoReadPaletteEntry # 1 ; 42
EntryNo_HAL_VideoSetInterlace # 1 ; 43
EntryNo_HAL_VideoSetBlank # 1 ; 44
EntryNo_HAL_VideoSetPowerSave # 1 ; 45
EntryNo_HAL_VideoUpdatePointer # 1 ; 46
EntryNo_HAL_VideoSetDAG # 1 ; 47
EntryNo_HAL_VideoVetMode # 1 ; 48
EntryNo_HAL_VideoPixelFormats # 1 ; 49
EntryNo_HAL_VideoFeatures # 1 ; 50
EntryNo_HAL_VideoBufferAlignment # 1 ; 51
EntryNo_HAL_VideoOutputFormat # 1 ; 52
EntryNo_HAL_MatrixColumns # 1 ; 53
EntryNo_HAL_MatrixScan # 1 ; 54
......@@ -155,31 +155,41 @@ EntryNo_HAL_PhysInfo # 1 ; 105
EntryNo_HAL_USBControllerInfo # 1 ; 106
EntryNo_HAL_MonitorLeadID # 1 ; 107
# 1 ; 107 (was HAL_MonitorLeadID)
EntryNo_HAL_Video_Render # 1 ; 108
EntryNo_HAL_VideoRender # 1 ; 108
EntryNo_HAL_USBPortPower # 1 ; 109
EntryNo_HAL_USBPortStatus # 1 ; 110
EntryNo_HAL_USBPortIRQ # 1 ; 111
EntryNo_HAL_Video_IICOp # 1 ; 112
EntryNo_HAL_VideoIICOp # 1 ; 112
EntryNo_HAL_TimerIRQClear # 1 ; 113
EntryNo_HAL_TimerIRQStatus # 1 ; 114
EntryNo_HAL_ExtMachineID # 1 ; 115, ReadSysInfo 10
EntryNo_HAL_Video_FramestoreAddress # 1 ; 116
EntryNo_HAL_VideoFramestoreAddress # 1 ; 116
EntryNo_HAL_UARTDefault # 1 ; 117
EntryNo_HAL_Video_StartupMode # 1 ; 118
EntryNo_HAL_VideoStartupMode # 1 ; 118
KnownHALEntries # 0 ; Used inside Kernel
KnownHALEntries # 0 ; Used inside Kernel
; Various flags and constants
; OS_Hardware subreasons
^ 0
OSHW_CallHAL # 1
OSHW_LookupRoutine # 1
OSHW_DeviceAdd # 1
OSHW_DeviceRemove # 1
OSHW_DeviceEnumerate # 1
OSHW_DeviceEnumerateChrono # 1
OSHW_MaxSubreason # 1 ; Used in despatch inside Kernel
; PhysInfo
^ 0
PhysInfo_GetTableSize # 1
......@@ -200,11 +210,22 @@ NVMemoryFlag_LowWrite * 1:SHL:11 ; locations 0-15 are writeable
; IIC
IICFlag_LowLevel * 1:SHL:0
IICFlag_HighLevel * 1:SHL:1
IICFlag_Background * 1:SHL:4
IICFlag_Fast * 1:SHL:16
IICFlag_HighSpeed * 1:SHL:17
IICFlag_LowLevel * 1:SHL:0
IICFlag_HighLevel * 1:SHL:1
IICFlag_MultiMaster * 1:SHL:2
IICFlag_Slave * 1:SHL:3
IICFlag_Background * 1:SHL:4
IICFlag_Fast * 1:SHL:16
IICFlag_HighSpeed * 1:SHL:17
IICFlag_ProtocolVersionShift * 20
IICFlag_ProtocolVersionMask * &FFF ; IIC protocol version x100
^ 0
IICStatus_Completed # 1 ; High level API return codes
IICStatus_InProgress # 1
IICStatus_NoACK # 1
IICStatus_Busy # 1
IICStatus_Slave # 1
IICStatus_Error # 1
; Keyboard scan
......
......@@ -1169,16 +1169,12 @@ CLine_Softcopy # 1 ; Added for Morris - Monitor id
VRAMWidth # 1 ; 0 => no VRAM, 1 => 32-bits wide, 2 => 64-bits wide
[ {FALSE} ;;; mjsHAL no LCD support
LCD_Active # 1 ; Added to support LCD/CRT switching. bm 6 bits 0=>External CRT in use, 1=>Mono, 2=>Passive colour, 3=>Active colour
; bit 7 unset=>single panel, set=>dual panel
LCD_Inverted # 1 ; Added to support LCD palette inversion. 0=normal, 1=inverted. Note that the inversion is invisible to apps.
[ :DEF: ShowWS
! 0, "LCD_Active flag byte held at ":CC::STR:(LCD_Active)
]
|
# 2 ; SPARE
]
]
[ HAL
......@@ -1398,18 +1394,8 @@ ChocolateMSBlocks # 4 ; -> array of blocks for module SWI hash n
! 0, "ChocolateMSBlocks at ":CC::STR:(ChocolateMSBlocks)
]
[ :LNOT: HAL
mjs_tempHALworkspace # 4 ; required only temporarily for semi-HALised code still in RO kernel
[ :DEF: ShowWS
! 0, "*** mjs_tempHALworkspace should be removed when kernel/HAL split permits"
]
; !!!! Free Space (36 bytes)
OldSWIHashspace # 9*4
|
; !!!! Free Space (40 bytes)
OldSWIHashspace # 10*4
]
|
; !!!! Free Space (64 bytes)
OldSWIHashspace # 16*4
......@@ -1493,7 +1479,8 @@ MOShasFIQ # 1
FIQclaim_interlock # 1
CallBack_Flag # 1
IRQ_CallBack_Flag * CallBack_Flag
MonitorLeadType # 1 ; some function of the monitor lead inputs, as yet undetermined
MonitorLeadType # 1 ; some function of the monitor lead inputs, as yet undetermined
MentionCMOSReset # 1 ; non zero reports CMOS resets prior to the start banner
AlignSpace
......
......@@ -32,10 +32,7 @@ VersionNo SETS "$VString ($Date)"
VersionNo SETS "$VString ($Date) $Module_MinorVersion"
]
; SystemName moved to Machine.* header files.
GBLS MosTitle
MosTitle SETS "$SystemName $VersionNo"
MosVer * 6 ; As returned by OS_Byte 0
GBLL AddTubeBashers
AddTubeBashers SETL {FALSE}
......
......@@ -218,11 +218,9 @@ wp RN r12 ; Workspace Pointer
WP RN r12
WsPtr RN r12
sp RN r13 ; Stack Pointer
SP RN r13
sp_irq RN r13_irq ; Note there is no definition
sp_svc RN r13_svc ; for sp_usr or sp_fiq.
stack RN r13
stack RN r13 ; Stack Pointer
Stack RN r13
STACK RN r13
......@@ -359,15 +357,12 @@ KBStat_ShiftEnable * &80
KBStat_NoCapsLockBitNo * 4
MainVars * &A6 ; Start of OS_Byte readable variables
MosVer * 6 ; As returned by OS_Byte 0
NIL * &80000000 ; An interesting value
AppSpaceStart * &8000 ; Start of the user's world
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; From here on, due for retirement
NIL * &80000000 ; An interesting value
MaxLengthDateLo * &33EA0000 ; Wednesday, 28th September 1988
MaxLengthDateHi * &00000041 ; 11:34:36.80 am
......
......@@ -180,12 +180,6 @@ SixteenMByte EQU (1024*1024 * 16)
KEEP
; *****************************************************************************
; mjs Oct 2000 kernel/HAL split
; SetDAG stuff is no more, routines like SetVinit now call equivalent HAL
; routine
; **************** CAM manipulation utility routines ***********************************
; **************************************************************************************
......@@ -468,8 +462,8 @@ SSETMEMC ROUT
MOV r1, #0 ; no funny business with DPMS
MOV r0, #0
MOV r1
mjsAddressHAL
mjsCallHAL HAL_Video_SetBlank
AddressHAL
CallHAL HAL_VideoSetBlank
Pull "r0-r3, r9, r14"
]
......
......@@ -732,7 +732,7 @@ KnownCPUTable
CPUDesc ARM700, &007000, &FFFFF0, ARMv3, WT, 0, 8K, 4, 8
CPUDesc ARM710, &007100, &FFFFF0, ARMv3, WT, 0, 8K, 4, 8
CPUDesc ARM710a, &047100, &FDFFF0, ARMv3, WT, 0, 8K, 4, 4
CPUDesc ARM7500, &067100, &FFFFF0, ARMv3, WT, 0, 4K, 4, 4
CPUDesc ARM7500, &027100, &FFFFF0, ARMv3, WT, 0, 4K, 4, 4
CPUDesc ARM7500FE, &077100, &FFFFF0, ARMv3, WT, 0, 4K, 4, 4
CPUDesc ARMunk, &007000, &80F000, ARMv3, WT, 0, 8K, 4, 4
CPUDesc ARM720T, &807200, &FFFFF0, ARMv4T, WT, 0, 8K, 4, 4
......
......@@ -200,37 +200,37 @@ op_UnaryMinus * 67 ; unary minus
; so 40-67 inclusive is filled.
MACRO
$label ePush $reglist
LCLS temps
LCLL onereg
temps SETS "$reglist"
onereg SETL {TRUE}
WHILE onereg :LAND: :LEN: temps > 0
$label ePush $reglist
LCLS temps
LCLL onereg
temps SETS "$reglist"
onereg SETL {TRUE}
WHILE onereg :LAND: :LEN: temps > 0
[ temps :LEFT: 1 = "," :LOR: temps :LEFT: 1 = "-"
onereg SETL {FALSE}
onereg SETL {FALSE}
]
temps SETS temps :RIGHT: (:LEN: temps - 1)
temps SETS temps :RIGHT: (:LEN: temps - 1)
WEND
[ onereg
$label STR $reglist, [R11, #-4]!
$label STR $reglist, [R11, #-4]!
|
$label STMFD R11!, {$reglist}
$label STMFD R11!, {$reglist}
]
CMP R11, R10
BLE StackOFloErr
CMP R11, R10
BLE StackOFloErr
MEND
MACRO
$label ePull $reglist, $writeback, $cc
LCLS temps
LCLL onereg
temps SETS "$reglist"
onereg SETL {TRUE}
WHILE onereg :LAND: :LEN: temps > 0
$label ePull $reglist, $writeback, $cc
LCLS temps
LCLL onereg
temps SETS "$reglist"
onereg SETL {TRUE}
WHILE onereg :LAND: :LEN: temps > 0
[ temps :LEFT: 1 = "," :LOR: temps :LEFT: 1 = "-"
onereg SETL {FALSE}
onereg SETL {FALSE}
]
temps SETS temps :RIGHT: (:LEN: temps - 1)
temps SETS temps :RIGHT: (:LEN: temps - 1)
WEND
[ onereg
[ "$writeback" = ""
......@@ -1228,6 +1228,7 @@ AlternateBoot
Config_NoParm Boot, 4, 0, DBTBCMOS, 1
AlternateNoBoot
Config_NoParm NoBoot, 4, 0, DBTBCMOS, 0
Config_Special Cache
AlternateCaps
Config_NoParm Caps, 3, 2, StartCMOS, 4
AlternateNoCaps
......@@ -1237,11 +1238,7 @@ ExpandShCaps
EndListCapsFrig
Config_Field Data, 5, 2, DBTBCMOS
Config_Field Delay, 0, 7, KeyDelCMOS
;ExpandDir
; Config_NoParm Dir, 6, 0, StartCMOS, 0
;ExpandNoDir
; Config_NoParm NoDir, 6, 0, StartCMOS, 1
Config_Field DumpFormat, 0, 4, TutuCMOS
Config_Field DumpFormat, 0, 4, PrintSoundCMOS
Config_Size FontSize, 0, 7, FontCMOS
FontSizeFrig
Config_Special Ignore
......@@ -1275,18 +1272,12 @@ AlternateNoScroll
Config_Special WimpMode
= 0
;NoDirString = "No"
;DirString = "Directory", 0
ShCapsString = "ShiftCaps", 0
ALIGN
ExpandFrig * 8 ; see code that shows NoParm options.
ExpandTab
; & ExpandDir - ExpandFrig-.
; & DirString - .-1 ; another printing fudge!
; & ExpandNoDir - ExpandFrig-.
; & NoDirString - .-1
& ExpandShCaps - ExpandFrig-.
& ShCapsString - .-1
& 0
......@@ -1304,6 +1295,7 @@ Config_$name._table
ALIGN
Config_Special_Table Baud, "<D>"
Config_Special_Table Cache, "On|Off"
Config_Special_Table TV, "[<D> [[,] <D>]]"
Config_Special_Table Mode, "<D> | Auto"
Config_Special_Table Ignore, "[<D>]"
......@@ -1498,7 +1490,7 @@ BadConOpt
B ConfigGenErr
BadConOptError
& ErrorNumber_Syntax
= "BadConOpt:Bad configure option", 0
= "BadConOpt:Configure option not recognised", 0
ALIGN
ReadNumParm Entry "r1"
......@@ -1567,7 +1559,7 @@ ReadSizeParm ROUT
BLE %FT01
CMP r1, #"k"
CMPNE r1, #"K"
Pull "r1, r8", NE
Pull "r1, r8", NE
BNE BadConParm
ADRL r14, PrinterBufferFrig-4
TEQ r8, r14 ; if printer buffer size
......@@ -1977,10 +1969,6 @@ AlternateTab
& %FT92 -.
& ExpandShCaps - ExpandFrig-.
& %FT92 -.
; & ExpandDir - ExpandFrig-.
; & %FT93 -.
; & ExpandNoDir - ExpandFrig-.
; & %FT93 -.
& AlternateLoud - ExpandFrig-.
& %FT95 -.
& AlternateQuiet - ExpandFrig-.
......@@ -2002,9 +1990,6 @@ AlternateTab
& AlternateCaps -%BT92
& AlternateCaps -%BT92
& AlternateCaps -%BT92
;93
; & DirString -%BT93-1
; & NoDirString -%BT93-1
95
& AlternateQuiet -%BT95
& AlternateLoud -%BT95
......@@ -2075,7 +2060,7 @@ ConfigCheckEOL ROUT
Config2manyparms
& ErrorNumber_Syntax
= "Config2manyparms:Too many parameters"
= "Config2manyparms:Too many parameters"
;*************************************************************************
......@@ -2335,6 +2320,46 @@ Config_Baud_showcode
ADD r2, r4, #4
B ExitShow
Config_Cache_setcode ROUT
LDRB r2, [r0], #1
CMP r2, #" "
BEQ Config_Cache_setcode
SUB r0, r0, #1
BL Cache_Opt_Parse
MOVS r1, r1
BMI BadConOpt
MOVNE r4, #&20 ; CMOS flag for 'Off'
MOVEQ r4, #0 ; CMOS flag for 'On'
MOVVC r0, #ReadCMOS
MOVVC r1, #SystemSpeedCMOS
SWIVC XOS_Byte
BICVC r2, r2, #&20
ORRVC r2, r2, r4
MOVVC r0, #WriteCMOS
SWIVC XOS_Byte
Pull "pc"
Config_Cache_showcode
MOV r4, r0
SWI XOS_WriteS
= "Cache ", 0
ALIGN
MOVVC r0, #ReadCMOS
MOVVC r1, #SystemSpeedCMOS
SWIVC XOS_Byte
BVS %FT11
TST r2, #&20 ; clear = enable
ADREQ r0, %FT12
ADRNE r0, %FT13
SWI XOS_Write0
11 ADD r2, r4, #4
B ExitShow
12
= "On", 0
13
= "Off", 0
ALIGN
Config_MouseStep_setcode ROUT
LDRB r2, [r0], #1
CMP r2, #" "
......
......@@ -62,6 +62,7 @@
GET Hdr:Buffer
GET Hdr:Font
GET Hdr:DevNos
GET Hdr:OsBytes
GET Hdr:Internatio
GET Hdr:Territory
GET Hdr:Portable
......@@ -73,6 +74,7 @@
GET Hdr:Debug
GET Hdr:nvram
GET Hdr:PortMan
GET Hdr:SerialOp
GET s.PMF.DEF ; Common with 6502 code in the keyboard
Protocol
......@@ -113,7 +115,6 @@
$GetMemInfo
! 0, "Main kernel size = &" :CC: :STR: (.-KernelBase)
StartOfVduDriver
GET s.vdu.vduhint
GET s.vdu.VduDriver
GET s.vdu.VduSWIs
GET s.vdu.VduPalette
......
......@@ -364,7 +364,7 @@ RISCOS_Start
MOV v6, v2
TEQ v8, a4 ; Was this the only block? If so, leave 16M
SUBEQS v6, v6, #16*1024*1024
MOVCC v6, v2, LSR #1 ; If that overflowed, take half the bank.
MOVLS v6, v2, LSR #1 ; If that overflowed, take half the bank.
CMP v6, #32*1024*1024
MOVHS v6, #32*1024*1024 ; Limit allocation to 32M (arbitrary)
......@@ -872,11 +872,7 @@ MMUon_nol1ptoverlap
AddressHAL
CallHAL HAL_Init
[ DebugHALTX
BL DebugHALPrint
= "HAL initialised",0
ALIGN
]
DebugTX "HAL initialised"
LDR a1, =ZeroPage
LDR v1, [a1, #InitUsedBlock]
......@@ -2307,17 +2303,25 @@ NullHALEntry
; Can freely corrupt r10-r12 (v7,v8,ip).
HardwareSWI
AND ip, v5, #&FF
CMP ip, #1
BLO HardwareCall
BEQ HardwareLookup
CMP ip, #3
CMP ip, #OSHW_LookupRoutine
ASSERT OSHW_CallHAL < OSHW_LookupRoutine
BLO HardwareCallHAL
BEQ HardwareLookupRoutine
CMP ip, #OSHW_DeviceRemove
ASSERT OSHW_DeviceAdd < OSHW_DeviceRemove
BLO HardwareDeviceAdd
BEQ HardwareDeviceRemove
CMP ip, #5
CMP ip, #OSHW_DeviceEnumerateChrono
ASSERT OSHW_DeviceEnumerate < OSHW_DeviceEnumerateChrono
ASSERT OSHW_DeviceEnumerateChrono < OSHW_MaxSubreason
BLO HardwareDeviceEnumerate
BHS HardwareBadReason
BEQ HardwareDeviceEnumerateChrono
BHI HardwareBadReason
HardwareCall
HardwareCallHAL
Push "v1-v4,sb,lr"
ADD v8, sb, #1 ; v8 = entry no + 1
LDR ip, =ZeroPage
......@@ -2340,7 +2344,7 @@ HardwareCall
Pull "sb,lr"
ExitSWIHandler
HardwareLookup
HardwareLookupRoutine
ADD v8, sb, #1 ; v8 = entry no + 1
LDR ip, =ZeroPage
LDR v7, [ip, #HAL_Descriptor]
......@@ -2483,6 +2487,36 @@ 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