Commit 4e024bdb authored by Mike Stephens's avatar Mike Stephens
Browse files

Added following enhancements:

 - Chocolate screen mapping (section mapped and cached), StrongARM only
   Phoebe h/w (IOMD 2) will have register to assist this, but code currently
   relies on data abort mechanism to keep screen up to date wrt write-back
   data cache.

 - Chocolate AMBControl task switching (lazy page mapping), StrongARM only
   Improves task swapping speed. There appears to be a StrongAEM silicon
   bug rev 2 and 3) which means that LDMIB rn, {regs includind rn} cannot
   be reliably restarted after a data abort. This stuffs Chocolate AMBControl
   (awaiting response from Digital).

Both enhancements need more work to complete for Phoebe. Chocolate AMBControl
may well have to be made dormant because of silicon bug.

Note that this kernel *will* cause problems with task switching on StrongARM,
unless Chocolate task switching is disabled via !Flavour application.
parent 1c49b058
......@@ -205,6 +205,8 @@ OldOpt SETA {OPT}
; 05-Dec-95 WT Added ProcessorType and ProcessorFlags (1 byte each)
; amg 07/12/96 Renaissance. Shifted ResetType (which is a public export) so it'll
; stay in the same place.
; 15 May 97 MJS Replaced SyncCodeA_sema (byte) with ARMA_Cleaner_status (word) to
; support Chocolate flavour screen mapping on StrongARM
;
; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; Memory map:
......@@ -947,20 +949,42 @@ VStartSoftCopy # 4 ; soft copy of VStart so we can calculate VIDINI
DAList # 4 ; Pointer to first node on dynamic area list
[ STB
Export_ResetType # 1 ; &174 ; bit 0 => 1 = por, 0 = not por ; bits 1-7 reserved (zero)
Export_ResetType # 1 ; &174 ; bit 0 => 1 = por, 0 = not por ; bits 1-7 reserved (zero)
ASSERT Export_ResetType = ResetType
ASSERT ?Export_ResetType = ?ResetType
]
AlignSpace 16
AMBControl_ws # 4 ; workspace anchor word for AMBControl
ARMA_Cleaner_flipflop # 4 ; address of 16k StrongARM data cache cleaner area (flip flops between two)
[ StrongARM
SyncCodeA_sema # 1 ; re-entrancy semaphore for SynchroniseCodeAreas (full address space version)
! 0, "AMBControl_ws at ":CC::STR:(AMBControl_ws)
! 0, "ARMA_Cleaner_flipflop at ":CC::STR:(ARMA_Cleaner_flipflop)
! 0, "SyncCodeA_sema (byte) at ":CC::STR:(SyncCodeA_sema)
]
;
; next two words are for StrongARM data cache cleaning control - they should *never* be poked directly by non-kernel code
;
ARMA_Cleaner_flipflop # 4 ; address of 16k StrongARM data cache cleaner area for non-screen full cleans (NSC) - flipflops between two
;
ARMA_Cleaner_status # 4 ; status for cleans - Allows vsync screen cleaner (VSC) to avoid cleans if foreground non-screen or screen
; clean (NSC or SC) already done by other processes. Uncommon NSC's needn't update
; status. SC's and common NSC's should, with interrupts disabled.
; bit fields of ARMA_Cleaner_status (ACS_...) defined as follows:
;
ACS_SCdisable * &80000000 ; bit 31 SC disable flag - VSC and foreground SC disabled at all times if set (must be set if not StrongARM)
ACS_SCsuspend * &40000000 ; bit 30 SC suspend flag - VSC and foreground SC suspended if set
ACS_NSCsemaphore * &20000000 ; bit 29 NSC semaphore - NSC in progress if set
ACS_SCsemaphore * &10000000 ; bit 28 SC semaphore - SC in progress if set (may be VSC or foreground SC)
ACS_VSClazy_MASK * &0C000000 ; bits 26..27 VSC lazy - vsyncs before each triggered VSC will be executed (1..3, 0 is undefined)
ACS_VSClazy_SHIFT * 26
ACS_VSClazy_DEFAULT * 2:SHL:26
ACS_VSCcountdown_MASK * &03000000 ; bits 24..25 VSC countdown - vsyncs before next VSC will execute (0..3, 0=none pending, 1=at next vsync)
ACS_VSCcountdown_SHIFT * 24
ACS_SCflipflop * &00800000 ; bit 23 SC flipflip - controls flipflop between two 16k cleaner areas for SC's
ACS_SCflipflop_SHIFT * 23
ACS_SynchCAsemaphore * &00400000 ; bit 22 SychCA semaphore - set during SynchroniseCodeAreas (re-entrancy guard)
ACS_Scacheflag * &00200000 ; bit 21 Scache flag - set if screen currently cacheable (mainly for info to OS_ScreenMode)
; bit 0..20 reserved - 0
! 0, "AMBControl_ws at ":CC::STR:(AMBControl_ws)
! 0, "ARMA_Cleaner_flipflop at ":CC::STR:(ARMA_Cleaner_flipflop)
! 0, "ARMA_Cleaner_status at ":CC::STR:(ARMA_Cleaner_status)
[ StorkPowerSave
;;; AlignSpace 4
;;;VIDCExternalSoftCopy # 4 ; soft copy of VIDCExternal
......@@ -1025,8 +1049,8 @@ SkippedTablesEnd # 0
CMOSRAMCache # 240 ; Cache for CMOS RAM
[ STB
[ E2ROMSupport
NVRamSize # 1 ; Size of NVRam (E2ROM & CMOS) fitted in 256byte units
RTCFitted # 1 ; flag =1 iff RTC is fitted
NVRamSize # 1 ; Size of NVRam (E2ROM & CMOS) fitted in 256byte units
RTCFitted # 1 ; flag =1 iff RTC is fitted
]
]
......
......@@ -13,6 +13,12 @@
; limitations under the License.
;
; Implements OS_AMBControl (takes care of application memory management for Wimp)
;
; Nov 95 MJS development version originated as Module
; Jul 96 MJS fully implemented in kernel for RISC OS 3.70
; Mar 97 MJS performance enhancements for Ursula OS
GET s.AMBControl.Options
GET s.AMBControl.Workspace
GET s.AMBControl.main
......
......@@ -13,10 +13,12 @@
; limitations under the License.
;
; > s.Options
AMBMagicNodeID * &4E424D41 ;"AMBN"
AMBInitialMaxNodes * 256
AMBGrowMaxNodes * 64
AMBGrowMaxNodes * 64 ;not used now AMBControl is in kernel
;Bin pages by physical address, for quick mapping from page number to
......@@ -33,15 +35,63 @@ ApplicationStart * (32*1024)
PageSize * (4*1024)
Log2PageSize * 12 ;for shifts
AbsMaxAppSize * (28*1024*1024) ;28 Mb application space limit for RISC OS
AbsMaxAppSize * (28*1024*1024) ;28 Mb application space limit for RISC OS
AbsMaxAppPages * (AbsMaxAppSize:SHR:Log2PageSize) ;and same limit expressed in Pages
[ ChocolateAMB
AMBMIRegWords * (AbsMaxAppPages+31) :SHR: 5 ;no. of words for AMBMappedInRegister
;convenient to set this at fixed max size
;(only 896 bytes for 28Mb AppSpace)
]
;maximum logical space size cleaned by range strategy
;
AMB_ARMA_CleanRange_thresh * 256*1024
;Cleaning a sufficiently small space by range will be quicker, because of the fixed
;memory reading cost for a full DC clean. A sufficiently large space will be better handled
;by full clean, because of the huge number of clean/flush line instructions for the range
;case. We use a threshold to switch between the two schemes. The value of the threshold
;depends on memory speed, core speed etc. but is not particularly critical.
;
AMB_ARMA_CleanRange_thresh * 256*1024 ;must be whole no. pages
;
AMB_ARMA_CleanSparseRange_thresh * 256*1024 ;must be whole no. pages
GBLL ValidateAMBHandles ; whether to check handles given to AppMAMBan
;whether to check handles given to AMBControl - not very useful when in kernel
;
GBLL ValidateAMBHandles
ValidateAMBHandles SETL {FALSE}
;performance enhancements introduced for Ursula OS
;
; ChocolateAMB - if {FALSE}, disables all AMBControl crazy chocolate flavour enhancements
; (defined in kernel GetAll, since other parts of kernel need hooks if true)
;
; AMB_LazyMapIn - if {TRUE}, individual pages of a swapped-in task are only mapped in when
; necessary (happens via abort mechanism). This typically makes the swapping
; cost much lower and much less sensitive to large slot size. The worst case
; swapping cost is still good (abort mechanism cost is very small).
;
; AMB_StickyLastNode - if {TRUE}, the last deallocated node (the node itself, not the AppSpace
; pages) is retained, with page list. If the next allocate occurs
; without any intervening FreePool mangling, the page list is reused to save
; work. This is handy especially because the FreePool L2PT area is uncached.
;
; AMB_LimpidFreePool - if {TRUE}, the FreePool is normally assumed to be crystal clear (pages inactive),
; so that cache flushing is not required on mapping out from the FreePool. This
; requires a call to AMBControl from the Wimp to maintain FreePool status, if
; Wimp_ClaimFreeMemory is still supported.
;
; AMB_ChocTrace - if {TRUE}, keep trace info for some enhanced code calls and data (probably development only)
GBLL AMB_LazyMapIn
GBLL AMB_StickyLastNode
GBLL AMB_LimpidFreePool
GBLL AMB_ChocTrace
AMB_LazyMapIn SETL {TRUE} :LAND: ChocolateAMB
AMB_StickyLastNode SETL {FALSE} :LAND: ChocolateAMB ;NOT implemented yet
AMB_LimpidFreePool SETL {FALSE} :LAND: ChocolateAMB ;NOT implemented yet
AMB_ChocTrace SETL {TRUE} :LAND: ChocolateAMB
END
......@@ -14,36 +14,76 @@
;
; > s.Workspace
; task node format
^ 0
AMBNode_id # 4 ; magic identifier
AMBNode_handle # 4 ; handle for external reference
AMBNode_prev # 4 ; -> previous node
AMBNode_next # 4 ; -> next node
AMBNode_pagetable # 0 ; data comprising page table from here on
AMBNode_Npages # 4 ; no. of pages in page list
AMBNode_startaddr # 4 ; logical address of first page (-1 means nowhere)
AMBNode_PPL # 4 ; PPL ('page protection level') for pages
AMBNode_pages # 0 ; list of pages from here on (1 word per page no.)
; main workspace
^ 0,R12
AMBNhandles # 4 ; total handles available
AMBNtasks # 4 ; No. of tasks currently allocated
AMBMappedInNode # 4 ; node ptr of mapped-in task, or 0 for none
;ptr to node handle array (1 word per entry)
AMBNodeHandles # 4
;ptr to physical page bin array
AMBPhysBin # 4
AMBPhysBinEntries # 4
;dummy node (0 page entries) forms anchor of circular node list
;this averts the need for any special case for add or remove node
AMBAnchorNode # (AMBNode_pages - AMBNode_id)
AMBmaxwork * :INDEX:@
;
;task node format
;
^ 0
AMBNode_HdrStart # 0
AMBNode_id # 4 ;magic identifier
AMBNode_handle # 4 ;handle for external reference
AMBNode_prev # 4 ;ptr to previous node
AMBNode_next # 4 ;ptr to next node
AMBNode_pagetable # 0 ;data comprising page table from here on
AMBNode_Npages # 4 ;no. of pages in page list
AMBNode_startaddr # 4 ;logical address of first page (-1 means nowhere)
AMBNode_PPL # 4 ;PPL ('page protection level') for pages
AMBNode_pages # 0 ;list of page numbers from here on (1 word per page)
AMBNode_HdrEnd # 0
;
AMBNode_HdrSize * AMBNode_HdrEnd - AMBNode_HdrStart
;
;main workspace
;
^ 0,R12
AMBNhandles # 4 ;total handles available
AMBNtasks # 4 ;no. of tasks currently allocated
AMBMappedInNode # 4 ;node ptr of mapped-in task, or 0 for none
AMBNodeHandles # 4 ;ptr to node handle array (1 word per entry)
AMBPhysBin # 4 ;ptr to physical page bin array
AMBPhysBinEntries # 4 ;no. of entries in physical page bin array
AMBAnchorNode # AMBNode_HdrSize ;dummy node - see note (1) below
;
[ ChocolateAMB
AMBFlags # 4 ;bits defined as below
AMBNContextSwitches # 4 ;monotonic count of total no. of task map-in's (eg. for performance tracing)
[ AMB_ChocTrace
AMBNmakeunsparse # 4 ;count of no. of calls to AMB_MakeUnsparse
AMBNmemmoveshrink # 4 ;count of no. of Service_MemoryMoved shrink fixups
AMBNmemmovegrow # 4 ;count of no. of Service_MemoryMoved grow fixups
]
AMBMappedInNpages # 4 ;no. of pages of MappedInNode really mapped in
AMBMappedInRegister # AMBMIRegWords*4 ;1 bit per page - see note (2) below
]
;
AMBmaxwork * :INDEX:@ ;size of main workspace (assumed to be multiple of 4 bytes)
[ ChocolateAMB
;
;definition of bits in AMBFlags
;
AMBFlag_LazyMapIn_disable * &80000000 ;bit 32 permanent disable (eg. not running on StrongARM)
AMBFlag_LazyMapIn_suspend * &40000000 ;bit 30 suspend (controlled via AMB SWI)
;bits 29..0 reserved (0)
;
]
;Notes:
;
; (1) AMBAnchorNode is a dummy node with 0 page entries that forms the anchor of a
; circular node list. This averts the need for any special case for adding or
; removing nodes.
;
; (2) AMBMappedInRegister is a 'bitmap' of the current page mapping status of the
; MappedInNode. This supports AMB_LazyMapIn. Bit n corresponds to the n'th page
; of the MappedInNode; if it is set, then that page is currently mapped in. The
; bits are packed 'little endian', so bit 0 is the LSB of word 0, bit 31 is
; the MSB of word 0, bit 32 is the LSB of word 1 and so on. The bits are only
; significant when AMBMappedInNpages is > 0 (and then all AMBNode_Npages bits
; for the MappedInNode are significant).
END
......@@ -27,6 +27,8 @@
allocate
Push "R0,R3,R4,LR"
; Debug AMB,"allocate ",r0,r1
MOV R3,#AbsMaxAppSize
SUB R3,R3,#ApplicationStart
MOV R3,R3,LSR #Log2PageSize ;R3 = absolute max app pages
......@@ -128,8 +130,10 @@ alloc_ok
STR R2,AMBMappedInNode ;allocated node is also mapped in
LDR R2,[R2,#AMBNode_handle] ;change address to handle
CLRV
alloc_done
; Debug AMB,"<alloc ",r1,r2
STRVS R0,[SP]
Pull "R0,R3,R4,LR"
B SLVK_TestV
......
......@@ -27,6 +27,8 @@
deallocate
Push "R0-R3,LR"
; Debug AMB,"deallocate ",r0,r2
[ ValidateAMBHandles
;validate handle
LDR R0,AMBNhandles
......@@ -78,6 +80,7 @@ deallocate
;free node (at R2)
MOV R0,#ModHandReason_Free
BL XROS_Module
dealloc_done
STRVS R0,[SP]
Pull "R0-R3,LR"
......
......@@ -62,10 +62,21 @@ growpages ROUT
; R5 := start logical address
BL AMB_FindMemMapEntries ;find page nos.
[ AMB_LazyMapIn
LDR R5,AMBFlags
TST R5,#AMBFlag_LazyMapIn_disable :OR: AMBFlag_LazyMapIn_suspend
;
MOVEQ R5,#-1 ;map the pages to Nowhere initially
MOVEQ R6,#AP_Duff
LDRNE R5,[R0,#AMBNode_startaddr]
ADDNE R5,R5,R7,LSL #Log2PageSize ;R5 := first new page new address
LDRNE R6,[R0,#AMBNode_PPL] ;R6 := dest PPL flags
|
LDR R5,[R0,#AMBNode_startaddr]
ADD R5,R5,R7,LSL #Log2PageSize ;R5 := first new page new address
LDR R6,[R0,#AMBNode_PPL] ;R6 := dest PPL flags
]
;
;entry: R3 = no. of pages, R4 -> list of page entries,
; R5 = start logical address, R6 = PPL
BL AMB_SetMemMapEntries ;remap
......@@ -81,7 +92,8 @@ growpages ROUT
STR R5,[R6,#MemLimit] ;update MemLimit
02
STRVS R0,[SP]
;;; STRVS R0,[SP]
CLRV
Pull "R0-R7,PC"
[ ShrinkableDAs
......
......@@ -31,6 +31,8 @@ growshrink
Push "R0,R2,R4,R5,LR"
; Debug AMB,"growshrink ",r0,r1,r2
MOV R5,#AbsMaxAppSize
SUB R5,R5,#ApplicationStart
MOV R5,R5,LSR #Log2PageSize ;R5 = absolute max app pages
......
......@@ -13,28 +13,36 @@
; limitations under the License.
;
; AMBControl - takes care of application memory management (for Wimp)
;Nov 95 - Started by mjs
; > s.main
;;; Initialisation
;
AMBControl_Init
Push "R0-R4,R12,LR"
;claim main workspace
LDR R3,=AMBmaxwork
BL ClaimSysHeapNode
;;; BVS err_cantclaim - this should not happen
;;; BVS err_cantclaim - this should not happen
;don't store ws pointer till end of initialise - service routines must
;know when initialise is not yet complete
;
MOV R12,R2
;block for handle array
;zero-init workspace
MOV R1,#0
LDR R3,=AMBmaxwork
ADD R3,R3,R2
00
STR R1,[R2],#4
CMP R2,R3
BLO %BT00
;claim block for handle array
MOV R3,#(AMBInitialMaxNodes:SHL:2)
BL ClaimSysHeapNode
;;; BVS err_cantclaim
;;; BVS err_cantclaim
STR R2,AMBNodeHandles
;put all handles on free list (entry 0 is used as hdr of free list)
......@@ -49,7 +57,7 @@ AMBControl_Init
MOV R0,#0 ; = end of list
STR R0,[R2]
;block for PhysBin array
;claim block for PhysBin array
LDR R3,=MaxCamEntry
LDR R3,[R3]
ADD R3,R3,#1 ;no. of RAM pages extant
......@@ -57,7 +65,7 @@ AMBControl_Init
STR R3,AMBPhysBinEntries
MOV R3,R3,LSL #2 ;1 word per entry
BL ClaimSysHeapNode
;;; BVS err_cantclaim
;;; BVS err_cantclaim
STR R2,AMBPhysBin
;init PhysBin
......@@ -77,22 +85,21 @@ AMBControl_Init
SUBS R4,R4,#1
BNE %BT03
; init anchor node stuff etc.
MOV R0,#0
STR R0,AMBNtasks
STR R0,AMBMappedInNode
;init any other workspace that shouldn't init as 0
ADR R1,AMBAnchorNode
MOV R3,R1
STR R0,[R1],#4 ; node id = 0 for ank node (not a real node!)
STR R0,[R1],#4 ; handle = 0
STR R3,[R1],#4 ; prev (starts -> ank node)
STR R3,[R1],#4 ; next (starts -> ank node)
STR R0,[R1],#4 ; Npages
STR R0,[R1],#4 ; startaddr
STR R0,[R1],#4 ; PPL
STR R1,[R1,#AMBNode_prev] ;anchor prev initially -> anchor (empty list)
STR R1,[R1,#AMBNode_next] ;anchor next initially -> anchor (empty list)
[ AMB_LazyMapIn
;only allowed for StrongARM (abort fix up = nightmare for ARM 6,7, who cares about ARM8)
;
ARM_read_ID R1
AND R1,R1,#&F000
CMP R1,#&A000
MOVNE R1,#AMBFlag_LazyMapIn_disable
STRNE R1,AMBFlags
]
MOV R0,#AMBControl_ws
STR R12,[R0] ;now initialisation is complete
STR R12,[R0] ;now initialisation is complete
Pull "R0-R4,R12,PC"
......@@ -119,7 +126,11 @@ reasons0
B growshrink ;2
B mapslot ;3
B readinfo ;4
[ AMB_LazyMapIn
B laziness ;5
|
B reserved ;5
]
B reserved ;6
B reserved ;7
B mjs_info ;8 - system reason code, dumps info to buffer
......@@ -128,6 +139,58 @@ reasons1
B SLVK_SetV
[ AMB_LazyMapIn
;
;entry: R0=5 (reason),R1=1 for lazy on, 0 for lazy off, -1 to read lazy only
;exit: R1=new lazy value, after any restrictions of platform applied
;
;action: if reading only, if lazy disabled, or if new state = current, do nothing
; if state is changing, map out any current node, change state, map in any current node
;
laziness ROUT
Push "R2-R3,LR"
CMP R1,#-1
BEQ %FT20
LDR R2,AMBFlags ;R2 := current flags
TST R2,#AMBFlag_LazyMapIn_disable ;disable is permanent
BNE %FT20
CMP R1,#0
MOV R1,R2
ORREQ R1,R1,#AMBFlag_LazyMapIn_suspend
BICNE R1,R1,#AMBFlag_LazyMapIn_suspend ;R1 := new flags
EOR R3,R1,R2
TST R3,#AMBFlag_LazyMapIn_suspend ;is suspend status changing?
BEQ %FT20
LDR R3,AMBMappedInNode
CMP R3,#0
BEQ %FT10
Push "R0-R3"
MOV R0,#3
MOV R1,#-1
LDR R2,[R3,#AMBNode_handle]
SWI XOS_AMBControl ;map out current node
Pull "R0-R3"
10
STR R1,AMBFlags
CMP R3,#0
BEQ %FT20
Push "R0-R3"
MOV R0,#3
MOV R1,#0
LDR R2,[R3,#AMBNode_handle]
SWI XOS_AMBControl ;map in current node
Pull "R0-R3"
20
LDR R1,AMBFlags
TST R1,#AMBFlag_LazyMapIn_disable :OR: AMBFlag_LazyMapIn_suspend
MOVEQ R1,#1
MOVNE R1,#0
Pull "R2-R3,LR"
B SLVK
;
] ;AMB_LazyMapIn
;entry: R0=8 (reason),R1 -> buffer (say 4k for up to 255 tasks)
;exit: buffer filled:
; 0 Ntasks
......@@ -171,11 +234,6 @@ reserved
;;; errors (sod internationalisation)
;;;err_cantclaim
;;; DCD 0
;;; DCB "AMBControl failed to claim workspace",0
;;; ALIGN
err_badreason
DCD 0
DCB "bad AMBControl reason code",0
......
......@@ -23,8 +23,14 @@
; R2 = handle
; R3,R4 used if bit 8 set - see mapsome
;
; Note that if bit 8 is clear, the use is restricted to mapping in or out of
; whole slots only. Hence if bit 8 is clear, behaviour is undefined unless
; R1 is one of: 0, &8000 or -1.
;
mapslot
; Debug AMB,"mapslot",r0,r1,r2,r3,r4
TST R0,#&100 ;if bit 8 set, then mapsome
BNE mapsome
......@@ -71,16 +77,48 @@ mapslot
BEQ ms_done ;else do map only if not already mapped in, and asked to map in
ms_domap
CMP R5,#-1
CMP R5,#-1 ;EQ if it is a map out
LDREQ R6,=DuffEntry
MOVNE R6,#ApplicationStart
STR R6,[R1,#AMBNode_startaddr]
MOVEQ R6,#AP_Duff
MOVNE R6,#0
STR R6,[R1,#AMBNode_PPL]
[ AMB_LazyMapIn
LDRNE R2,AMBNContextSwitches
ADDNE R2,R2,#1
STRNE R2,AMBNContextSwitches
LDR R2,AMBFlags
TST R2,#AMBFlag_LazyMapIn_disable :OR: AMBFlag_LazyMapIn_suspend
BNE ms_cantbelazy
;
; - if map out, do sparse map out of whole page list then zero AMBMappedInNpages
; - if map in, just zero AMBMappedInNpages (last map out will have cleared AMBMappedInRegister)
;
MOV R2,R5
CMP R2,#-1
LDREQ R3,AMBMappedInNpages
ADREQ R5,AMBMappedInRegister
LDREQ R6,[R1,#AMBNode_Npages]
;entry: R3 = no. pages mapped in, R4 -> list of page entries,
; R5 -> bitmap of pages mapped in, R6=total no. of pages in page list
BLEQ AMB_SetMemMapEntries_SparseMapOut
MOV R3,#0
STR R3,AMBMappedInNpages
MOV R5,R2
B ms_mapdone
ms_cantbelazy
;entry: R3 = no. of pages, R4 -> list of page entries,
; R5 := start logical address, R6 = PPL
BL AMB_SetMemMapEntries
ms_mapdone
|
;entry: R3 = no. of pages, R4 -> list of page entries,
; R5 := start logical address, R6 = PPL
BL AMB_SetMemMapEntries
]
;update AppSpace kernel stuff
LDR R2,[R1,#AMBNode_Npages]
LDR R3,=AppSpaceDANode
......@@ -96,7 +134,8 @@ ms_domap
STR R3,AMBMappedInNode
ms_done
STRVS R0,[SP]
;;; STRVS R0,[SP]
CLRV
Pull "R0-R6,LR"
B SLVK_TestV
......
This diff is collapsed.
......@@ -21,12 +21,13 @@
;
; if there is a mapped-in node then recheck which and how many pages it owns
;
; I believe it should only be necessary to
; it is only necessary to:
; 1) reset node's idea of Npages to agree with no. of pages in app space
; 2) find the page numbers for new pages, if Npages has increased
; ie. I believe it is not necessary to recheck page numbers for whole node
; 2) if Npages has increased, find the page numbers for new pages [and update
; the mapped in list, if LazyMapIn]
; ie. page numbers of existing pages are not messed with
;
AMBsrv_memorymoved
AMBsrv_memorymoved ROUT
Push "R3-R6,R12,LR"
MOV R12,#AMBControl_ws
......@@ -47,7 +48,17 @@ AMBsrv_memorymoved
CMP R6,R3
STRNE R6,[R4,#AMBNode_Npages] ;update Npages
[ AMB_LazyMapIn
Pull "R3-R6,R12,PC",EQ,^ ;done if Npages same