Commit 7b7cb6d9 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Unplug/RMInsert with podule module fix

During the first pass keyboard scan the ROM module nodes are built off the anchor ROMModuleChain.
During the second pass the whole set of ROM module nodes are temporarily constructed anchored on the stack, then switched over.
This caused a problem when a duplicate name module was encountered on a podule (eg. MbufManager in a NIC) because FindROMModule searches from the ROMModuleChain anchor, didn't find a match, so created a new node rather than linking it to the NewerVersion/OlderVersion linked list on the existing node.
Then *Unplug and *RMInsert would say "Module is not in ROM" if the optional podule specifier was given, because the search stopped at the first node with the right name.

Swap round the second pass so it anchors directly on ROMModuleChain, and keeps the first pass anchor on the stack (needed only occasionally to copy over details of modules already initialised).

Tested on a Risc PC with NIC, can now selectively unplug MbufManager again.

Version 5.93. Tagged as 'Kernel-5_93'
parent 101d144f
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.92"
Module_Version SETA 592
Module_MajorVersion SETS "5.93"
Module_Version SETA 593
Module_MinorVersion SETS ""
Module_Date SETS "02 Dec 2017"
Module_ApplicationDate SETS "02-Dec-17"
Module_Date SETS "08 Dec 2017"
Module_ApplicationDate SETS "08-Dec-17"
Module_ComponentName SETS "Kernel"
Module_ComponentPath SETS "castle/RiscOS/Sources/Kernel"
Module_FullVersion SETS "5.92"
Module_HelpVersion SETS "5.92 (02 Dec 2017)"
Module_FullVersion SETS "5.93"
Module_HelpVersion SETS "5.93 (08 Dec 2017)"
END
/* (5.92)
/* (5.93)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 5.92
#define Module_MajorVersion_CMHG 5.93
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 02 Dec 2017
#define Module_Date_CMHG 08 Dec 2017
#define Module_MajorVersion "5.92"
#define Module_Version 592
#define Module_MajorVersion "5.93"
#define Module_Version 593
#define Module_MinorVersion ""
#define Module_Date "02 Dec 2017"
#define Module_Date "08 Dec 2017"
#define Module_ApplicationDate "02-Dec-17"
#define Module_ApplicationDate "08-Dec-17"
#define Module_ComponentName "Kernel"
#define Module_ComponentPath "castle/RiscOS/Sources/Kernel"
#define Module_FullVersion "5.92"
#define Module_HelpVersion "5.92 (02 Dec 2017)"
#define Module_LibraryVersionInfo "5:92"
#define Module_FullVersion "5.93"
#define Module_HelpVersion "5.93 (08 Dec 2017)"
#define Module_LibraryVersionInfo "5:93"
......@@ -220,10 +220,12 @@ ModuleInit Entry "r0-r12"
ADRL r6, SysModules_Info+4
SUB sp, sp, #4 ; anchor new list on stack for now
MOV r9, sp ; pointer to 'previous' node
LDR r9, =ZeroPage+ROMModuleChain ; pointer to 'previous' node
LDR r12, [r9]
Push "r12" ; keep keyboard scan chain anchor
MOV r8, #0 ; initial head ptr is zero
STR r8, [r9] ; set up null list
MOV r3, #-1 ; podule -1 is main ROM
MOV r10, #0 ; chunk number 0 to start
10
......@@ -252,8 +254,7 @@ ModuleInit Entry "r0-r12"
BL AddROMModuleNode
BVS %FT50 ; if failed then can't add any more ROMs!
LDR r12, =ZeroPage+ROMModuleChain
LDR r12, [r12] ; keyboard scan chain may have seen this module
LDR r12, [sp, #0*4] ; keyboard scan chain may have seen this module
12
TEQ r12, #0
BEQ %FT18
......@@ -324,7 +325,6 @@ ModuleInit Entry "r0-r12"
STRB r1, [r2], #1
TEQ r1, #0
BNE %BT24
MOV r14, #(1 :SHL: 16) ; bit mask ready to shift
CMP r3, #-1
BLT %FT30
......@@ -373,17 +373,14 @@ ModuleInit Entry "r0-r12"
50
; during keyboard scan some ROM (only) modules were already started, switch chains
; free the keyboard scan chain as it's redundant now
LDR r12, =ZeroPage+ROMModuleChain
Pull "r2"
LDR r9, [r12] ; old anchor
STR r2, [r12]
Pull "r9" ; recover keyboard scan chain anchor
51
TEQ r9, #0
BEQ %FT58
MOV r2, r9 ; now free the keyboard scan chain
MOV r2, r9
LDR r9, [r9, #ROMModule_Link]
[ ChocolateSysHeap
ASSERT ChocolateMRBlocks = ChocolateBlockArrays + 12
......
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