Commit a5fd3ad0 authored by Kevin Bracey's avatar Kevin Bracey
Browse files

Ursula ChocolateSysHeap and 128-entry SWI hash table incorporated.

Version 4.83. Tagged as 'Kernel-4_83'
parent 2a2f8af6
......@@ -6,9 +6,9 @@
GBLS Module_MinorVersion
GBLS Module_Date
GBLS Module_FullVersion
Module_MajorVersion SETS "4.82"
Module_Version SETA 482
Module_MajorVersion SETS "4.83"
Module_Version SETA 483
Module_MinorVersion SETS ""
Module_Date SETS "10 Aug 1999"
Module_FullVersion SETS "4.82"
Module_Date SETS "17 Aug 1999"
Module_FullVersion SETS "4.83"
END
/* (4.82)
/* (4.83)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 4.82
#define Module_MajorVersion_CMHG 4.83
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 10 Aug 1999
#define Module_Date_CMHG 17 Aug 1999
#define Module_MajorVersion "4.82"
#define Module_Version 482
#define Module_MajorVersion "4.83"
#define Module_Version 483
#define Module_MinorVersion ""
#define Module_Date "10 Aug 1999"
#define Module_Date "17 Aug 1999"
#define Module_FullVersion "4.82"
#define Module_FullVersion "4.83"
......@@ -1127,6 +1127,7 @@ ROMModuleChain # 4 ; pointer to head of ROM module chain
KeyWorkSpaceSize * &200
KeyWorkSpace # KeyWorkSpaceSize
! 0, "KeyWorkSpace at ":CC::STR:(KeyWorkSpace)
; The following were reordered on 26-Jul-91. Old ordering was:
; GeneralMOSBuffer
......@@ -1136,10 +1137,39 @@ KeyWorkSpace # KeyWorkSpaceSize
; VecPtrTab
; ExceptionDump
ModuleSHT_Entries * 16
ModuleSWI_HashTab # 4*ModuleSHT_Entries
; SWI hash table moved to OldIRQ1Vspace on 12-Nov-97, for Ursula (wider hashing)
;
; !!!! Free Space
;
[ ChocolateSysHeap
ChocolateBlockArrays # 0
ChocolateCBBlocks # 4 ; -> array of quick access blocks for Callback
ChocolateSVBlocks # 4 ; -> array of quick access blocks for software vectors
ChocolateTKBlocks # 4 ; -> array of quick access blocks for tickers
ChocolateMRBlocks # 4 ; -> array of blocks for ROM module nodes (reduces no. of individual blocks in heap)
ChocolateMABlocks # 4 ; -> array of blocks for active module nodes (reduces no. of individual blocks in heap)
ChocolateMSBlocks # 4 ; -> array of blocks for module SWI hash nodes (reduces no. of individual blocks in heap)
! 0, "ChocolateCBBlocks at ":CC::STR:(ChocolateCBBlocks)
! 0, "ChocolateSVBlocks at ":CC::STR:(ChocolateSVBlocks)
! 0, "ChocolateTKBlocks at ":CC::STR:(ChocolateTKBlocks)
! 0, "ChocolateMRBlocks at ":CC::STR:(ChocolateMRBlocks)
! 0, "ChocolateMABlocks at ":CC::STR:(ChocolateMABlocks)
! 0, "ChocolateMSBlocks at ":CC::STR:(ChocolateMSBlocks)
; !!!! Free Space (40 bytes)
OldSWIHashspace # 10*4
|
; !!!! Free Space (64 bytes)
OldSWIHashspace # 16*4
]
;
;was:
;ModuleSHT_Entries * 16
;ModuleSWI_HashTab # 4*ModuleSHT_Entries
Module_List # 4
! 0, "Module_List at ":CC::STR:(Module_List)
Curr_Active_Object # 4
; Vector Claim & Release tables etc
......@@ -1216,13 +1246,62 @@ PFIQasIRQ_Chain # 4
CMOSRAMCache # 256
; !!!! The following isn't going to work anymore !!!!
[ med_00001_debug
! 0,"med-00001 queue start, queue size, cda amount at &" :CC: :STR:(OldIRQ1Vspace)
med_00001_debug_start * OldIRQ1Vspace
med_00001_debug_size * OldIRQ1Vspace+4
med_00001_debug_cda * OldIRQ1Vspace+8
]
; Was Free space (752 bytes) left by old IRQ despatch (new IRQ despatch moved as it required more space).
; Re-used for various purposes on 12-Nov-97, for Ursula
;
ASSERT @ = &C34 ;if fails, may need to rearrange padding to sort hash table alignment
;
ModuleSHT_Entries * 128
ModuleSHT_Padding0 # 12 ;spare, so that SWI hashtable is aligned for easy immediate address load
ModuleSWI_HashTab # 4*ModuleSHT_Entries
! 0, "ModuleSWI_HashTab at ":CC::STR:(ModuleSWI_HashTab)
;
SysVars_StickyPointers # (10+1)*4 ;used if ChocolateSysVars is TRUE (1 dummy pointer for 0 size)
! 0, "SysVars_StickyPtrs at ":CC::STR:(SysVars_StickyPointers)
;
Abort32_dumparea # 6*4 ;info for OS_ReadSysInfo 7 - 32-bit PSR, fault address, 32-bit PC (room for two copies)
! 0, "Abort32_dumparea at ":CC::STR:(Abort32_dumparea)
;
Help_guard # 4 ;for *help, guard against foreground re-entrancy (multiple taskwindows)
Help_msgdescr # 4*4 ;for *help, 4 words MessageTrans descriptor
! 0, "Help_guard at ":CC::STR:(Help_guard)
;
PCI_status # 4 ;bit 0 = 1 if PCI exists or 0 if PCI does not exist, bits 1..31 reserved (0)
! 0, "PCI_status at ":CC::STR:(PCI_status)
IOMD_NoInterrupt # 4 ;no. of irq devices for extant IOMD
IOMD_DefaultIRQ1Vcode # 4 ;default irq code start address (ROM) for extant IOMD
IOMD_DefaultIRQ1Vcode_end # 4 ;default irq code end address (ROM)
IOMD_Devices # 4 ;default irq devices table address (ROM)
! 0, "IOMD_NoInterrupt at ":CC::STR:(IOMD_NoInterrupt)
;
[ mjsSysHeapNodesTrace
mjsSHNodesTrace_ws # 0
mjsSHNT_hcl_total # 4 ;total calls to ClaimSysHeapNode
mjsSHNT_hfr_total # 4 ;total calls to FreeSysHeapNode
mjsSHNT_hop_total # 4 ;total calls to DoSysHeapOpWithExpansion
mjsSHNT_ohc_total # 4 ;total calls to OS_Heap for SysHeap claim
mjsSHNT_ohf_total # 4 ;total calls to OS_Heap for SysHeap free
mjsSHNT_ohx_total # 4 ;total calls to OS_Heap for SysHeap expand or shrink
mjsSHNT_vcs_total # 4 ;total SysVar ClaimVNode calls that picked up a sticky node
mjsSHNT_vch_total # 4 ;total SysVar ClaimVNode calls that went to the heap for a node
mjsSHNT_vxs_total # 4 ;total SysVar ExpandOrShrinkVNode calls that tried to do sticky change
mjsSHNT_vxh_total # 4 ;total SysVar ExpandOrShrinkVNode calls that went to the heap
mjsSHNT_vfs_total # 4 ;total SysVar FreeVNode calls that stuck
mjsSHNT_vfh_total # 4 ;total SysVar FreeVNode calls that dropped a node to the heap
! 0, ""
! 0, "**WARNING** compiling in code to trace some SysHeap node statistics (mjsSysHeapNodesTrace TRUE)"
! 0, ""
! 0, "mjsSHNodesTrace_ws at ":CC::STR:(mjsSHNodesTrace_ws)
ModuleSHT_Padding1 # 752-12-4*ModuleSHT_Entries-11*4-6*4-5*4-4-4*4-12*4 ;spare
|
ModuleSHT_Padding1 # 752-12-4*ModuleSHT_Entries-11*4-6*4-5*4-4-4*4 ;spare
]
;
ASSERT @ = &C34 + 752
;
;was:
;OldIRQ1Vspace # 752
CallBack_Vector # 4
......
......@@ -348,8 +348,17 @@ GoForAddToVec
MOV R10, R1 ; Address
MOV R4, R2 ; TailPtr pointer is "nextblock"
[ ChocolateSysHeap
ASSERT ChocolateSVBlocks = ChocolateBlockArrays + 4
MOV r3,#ChocolateBlockArrays
LDR r3,[r3,#4]
BL ClaimChocolateBlock
MOVVS R3, #VecNodeSize ; Ask for this number of bytes
BLVS ClaimSysHeapNode ; The result is in R2 : R12 corrupted
|
MOV R3, #VecNodeSize ; Ask for this number of bytes
BL ClaimSysHeapNode ; The result is in R2 : R12 corrupted
]
BVS BadClaimVector ; Failed : Exit
TEQP PC, #SVC_mode+I_bit ; force noirq
......@@ -462,7 +471,15 @@ FindAndDelinkNode
FreeNode
Push "R0-R2, lr"
MOV R2, R12
[ ChocolateSysHeap
ASSERT ChocolateSVBlocks = ChocolateBlockArrays + 4
MOV r1,#ChocolateBlockArrays
LDR r1,[r1,#4]
BL FreeChocolateBlock
BLVS FreeSysHeapNode
|
BL FreeSysHeapNode
]
STRVS R0, [stack]
Pull "R0-R2, PC" ; returns Vset if sysheap poo'd.
|
......@@ -630,7 +647,15 @@ Application_Delink ROUT
Push "R0-R2"
MOV R2, R10
MOV R10, R12 ; keep updated thisblk
[ ChocolateSysHeap
ASSERT ChocolateSVBlocks = ChocolateBlockArrays + 4
MOV r1,#ChocolateBlockArrays
LDR r1,[r1,#4]
BL FreeChocolateBlock
BLVS FreeSysHeapNode
|
BL FreeSysHeapNode
]
MOVVS lr, R0
Pull "R0-R2"
BVC %BT05
......
......@@ -2598,6 +2598,169 @@ AllocateBackingLevel2 ENTRY "r0-r8,r11"
SETV
EXIT
;**************************************************************************
[ ChocolateSysHeap
;
; CreateChocolateBlockArray
;
; entry: r2 = No. of blocks to be created in array (N)
; r3 = size of each block in bytes (S, must be multiple of 4)
;
; exit:
; r2 = address of chocolate block array (parent SysHeap block address)
; array is initialised to all blocks free
; OR V set, r0=error pointer, if error (from OS_Heap)
;
; - A Chocolate block array is only suitable for blocks of single fixed size.
; These blocks may be allocated and freed in any order, but never resized.
; - Allocating and freeing blocks from a Chocolate block array is much faster
; than OS_Heap, and the cost of operations is independent of N.
; - A Chocolate block array is a single block in the SysHeap, and looks like this
; (excluding the internal structure of OS_Heap blocks):
;
; - array header (3 words):
; - word 0 = total no. of blocks in array (N)
; - word 1 = size of each block container (S+4)
; - word 2 -> first free block container in array, or 0 if none free
; - followed immediately by N block containers, each of form:
; - container header (1 word):
; - word 0 : bits 0..30 = container id (C)
; C = (S+4)*I, where I is array index, 0..N-1
; bit 31 = 1 if block is free, 0 if block is in use
; - followed immediately by the S/4 words of the block itself
; - if the block is in use, these words are as defined by the client
; - if the block is free, the first word is a pointer to the next free
; block container (or 0 if end of free list), and the other words
; are undefined
;
; - A Chocolate block array requires a SysHeap block of 3*4 + N*(S + 4) bytes
;
CreateChocolateBlockArray ROUT
Push "r0,r1,r3,r4,r5,lr"
MOV r5,r2 ;N
ADD r4,r3,#4 ;S+4
MUL r3,r5,r4
ADD r3,r3,#3*4
BL ClaimSysHeapNode
STRVS r0,[SP]
BVS %FT50
STR r5,[r2]
STR r4,[r2,#4]
ADD r1,r2,#3*4
STR r1,[r2,#8]
MOV lr,r5
ADD r0,r2,#3*4
MOV r1,#&80000000 ;free flag
10
STR r1,[r0]
ADD r3,r0,r4
STR r3,[r0,#4]
ADD r1,r1,r4
SUBS lr,lr,#1
MOVNE r0,r3
BNE %BT10
MOV r1,#0
STR r1,[r0,#4] ;end of free list
50
Pull "r0,r1,r3,r4,r5,pc"
;
; ClaimChocolateBlock
;
; entry: r3 = address of parent ChocolateBlockArray (must be valid)
; exit: r2 = address of allocated block
; r3 = size of block
; OR V set, R0=error (no free blocks)
;
ClaimChocolateBlock ROUT
Push "r1,r4,lr"
MOV r4,pc
ORR r1,r4,#I_bit
TEQP r1,#0 ;protect critical manipulation from interrupt re-entry
LDR r2,[r3,#8] ;pick up block container at front of free list
CMP r2,#0
BEQ ClaimChocolateBlock_NoneFree
LDR r1,[r2]
BIC r1,r1,#&80000000 ;clear the free flag
STR r1,[r2]
LDR r1,[r2,#4] ;next free block container
STR r1,[r3,#8] ;put it at front
ADD r2,r2,#4 ;address of block
LDR r3,[r3,#4]
SUB r3,r3,#4 ;size of block
BIC r4,r4,#V_bit ;return with V clear
TEQP r4,#0 ;restore IRQ state
Pull "r1,r4,pc"
;
;DON'T even think about internationalisation - this exit route must be fast
ClaimChocolateBlock_NoneFree
ADR R0,ChocolateBlock_NFError
ORR r4,r4,#V_bit ;return with V set
TEQP r4,#0 ;restore IRQ state
Pull "r1,r4,pc"
;
; FreeChocolateBlock
;
; entry: r1 = address of parent ChocolateBlockArray (must be valid)
; r2 = address of block to free (may be invalid)
; exit: -
; OR V set, R0=error (not a ChocolateBlock), r1,r2 still preserved
;
FreeChocolateBlock ROUT
Push "r2,r3,r4,lr"
MOV r4,pc
ORR r3,r4,#I_bit
TEQP r3,#0 ;protect critical manipulation from interrupt re-entry
ADD r3,r1,#12 ;r3 -> first block container
SUB r2,r2,#4 ;r2 -> container for block (if valid)
CMP r2,r3
BLO FreeChocolateBlock_NaffOff
LDR lr,[r1,#-4] ;OS_Heap's size word (naughty!)
ADD lr,lr,r1
CMP r2,lr
BHS FreeChocolateBlock_NaffOff
LDR lr,[r2] ;block container id
TST lr,#&80000000 ;free flag
BNE FreeChocolateBlock_NaffOff
ADD lr,lr,r3 ;lr := address of block container, from container id
CMP lr,r2
BNE FreeChocolateBlock_NaffOff
;
;we now believe caller is freeing a valid block, currently in use
;
LDR lr,[r2]
ORR lr,lr,#&80000000
STR lr,[r2] ;set free flag in container id
LDR lr,[r1,#8] ;current front of free list
STR lr,[r2,#4] ;chain free list to block container we are freeing
STR r2,[r1,#8] ;put freed block container at front
BIC r4,r4,#V_bit ;return with V clear
TEQP r4,#0 ;restore IRQ state
Pull "r2,r3,r4,pc"
;
;DON'T even think about internationalisation - this exit route must be fast
FreeChocolateBlock_NaffOff
ADR R0,ChocolateBlock_NOError
ORR r4,r4,#V_bit ;return with V set
TEQP r4,#0 ;restore IRQ state
Pull "r2,r3,r4,pc"
;
;forget internationalisation - if these errors aren't dealt with silently,
; the kernel's stuffed anyway
ChocolateBlock_NFError
DCD 0
DCB "Chocolate SysHeap claim failed",0
ALIGN
ChocolateBlock_NOError
DCD 0
DCB "not a Chocolate SysHeap block",0
ALIGN
] ;ChocolateSysHeap
;**************************************************************************
;
; InitDynamicAreas - Initialise nodes for dynamic areas
......@@ -2678,6 +2841,41 @@ InitDynamicAreas ENTRY "r0-r8,r11"
MOV r0, #0
STR lr, [r0, #DAList] ; store pointer to 1st node on list (either free pool or sys heap)
[ ChocolateSysHeap
ASSERT ChocolateCBBlocks = ChocolateBlockArrays + 0
ASSERT ChocolateSVBlocks = ChocolateBlockArrays + 4
ASSERT ChocolateTKBlocks = ChocolateBlockArrays + 8
ASSERT ChocolateMRBlocks = ChocolateBlockArrays + 12
ASSERT ChocolateMABlocks = ChocolateBlockArrays + 16
ASSERT ChocolateMSBlocks = ChocolateBlockArrays + 20
MOV r1,#ChocolateBlockArrays
MOV r2,#MaxChocolateCBBlocks
MOV r3,#3*4
BL CreateChocolateBlockArray ; better not fail
STR r2,[r1,#0]
MOV r2,#MaxChocolateSVBlocks
MOV r3,#VecNodeSize
BL CreateChocolateBlockArray ; better not fail
STR r2,[r1,#4]
MOV r2,#MaxChocolateTKBlocks
MOV r3,#TickNodeSize
BL CreateChocolateBlockArray ; better not fail
STR r2,[r1,#8]
MOV r2,#MaxChocolateMRBlocks
MOV r3,#ROMModule_NodeSize
BL CreateChocolateBlockArray ; better not fail
STR r2,[r1,#12]
MOV r2,#MaxChocolateMABlocks
MOV r3,#ModInfo + Incarnation_Postfix + 8
BL CreateChocolateBlockArray ; better not fail
STR r2,[r1,#16]
MOV r2,#MaxChocolateMSBlocks
MOV r3,#ModSWINode_Size
BL CreateChocolateBlockArray ; better not fail
STR r2,[r1,#20]
]
[ NewStyle_All
STR r0, [r0, #CDASemaphore] ; clear CDASemaphore
]
......
......@@ -366,19 +366,42 @@ ARM810_POST SETL {FALSE} :LAND: ARM810support
;(not all Ursula performance improvements are flagged with Chocolate - eg. simple changes such as slicker SWI
;despatch and wider SWI hashing)
;
;disabled at run time if not StrongARM
;any ARM
GBLL ChocolateSysHeap ;whether to save cost of SysHeap block claim/release for common cases (eg. callback blocks)
;also reduces SysHeap stress by using fewer blocks in total
GBLL ChocolateOSMod ;whether to reduce SysHeap stress in module handling
GBLL ChocolateService ;whether to implement fast module service call distribution (uses table introduced
;into module format by Ursula API
ChocolateSysHeap SETL {TRUE}
ChocolateOSMod SETL {TRUE}
ChocolateService SETL {TRUE}
[ ChocolateSysHeap
GBLA MaxChocolateCBBlocks ;max quick CallBack blocks available at any one time (else ordinary heap nodes used)
GBLA MaxChocolateSVBlocks ;max quick Software Vector blocks available at any one time (else ordinary heap nodes used)
GBLA MaxChocolateTKBlocks ;max quick Ticker blocks available at any one time (else ordinary heap nodes used)
GBLA MaxChocolateMRBlocks ;max module ROM blocks before ordinary heap nodes are used (reduces total no. nodes in SysHeap)
GBLA MaxChocolateMABlocks ;max module Active blocks before ordinary heap nodes are used
GBLA MaxChocolateMSBlocks ;max module SWI Hash blocks before ordinary heap nodes are used
MaxChocolateCBBlocks SETA 32
MaxChocolateSVBlocks SETA 128
MaxChocolateTKBlocks SETA 32
MaxChocolateMRBlocks SETA 150
MaxChocolateMABlocks SETA 150
MaxChocolateMSBlocks SETA 150
]
GBLL VCOstartfix ;code in early kernel to fix VCO start problem on A7000 (esp. 7500FE)
VCOstartfix SETL {TRUE}
GBLL mjsServiceTrace ;for statistics gathering on service calls only
mjsServiceTrace SETL {FALSE}
GBLL mjsSysHeapNodesTrace ;for statistics gathering on some SysHeap nodes only
mjsSysHeapNodesTrace SETL {FALSE}
[ StrongARM
! 0," ______________________________________________________"
! 0,"| |"
......
......@@ -924,13 +924,6 @@ process_callback_chain ROUT
BIC r11, r11, #CBack_VectorReq
STRB r11, [r10, #CallBack_Flag]
[ True
[ Fix15
; TMD 11-Sep-89; used to free the wrong node here - usually would try to free
; a null node, and claimed node would not get freed - however, if more than one
; request, then it could free the 2nd node before it was used.
01 TEQP PC, #SVC_mode+I_bit ; ints off while head updated
MOV r2, #0
LDR r2, [r2, #CallBack_Vector]
......@@ -942,53 +935,24 @@ process_callback_chain ROUT
STR r10, [r0, #CallBack_Vector-HeapReason_Free] ; Keep head valid
TEQP PC, #SVC_mode ; enable ints for long bits
LDR r1, =SysHeapStart
SWI XOS_Heap
MOV lr, pc
MOV pc, r11 ; call im, with given r12
B %BT01 ; loop
[ ChocolateSysHeap
ASSERT ChocolateCBBlocks = ChocolateBlockArrays + 0
MOV r1,#ChocolateBlockArrays
LDR r1,[r1,#0]
BL FreeChocolateBlock
LDRVS r1, =SysHeapStart
SWIVS XOS_Heap
|
01 TEQP PC, #SVC_mode+I_bit ; ints off while head updated
MOV r10, #0
LDR r10, [r10, #CallBack_Vector]
TEQ r10, #0
Pull "r0-r6, r10-r12, PC",EQ,^
LDMIA r10, {r2, r11, r12} ; link, addr, r12
MOV r0, #HeapReason_Free
STR r2, [r0, #CallBack_Vector-HeapReason_Free] ; Keep head valid
TEQP PC, #SVC_mode ; enable ints for long bits
LDR r1, =SysHeapStart
SWI XOS_Heap
]
MOV lr, pc
MOV pc, r11 ; call im, with given r12
B %BT01 ; loop
]
| ; old one
TEQP PC, #SVC_mode
LDR r10, [r10, #CallBack_Vector]
01 MOV r2, r10 ; for freeing
LDMIA r10, {r10, r11, r12} ; link, addr, r12
MOV r0, #HeapReason_Free
STR r10, [r0, #CallBack_Vector-HeapReason_Free]
LDR r1, =SysHeapStart
SWI XOS_Heap
MOV lr, pc
MOV pc, r11 ; call im
CMP r10, #0
BNE %BT01
Pull "r0-r6, r10-r12, PC",,^
]
LTORG
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
......@@ -1064,7 +1028,7 @@ $l MOV $swino, $swino, LSR #4
|
$l MOV $swino, $startreg, LSR #4
]
AND $swino, $swino, #ModuleSHT_Entries*4-1
AND $swino, $swino, #(ModuleSHT_Entries-1)*4
MEND
MACRO
......
......@@ -398,8 +398,17 @@ InitialiseROMModule ENTRY "r0-r12"
;
AddROMModuleNode ENTRY "r0,r1,r3-r12"
[ ChocolateSysHeap
ASSERT ChocolateMRBlocks = ChocolateBlockArrays + 12
MOV r3,#ChocolateBlockArrays
LDR r3,[r3,#12]
BL ClaimChocolateBlock
MOVVS r3, #ROMModule_NodeSize
BLVS ClaimSysHeapNode
|
MOV r3, #ROMModule_NodeSize ; claim a rom module node
BL ClaimSysHeapNode ; r0,r1 corrupted, r2 -> block
]
STRVS r0, [stack]
EXIT VS
......@@ -1855,12 +1864,27 @@ AddModuleIfInROM ENTRY "r5-r8"
; returns module node pointer in R9
LinkAndInit ENTRY "r2, r3"
[ ChocolateSysHeap
ASSERT ChocolateMABlocks = ChocolateBlockArrays + 16
MOV r3,#ChocolateBlockArrays
LDR r3,[r3,#16]
BL ClaimChocolateBlock
[ ModHand_IntrinsicBI
MOVVS r3, #ModInfo + Incarnation_Postfix + 8 ;enough for 'Base',0
|
MOVVS r3, #ModInfo
]
BLVS ClaimSysHeapNode
|
[ ModHand_IntrinsicBI
MOV r3, #ModInfo + Incarnation_Postfix + 8 ;enough for 'Base',0
|
MOV r3, #ModInfo
]
BL ClaimSysHeapNode
]
EXIT VS
STR r9, [r2, #Module_code_pointer]
......@@ -1900,7 +1924,15 @@ LinkAndInit ENTRY "r2, r3"
MOV r0, #HeapReason_Free
SWI XOS_Heap
MOV r2, r9 ; node pointer
[ ChocolateSysHeap
ASSERT ChocolateMABlocks = ChocolateBlockArrays + 16
MOV r1,#ChocolateBlockArrays
LDR r1,[r1,#16]
BL FreeChocolateBlock
BLVS FreeSysHeapNode
|
BL FreeSysHeapNode
]
Pull "r0, r2, r3, lr"
ORRS pc, lr, #V_bit
......@@ -1990,8 +2022,17 @@ CallInit ROUT
MOV R4, R0
MOV R11, R1
[ ChocolateSysHeap
ASSERT ChocolateMSBlocks = ChocolateBlockArrays + 20
MOV r3,#ChocolateBlockArrays
LDR r3,[r3,#20]
BL ClaimChocolateBlock
MOVVS R3, #ModSWINode_Size
BLVS ClaimSysHeapNode
|
MOV R3, #ModSWINode_Size
BL ClaimSysHeapNode
]
BVS %FT02
STR R9, [R2, #ModSWINode_MListNode]
STR R4, [R2, #ModSWINode_CallAddress]
......@@ -2164,7 +2205,15 @@ FreeSWIEntry ROUT
BNE %BT01
LDR R4, [R2, #ModSWINode_Link]