Commit 526764e1 authored by ROOL's avatar ROOL 🤖

Simplify initial AplSpace claim

Detail:
  As the application slot is now a normal dynamic area, there's no need to manipulate the CAM directly. Convert FudgeSomeAppSpace into a OS_ChangeDynamicArea SWI followed by memset().
  ChangeDyn.s: Offset by 32k to account for the -32k that dynamic area -1 has.
  NewReset.s: Delete FudgeSomeAppSpace and replace as above.
Admin:
  Submission from Timothy Baldwin.

Version 6.08. Tagged as 'Kernel-6_08'
parent bcbd3602
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "6.07"
Module_Version SETA 607
Module_MajorVersion SETS "6.08"
Module_Version SETA 608
Module_MinorVersion SETS ""
Module_Date SETS "16 Jun 2018"
Module_ApplicationDate SETS "16-Jun-18"
Module_Date SETS "30 Jun 2018"
Module_ApplicationDate SETS "30-Jun-18"
Module_ComponentName SETS "Kernel"
Module_ComponentPath SETS "castle/RiscOS/Sources/Kernel"
Module_FullVersion SETS "6.07"
Module_HelpVersion SETS "6.07 (16 Jun 2018)"
Module_FullVersion SETS "6.08"
Module_HelpVersion SETS "6.08 (30 Jun 2018)"
END
/* (6.07)
/* (6.08)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 6.07
#define Module_MajorVersion_CMHG 6.08
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 16 Jun 2018
#define Module_Date_CMHG 30 Jun 2018
#define Module_MajorVersion "6.07"
#define Module_Version 607
#define Module_MajorVersion "6.08"
#define Module_Version 608
#define Module_MinorVersion ""
#define Module_Date "16 Jun 2018"
#define Module_Date "30 Jun 2018"
#define Module_ApplicationDate "16-Jun-18"
#define Module_ApplicationDate "30-Jun-18"
#define Module_ComponentName "Kernel"
#define Module_ComponentPath "castle/RiscOS/Sources/Kernel"
#define Module_FullVersion "6.07"
#define Module_HelpVersion "6.07 (16 Jun 2018)"
#define Module_LibraryVersionInfo "6:7"
#define Module_FullVersion "6.08"
#define Module_HelpVersion "6.08 (30 Jun 2018)"
#define Module_LibraryVersionInfo "6:8"
......@@ -4593,7 +4593,7 @@ InitAppSpaceTable
& ChangeDyn_AplSpace
& 0 ; base address
& AreaFlags_AppSpace
& 0 ; size will be set up later
& 32*1024 ; true size will be set up later
& AplWorkMaxSize
& 0 ; no workspace needed
& 0 ; no handler needed
......
......@@ -55,52 +55,6 @@ GetConfiguredSize Entry "r1"
MOV r2, r2, LSL r1 ; and shifted up accordingly
EXIT
; FudgeSomeAppSpace - move pages from free pool to application space
; r0 = number of pages to attempt to move
; r1 = where to store number of bytes moved
; r3 = base address of where to put memory
; r11 = ap + CB
FudgeSomeAppSpace
Push "lr"
LDR R10, =ZeroPage
LDR R10, [R10, #Page_Size]
MUL R0, R10, R0 ; get size in bytes
MOV R5, #0 ; amount moved
CMP R0, #0
BEQ NoMoreMemory
LDR r4, =ZeroPage+FreePoolDANode
LDR r7, [r4, #DANode_PMP]
LDR r8, [r4, #DANode_PMPSize]
10
CMP r8, #0 ; if no free memory left
BEQ %FT20 ; then tidy up
SUB r8, r8, #1 ; move free pool pointer backwards
MOV lr, #-1
LDR r2, [r7, r8, LSL #2]
STR lr, [r7, r8, LSL #2]
BL Call_CAM_Mapping
ADD r2, r3, r10 ; end of clear
MOV lr, #0
MOV ip, lr
15
STMIA r3!, {ip,lr} ; advance "to" pointer
STMIA r3!, {ip,lr}
STMIA r3!, {ip,lr}
STMIA r3!, {ip,lr}
TEQ r2, r3
BNE %BT15
ADD r5, r5, r10 ; one more page done
SUBS r0, r0, r10
BNE %BT10
20
STR r8, [r4, #DANode_PMPSize]
NoMoreMemory
STR R5, [R1]
Pull "PC"
; MassageScreenSize - called from screen DA creation and ReadSysInfo
MassageScreenSize ROUT
......@@ -317,28 +271,25 @@ conversionSWIfill
STR r3, [r7, #ScreenEndAddr]
Pull "r0-r12"
LDR R0, =(512*1024):SHR:12 ; 512k of RAM in aplspace should be plenty for ROM init.
; Theoretically we don't need any at all, but having some there
; should make it easier to debug any ROM init failures.
MOV R3, #AppSpaceStart ; aplwork start
LDR R1, =ZeroPage+AplWorkSize ; aplwork size
MOV r11, #AreaFlags_AppSpace
BL FudgeSomeAppSpace ; put some memory in aplspace
MOV R0, #ChangeDyn_FreePool ; 512k of RAM in AplSpace should be plenty for ROM init.
MOV R1, #512*1024 ; Theoretically we don't need any at all, but having some there
RSB R1, R1, #0 ; should make it easier to debug any ROM init failures.
SWI XOS_ChangeDynamicArea
LDR R1, =ZeroPage
LDR R0, [R1, #AplWorkSize]
STR R0, [R1, #MemLimit]
LDR R0, =ZeroPage
LDR R1, [R0, #AplWorkSize]
ADD R1, R1, #AppSpaceStart
STR R1, [R0, #AplWorkSize]
STR R1, [R0, #MemLimit]
MOV R0, AppSpaceStart
MOV R1, #0
MOV R2, #512*1024
BL memset ; Clear AplSpace
DebugTX "InitVectors"
BL InitVectors ; ready for OsByte to read mode
LDR R1, =ZeroPage+ModuleSWI_HashTab
MOV R2, #ModuleSHT_Entries
[ ZeroPage <> 0
MOV R0, #0
]
clearmswis
SUBS R2, R2, #1
STR R0, [R1, R2, LSL #2]
......@@ -525,7 +476,7 @@ clearmswis
; RMA => not cleared, it's in use
; Screen => not cleared, the next CLS will do that
; and
; Application space (from FudgeSomeAppSpace) => cleared unconditionally
; AplSpace (first 512k) => cleared unconditionally
; Free pool => clear now if HAL didn't
; left to do.
MOV r0, r6
......
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