Files
codezero/config/cml/container_ruleset.template
2009-11-14 11:31:01 +02:00

305 lines
12 KiB
Plaintext

symbols
CONT%(cn)d_TYPE_LINUX 'Linux Container'
CONT%(cn)d_TYPE_BARE 'Bare Container'
CONT%(cn)d_TYPE_POSIX 'POSIX Container'
CONT%(cn)d_TYPE_TEST 'Test Container'
CONT%(cn)d_OPT_NAME 'Container Name'
CONT%(cn)d_PHYSMEM_REGIONS 'Container %(cn)d Number of Physical Regions'
CONT%(cn)d_PHYS0_START 'Container %(cn)d Physical Region 0 Start Address'
CONT%(cn)d_PHYS0_END 'Container %(cn)d Physical Region 0 End Address'
CONT%(cn)d_PHYS1_START 'Container %(cn)d Physical Region 1 Start Address'
CONT%(cn)d_PHYS1_END 'Container %(cn)d Physical Region 1 End Address'
CONT%(cn)d_PHYS2_START 'Container %(cn)d Physical Region 2 Start Address'
CONT%(cn)d_PHYS2_END 'Container %(cn)d Physical Region 2 End Address'
CONT%(cn)d_PHYS3_START 'Container %(cn)d Physical Region 3 Start Address'
CONT%(cn)d_PHYS3_END 'Container %(cn)d Physical Region 3 End Address'
symbols
CONT%(cn)d_VIRTMEM_REGIONS 'Container %(cn)d Number of Virtual Regions'
CONT%(cn)d_VIRT0_START 'Container %(cn)d Virtual Region 0 Start Address'
CONT%(cn)d_VIRT0_END 'Container %(cn)d Virtual Region 0 End Address'
CONT%(cn)d_VIRT1_START 'Container %(cn)d Virtual Region 1 Start Address'
CONT%(cn)d_VIRT1_END 'Container %(cn)d Virtual Region 1 End Address'
CONT%(cn)d_VIRT2_START 'Container %(cn)d Virtual Region 2 Start Address'
CONT%(cn)d_VIRT2_END 'Container %(cn)d Virtual Region 2 End Address'
CONT%(cn)d_VIRT3_START 'Container %(cn)d Virtual Region 3 Start Address'
CONT%(cn)d_VIRT3_END 'Container %(cn)d Virtual Region 3 End Address'
CONT%(cn)d_VIRT4_START 'Container %(cn)d Virtual Region 4 Start Address'
CONT%(cn)d_VIRT4_END 'Container %(cn)d Virtual Region 4 End Address'
CONT%(cn)d_VIRT5_START 'Container %(cn)d Virtual Region 5 Start Address'
CONT%(cn)d_VIRT5_END 'Container %(cn)d Virtual Region 5 End Address'
CONT%(cn)d_PAGER_LMA 'Container %(cn)d Pager LMA'
CONT%(cn)d_PAGER_VMA 'Container %(cn)d Pager VMA'
CONT%(cn)d_PAGER_SHM_START 'Container %(cn)d Shared Mappings Region Start'
CONT%(cn)d_PAGER_SHM_END 'Container %(cn)d Shared Mappings Region End'
CONT%(cn)d_PAGER_TASK_START 'Container %(cn)d Task Address Space Region Start'
CONT%(cn)d_PAGER_TASK_END 'Container %(cn)d Task Address Space Region End'
CONT%(cn)d_PAGER_UTCB_START 'Container %(cn)d UTCB Mappings Region Start'
CONT%(cn)d_PAGER_UTCB_END 'Container %(cn)d UTCB Mappings Region End'
CONT%(cn)d_LINUX_ZRELADDR 'Container %(cn)d Linux ZRELADDR parameter'
CONT%(cn)d_LINUX_PAGE_OFFSET 'Container %(cn)d Linux PAGE_OFFSET Parameter'
CONT%(cn)d_LINUX_PHYS_OFFSET 'Container %(cn)d Linux PHYS_OFFSET Parameter'
CONT%(cn)d_LINUX_ROOTFS_ADDRESS 'Container %(cn)d Linux ROOTFS Address'
default CONT%(cn)d_PAGER_LMA from CONT%(cn)d_PHYS0_START
default CONT%(cn)d_PAGER_VMA from CONT%(cn)d_VIRT0_START
default CONT%(cn)d_PAGER_SHM_START from 0x40000000
default CONT%(cn)d_PAGER_SHM_END from 0x50000000
default CONT%(cn)d_PAGER_TASK_START from 0x30000000
default CONT%(cn)d_PAGER_TASK_END from 0x40000000
default CONT%(cn)d_PAGER_UTCB_START from 0xf8100000
default CONT%(cn)d_PAGER_UTCB_END from 0xf8200000
default CONT%(cn)d_LINUX_ZRELADDR from (CONT%(cn)d_LINUX_PHYS_OFFSET + 0x8000)
default CONT%(cn)d_LINUX_PAGE_OFFSET from CONT%(cn)d_VIRT0_START
default CONT%(cn)d_LINUX_PHYS_OFFSET from CONT%(cn)d_PHYS0_START
default CONT%(cn)d_LINUX_ROOTFS_ADDRESS from (CONT%(cn)d_LINUX_PHYS_OFFSET + 0x500000)
default CONT%(cn)d_VIRTMEM_REGIONS from 1
default CONT%(cn)d_PHYSMEM_REGIONS from 1
# Define limits on virtual and physical memory regions of a _single_ container 0. Too much code!
when CONT%(cn)d_VIRTMEM_REGIONS < 2 suppress CONT%(cn)d_VIRT1_START CONT%(cn)d_VIRT1_END
when CONT%(cn)d_VIRTMEM_REGIONS < 2 suppress CONT%(cn)d_VIRT2_START CONT%(cn)d_VIRT2_END
when CONT%(cn)d_VIRTMEM_REGIONS < 2 suppress CONT%(cn)d_VIRT3_START CONT%(cn)d_VIRT3_END
when CONT%(cn)d_VIRTMEM_REGIONS < 2 suppress CONT%(cn)d_VIRT4_START CONT%(cn)d_VIRT4_END
when CONT%(cn)d_VIRTMEM_REGIONS < 2 suppress CONT%(cn)d_VIRT5_START CONT%(cn)d_VIRT5_END
when CONT%(cn)d_VIRTMEM_REGIONS < 3 suppress CONT%(cn)d_VIRT2_START CONT%(cn)d_VIRT2_END
when CONT%(cn)d_VIRTMEM_REGIONS < 3 suppress CONT%(cn)d_VIRT3_START CONT%(cn)d_VIRT3_END
when CONT%(cn)d_VIRTMEM_REGIONS < 3 suppress CONT%(cn)d_VIRT4_START CONT%(cn)d_VIRT4_END
when CONT%(cn)d_VIRTMEM_REGIONS < 3 suppress CONT%(cn)d_VIRT5_START CONT%(cn)d_VIRT5_END
when CONT%(cn)d_VIRTMEM_REGIONS < 4 suppress CONT%(cn)d_VIRT3_START CONT%(cn)d_VIRT3_END
when CONT%(cn)d_VIRTMEM_REGIONS < 4 suppress CONT%(cn)d_VIRT4_START CONT%(cn)d_VIRT4_END
when CONT%(cn)d_VIRTMEM_REGIONS < 4 suppress CONT%(cn)d_VIRT5_START CONT%(cn)d_VIRT5_END
when CONT%(cn)d_VIRTMEM_REGIONS < 5 suppress CONT%(cn)d_VIRT4_START CONT%(cn)d_VIRT4_END
when CONT%(cn)d_VIRTMEM_REGIONS < 5 suppress CONT%(cn)d_VIRT5_START CONT%(cn)d_VIRT5_END
when CONT%(cn)d_VIRTMEM_REGIONS < 6 suppress CONT%(cn)d_VIRT5_START CONT%(cn)d_VIRT5_END
when CONT%(cn)d_PHYSMEM_REGIONS < 2 suppress CONT%(cn)d_PHYS1_START CONT%(cn)d_PHYS1_END
when CONT%(cn)d_PHYSMEM_REGIONS < 2 suppress CONT%(cn)d_PHYS2_START CONT%(cn)d_PHYS2_END
when CONT%(cn)d_PHYSMEM_REGIONS < 2 suppress CONT%(cn)d_PHYS3_START CONT%(cn)d_PHYS3_END
when CONT%(cn)d_PHYSMEM_REGIONS < 3 suppress CONT%(cn)d_PHYS2_START CONT%(cn)d_PHYS2_END
when CONT%(cn)d_PHYSMEM_REGIONS < 3 suppress CONT%(cn)d_PHYS3_START CONT%(cn)d_PHYS3_END
when CONT%(cn)d_PHYSMEM_REGIONS < 4 suppress CONT%(cn)d_PHYS3_START CONT%(cn)d_PHYS3_END
### Sanity check for memory regions ###
require CONT%(cn)d_PHYS0_START < CONT%(cn)d_PHYS0_END
require CONT%(cn)d_PHYS1_START < CONT%(cn)d_PHYS1_END
require CONT%(cn)d_PHYS2_START < CONT%(cn)d_PHYS2_END
require CONT%(cn)d_PHYS3_START < CONT%(cn)d_PHYS3_END
require CONT%(cn)d_VIRT0_START < CONT%(cn)d_VIRT0_END
require CONT%(cn)d_VIRT1_START < CONT%(cn)d_VIRT1_END
require CONT%(cn)d_VIRT2_START < CONT%(cn)d_VIRT2_END
require CONT%(cn)d_VIRT3_START < CONT%(cn)d_VIRT3_END
require CONT%(cn)d_VIRT4_START < CONT%(cn)d_VIRT4_END
require CONT%(cn)d_VIRT5_START < CONT%(cn)d_VIRT5_END
# We assume kernel uses 0x0 - 0x40000 physical RAM.
# Physical Regions for containers should start after kernel.
require CONT%(cn)d_PHYS0_START >= 0x40000
require CONT%(cn)d_PHYS1_START >= 0x40000
require CONT%(cn)d_PHYS2_START >= 0x40000
require CONT%(cn)d_PHYS3_START >= 0x40000
# TODO: We can add check for end address of physical region to be
# less than RAM SIZE, need to find out RAM SIZE?
# Rules for Linux kernel parameters
require CONT%(cn)d_LINUX_ZRELADDR > CONT%(cn)d_LINUX_PHYS_OFFSET + 0x8000
# TODO: Do we want to check if PAGER_LMA/VMA lies in allocated memory regions
default CONT%(cn)d_PHYS0_START from 0x40000
default CONT%(cn)d_PHYS0_END from 0x1000000
default CONT%(cn)d_PHYS1_START from 0x1000000
default CONT%(cn)d_PHYS1_END from 0x1100000
default CONT%(cn)d_PHYS2_START from 0x1100000
default CONT%(cn)d_PHYS2_END from 0x1200000
default CONT%(cn)d_PHYS3_START from 0x1200000
default CONT%(cn)d_PHYS3_END from 0x1300000
default CONT%(cn)d_VIRT0_START from 0x90000000
default CONT%(cn)d_VIRT0_END from 0xa0000000
default CONT%(cn)d_VIRT1_START from 0x40000000
default CONT%(cn)d_VIRT1_END from 0x50000000
default CONT%(cn)d_VIRT2_START from 0x30000000
default CONT%(cn)d_VIRT2_END from 0x40000000
default CONT%(cn)d_VIRT3_START from 0xf8100000
default CONT%(cn)d_VIRT3_END from 0xf8200000
default CONT%(cn)d_VIRT4_START from 0xd0000000
default CONT%(cn)d_VIRT4_END from 0xe0000000
default CONT%(cn)d_VIRT5_START from 0xe0000000
default CONT%(cn)d_VIRT5_END from 0xf0000000
default CONT%(cn)d_OPT_NAME from (CONT%(cn)d_TYPE_LINUX==y) ? "linux%(cn)d" : ((CONT%(cn)d_TYPE_BARE==y) ? "bare%(cn)d" : ((CONT%(cn)d_TYPE_TEST==y) ? "test%(cn)d" : "posix%(cn)d"))
when CONT%(cn)d_TYPE_LINUX==y suppress cont%(cn)d_bare_pager_params cont%(cn)d_posix_pager_params
when CONT%(cn)d_TYPE_BARE==y suppress cont%(cn)d_linux_pager_params cont%(cn)d_posix_pager_params
when CONT%(cn)d_TYPE_TEST==y suppress cont%(cn)d_linux_pager_params cont%(cn)d_posix_pager_params
when CONT%(cn)d_TYPE_POSIX==y suppress cont%(cn)d_linux_pager_params
symbols
cont%(cn)d_menu 'Container %(cn)d Parameters'
cont%(cn)d_physmem_list 'Container %(cn)d Physical Memory Regions'
cont%(cn)d_virtmem_list 'Container %(cn)d Virtual Memory Regions'
container%(cn)d_type 'Container %(cn)d Type'
container%(cn)d_options 'Container %(cn)d Options'
cont%(cn)d_linux_pager_params 'Container %(cn)d Linux Pager Parameters'
cont%(cn)d_bare_pager_params 'Container %(cn)d Default Pager Parameters'
cont%(cn)d_posix_pager_params 'Container %(cn)d POSIX Pager Parameters'
menu cont%(cn)d_bare_pager_params
CONT%(cn)d_PAGER_LMA@
CONT%(cn)d_PAGER_VMA@
menu cont%(cn)d_posix_pager_params
CONT%(cn)d_PAGER_SHM_START@
CONT%(cn)d_PAGER_SHM_END@
CONT%(cn)d_PAGER_TASK_START@
CONT%(cn)d_PAGER_TASK_END@
CONT%(cn)d_PAGER_UTCB_START@
CONT%(cn)d_PAGER_UTCB_END@
menu cont%(cn)d_linux_pager_params
CONT%(cn)d_LINUX_PHYS_OFFSET@
CONT%(cn)d_LINUX_ZRELADDR@
CONT%(cn)d_LINUX_ROOTFS_ADDRESS@
CONT%(cn)d_LINUX_PAGE_OFFSET@
menu cont%(cn)d_virtmem_list
CONT%(cn)d_VIRTMEM_REGIONS%
CONT%(cn)d_VIRT0_START@
CONT%(cn)d_VIRT0_END@
CONT%(cn)d_VIRT1_START@
CONT%(cn)d_VIRT1_END@
CONT%(cn)d_VIRT2_START@
CONT%(cn)d_VIRT2_END@
CONT%(cn)d_VIRT3_START@
CONT%(cn)d_VIRT3_END@
CONT%(cn)d_VIRT4_START@
CONT%(cn)d_VIRT4_END@
CONT%(cn)d_VIRT5_START@
CONT%(cn)d_VIRT5_END@
menu cont%(cn)d_physmem_list
CONT%(cn)d_PHYSMEM_REGIONS%
CONT%(cn)d_PHYS0_START@
CONT%(cn)d_PHYS0_END@
CONT%(cn)d_PHYS1_START@
CONT%(cn)d_PHYS1_END@
CONT%(cn)d_PHYS2_START@
CONT%(cn)d_PHYS2_END@
CONT%(cn)d_PHYS3_START@
CONT%(cn)d_PHYS3_END@
# Options for custom capabilities
symbols
cont%(cn)d_cap0_rtype 'Capability Target Resource Type'
cont%(cn)d_cap0_type 'Capability Operation Type'
CONT%(cn)d_CAP0_IPC_TYPE 'IPC Capability'
CONT%(cn)d_CAP0_TCTRL_TYPE 'Thread Control Capability'
CONT%(cn)d_CAP0_TARGET_CURRENT_CONT 'Targets Current Container'
CONT%(cn)d_CAP0_TARGET_ANOTHER_CONT 'Targets Another Container'
CONT%(cn)d_CAP0_TARGET_CURRENT_PAGER_SPACE 'Targets Current Pager`s Space'
CONT%(cn)d_CAP0_TARGET_ANOTHER_PAGER 'Targets Another Pager'
CONT%(cn)d_CAP0_TARGET 'Enter Container ID'
choices cont%(cn)d_cap0_type
CONT%(cn)d_CAP0_IPC_TYPE
CONT%(cn)d_CAP0_TCTRL_TYPE
default CONT%(cn)d_CAP0_IPC_TYPE
menu cont%(cn)d_capability0
cont%(cn)d_cap0_type
cont%(cn)d_cap0_rtype
CONT%(cn)d_CAP0_TARGET%
choices cont%(cn)d_cap0_rtype
CONT%(cn)d_CAP0_TARGET_CURRENT_CONT
CONT%(cn)d_CAP0_TARGET_ANOTHER_CONT
CONT%(cn)d_CAP0_TARGET_CURRENT_PAGER_SPACE
CONT%(cn)d_CAP0_TARGET_ANOTHER_PAGER
default CONT%(cn)d_CAP0_TARGET_CURRENT_CONT
when CONT%(cn)d_CAP0_TARGET_CURRENT_CONT == y suppress CONT%(cn)d_CAP0_TARGET
when CONT%(cn)d_CAP0_TARGET_CURRENT_CONT == y suppress CONT%(cn)d_CAP0_TARGET
symbols
CONT%(cn)d_THREADPOOL_SIZE 'Number of Threads'
CONT%(cn)d_SPACEPOOL_SIZE 'Number of Address Spaces'
CONT%(cn)d_MAPPOOL_SIZE 'Number of PMD Mappings (E.g. Middle-level Page Tables)'
CONT%(cn)d_MUTEXPOOL_SIZE 'Number of Userspace Mutexes'
CONT%(cn)d_CAPPOOL_SIZE 'Number of Capabilities (Created via Split, Replicate)'
cont%(cn)d_cap_threadpool 'Container %(cn)d Thread Pool Capability'
cont%(cn)d_cap_spacepool 'Container %(cn)d Space Pool Capability'
cont%(cn)d_cap_mutexpool 'Container %(cn)d Mutex Pool Capability'
cont%(cn)d_cap_mappool 'Container %(cn)d Map Pool Capability'
cont%(cn)d_cap_cappool 'Container %(cn)d Capability Pool Capability'
cont%(cn)d_capability0 'Container %(cn)d Capability 0 Parameters'
cont%(cn)d_capability_list 'Container %(cn)d Capability List'
default CONT%(cn)d_CAP0_TARGET from 0
default CONT%(cn)d_THREADPOOL_SIZE from 64
default CONT%(cn)d_SPACEPOOL_SIZE from 64
default CONT%(cn)d_MAPPOOL_SIZE from 800
default CONT%(cn)d_MUTEXPOOL_SIZE from 100
default CONT%(cn)d_CAPPOOL_SIZE from 32
menu cont%(cn)d_cap_threadpool
CONT%(cn)d_THREADPOOL_SIZE%
menu cont%(cn)d_cap_spacepool
CONT%(cn)d_SPACEPOOL_SIZE%
menu cont%(cn)d_cap_mappool
CONT%(cn)d_MAPPOOL_SIZE%
menu cont%(cn)d_cap_mutexpool
CONT%(cn)d_MUTEXPOOL_SIZE%
menu cont%(cn)d_cap_cappool
CONT%(cn)d_CAPPOOL_SIZE%
menu cont%(cn)d_capability_list
cont%(cn)d_cap_threadpool
cont%(cn)d_cap_spacepool
cont%(cn)d_cap_mutexpool
cont%(cn)d_cap_mappool
cont%(cn)d_cap_cappool
cont%(cn)d_capability0
menu container%(cn)d_options
CONT%(cn)d_OPT_NAME$
cont%(cn)d_linux_pager_params
cont%(cn)d_bare_pager_params
cont%(cn)d_posix_pager_params
cont%(cn)d_physmem_list
cont%(cn)d_virtmem_list
cont%(cn)d_capability_list
choices container%(cn)d_type
CONT%(cn)d_TYPE_BARE
CONT%(cn)d_TYPE_POSIX
CONT%(cn)d_TYPE_LINUX
CONT%(cn)d_TYPE_TEST
default CONT%(cn)d_TYPE_BARE
menu cont%(cn)d_menu
container%(cn)d_type
container%(cn)d_options