Commit dbc48c98 authored by Stewart Brodie's avatar Stewart Brodie
Browse files

32-bit kernels will refuse to initialise non 32-bit modules.

Detail:
  The kernel will examine all modules that it is requested to initialise
    and will refuse to initialise any module without a module flags word
    entry in its module header or with bit 0 the first flags word being
    clear (bit 0 being ModuleFlag_32bit)
  Error message added to all the messages files.
  New error block added to message counting block.  The Non-32-bit module
    message is not a cached error message, though.
Admin:
  Tested in 32-bit Lazarus build.

Version 5.38. Tagged as 'Kernel-5_38'
parent e885ec7a
......@@ -77,6 +77,7 @@ ChunkNotRM:Podule chunk is not a relocatable module
ModulePostfix:'%%' in module title
NotMod:This is not a relocatable module
BadRMHeaderField:Illegal header field in module
RMNot32bit:Module is not 32-bit compatible
IncarnationNotFound:Incarnation not found
RMNotFoundInROM:Module is not in ROM
NumbTooBig:Number too big
......
......@@ -77,6 +77,7 @@ ChunkNotRM:Podule chunk is not a relocatable module
ModulePostfix:'%%' in module title
NotMod:This is not a relocatable module
BadRMHeaderField:Illegal header field in module
RMNot32bit:Module is not 32-bit compatible
IncarnationNotFound:Incarnation not found
RMNotFoundInROM:Module is not in ROM
NumbTooBig:Number too big
......
......@@ -77,6 +77,7 @@ ChunkNotRM:Podule chunk is not a relocatable module
ModulePostfix:'%%' in module title
NotMod:This is not a relocatable module
BadRMHeaderField:Illegal header field in module
RMNot32bit:Module is not 32-bit compatible
IncarnationNotFound:Incarnation not found
RMNotFoundInROM:Module is not in ROM
NumbTooBig:Number too big
......
......@@ -77,6 +77,7 @@ ChunkNotRM:Podule chunk is not a relocatable module
ModulePostfix:'%%' in module title
NotMod:This is not a relocatable module
BadRMHeaderField:Illegal header field in module
RMNot32bit:Module is not 32-bit compatible
IncarnationNotFound:Incarnation not found
RMNotFoundInROM:Module is not in ROM
NumbTooBig:Number too big
......
......@@ -9,12 +9,16 @@
GBLS Module_ApplicationDate2
GBLS Module_ApplicationDate4
GBLS Module_HelpVersion
Module_MajorVersion SETS "5.37"
Module_Version SETA 537
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.38"
Module_Version SETA 538
Module_MinorVersion SETS ""
Module_Date SETS "17 Oct 2000"
Module_ApplicationDate2 SETS "17-Oct-00"
Module_ApplicationDate4 SETS "17-Oct-2000"
Module_FullVersion SETS "5.37"
Module_HelpVersion SETS "5.37 (17 Oct 2000)"
Module_Date SETS "21 Nov 2000"
Module_ApplicationDate2 SETS "21-Nov-00"
Module_ApplicationDate4 SETS "21-Nov-2000"
Module_ComponentName SETS "Kernel"
Module_ComponentPath SETS "RiscOS/Sources/Kernel"
Module_FullVersion SETS "5.38"
Module_HelpVersion SETS "5.38 (21 Nov 2000)"
END
/* (5.37)
/* (5.38)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 5.37
#define Module_MajorVersion_CMHG 5.38
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 17 Oct 2000
#define Module_Date_CMHG 21 Nov 2000
#define Module_MajorVersion "5.37"
#define Module_Version 537
#define Module_MajorVersion "5.38"
#define Module_Version 538
#define Module_MinorVersion ""
#define Module_Date "17 Oct 2000"
#define Module_Date "21 Nov 2000"
#define Module_ApplicationDate2 "17-Oct-00"
#define Module_ApplicationDate4 "17-Oct-2000"
#define Module_ApplicationDate2 "21-Nov-00"
#define Module_ApplicationDate4 "21-Nov-2000"
#define Module_FullVersion "5.37"
#define Module_HelpVersion "5.37 (17 Oct 2000)"
#define Module_ComponentName "Kernel"
#define Module_ComponentPath "RiscOS/Sources/Kernel"
#define Module_FullVersion "5.38"
#define Module_HelpVersion "5.38 (21 Nov 2000)"
......@@ -2127,7 +2127,8 @@ CallInit ROUT
; " size in R2
CheckHeader ROUT
Push "R3, lr"
Push "R0, R3, lr"
ADR R0, ErrorBlock_BadRMHeaderField
LDR R3, [R1, #Module_HC_Table]
BL %FT11
LDR R3, [R1, #Module_HelpStr]
......@@ -2142,25 +2143,42 @@ CheckHeader ROUT
LDR R3, [R1, #Module_Init]
TST R3, #&80000000
BLEQ %FT10 ; only check init offset if an unsqueezed module
[ No26bitCode ; insist that modules declare themselves 32-bit safe
ADR R0, ErrorBlock_RMNot32bit
LDR R3, [R1, #Module_SWIChunk]
BIC R3, R3, #Auto_Error_SWI_bit
TST R3, #Module_SWIChunkSize-1
TSTEQ R3, #&FF000000
BNE %FT99 ; naff SWI chunk number
TEQ R3, #0
LDRNE R3, [R1, #Module_SWIEntry] ; check for SWI entry point like CheckForSWIEntries
BLNE %FT10
LDR R3, [R1, #Module_MsgFile] ; Other places appear to require this to be word-aligned
BL %FT10
CMP R3, R2
LDRLO R3, [R1, #Module_FlagTable]
BL %FT10
LDR R3, [R1, R3] ; Retrieve first word of module flags
TST R3, #ModuleFlag_32bit ; NE if 32-bit compatible
BEQ %FT99
]
CLRV
Pull "R3, PC"
Pull "R0, R3, PC"
10 TST R3, #3
BNE %FT99
11 CMP R3, R2
MOVLO PC, lr
99
Pull "R3, lr"
ADR R0, ErrorBlock_BadRMHeaderField
LDMIB SP!, {R3, LR} ; NOTE: sp still points at stacked LR!
[ International
Push "lr"
BL TranslateError
Pull "lr"
|
SETV
]
MOV PC, lr
Pull "PC"
MakeErrorBlock BadRMHeaderField
MakeErrorBlock RMNot32bit
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; Enter with module node pointer in R9
......
......@@ -109,6 +109,7 @@ TranslateError_UseR4
; This block MUST not be empty
CommonErrorAddresses
[ countmsgusage
& ErrorBlock_RMNot32bit
& ErrorBlock_RCExc
& ErrorBlock_RCNegative
& ErrorBlock_BadString
......
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