; Copyright 1996 Acorn Computers Ltd ; ; Licensed under the Apache License, Version 2.0 (the "License"); ; you may not use this file except in compliance with the License. ; You may obtain a copy of the License at ; ; http://www.apache.org/licenses/LICENSE-2.0 ; ; Unless required by applicable law or agreed to in writing, software ; distributed under the License is distributed on an "AS IS" BASIS, ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ; See the License for the specific language governing permissions and ; limitations under the License. ; ; > s.Workspace [ AMB_LazyMapIn AMBMIRegWords * ((AplWorkMaxSize:SHR:Log2PageSize)+31) :SHR: 5 ;no. of words for AMBMappedInRegister ;convenient to set this at fixed max size ;(only 896 bytes for 28Mb AppSpace) ] ; ;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_DANode # DANode_NodeSize ;DANode/PMP 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) [ AMB_LazyMapIn AMBPageFlags # 4 ;L2PT page flags to use when (lazily) mapping in pages ] AMBAnchorNode # AMBNode_HdrSize ;dummy node - see note (1) below ; [ ChocolateAMB AMBFlags # 4 ;bits defined as below [ AMB_ChocTrace AMBNmakeunsparse # 4 ;count of no. of calls to AMB_MakeUnsparse ] [ AMB_LazyMapIn 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 31 LazyMapIn permanent disable (eg. not running on StrongARM) AMBFlag_LazyMapIn_suspend * &40000000 ;bit 30 LazyMapIn 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. END