mirror of
https://github.com/drasko/codezero.git
synced 2026-03-02 10:33:15 +01:00
Cannot straightforwardly derive symbols conditionally from multiple sources in CML2
Ternary expressions on derive statements cause type errors (CML2 Bug?). modified: config/cml/arm.cml modified: scripts/conts/generate_kernel_cinfo.py
This commit is contained in:
@@ -335,10 +335,16 @@ when CONFIG_CONT0_TYPE_BARE==y suppress cont0_linux_pager_params
|
|||||||
when CONFIG_CONT1_TYPE_LINUX==y suppress cont1_bare_pager_params
|
when CONFIG_CONT1_TYPE_LINUX==y suppress cont1_bare_pager_params
|
||||||
when CONFIG_CONT1_TYPE_BARE==y suppress cont1_linux_pager_params
|
when CONFIG_CONT1_TYPE_BARE==y suppress cont1_linux_pager_params
|
||||||
|
|
||||||
derive CONFIG_CONT0_PAGER_LMA__ from CONFIG_CONT0_LINUX_PHYS_OFFSET + CONFIG_CONT0_LINUX_TEXT_OFFSET
|
derive CONFIG_CONT0_LINUX_LMA____ from CONFIG_CONT0_LINUX_PHYS_OFFSET + CONFIG_CONT0_LINUX_TEXT_OFFSET
|
||||||
derive CONFIG_CONT0_PAGER_VMA__ from CONFIG_CONT0_LINUX_PAGE_OFFSET
|
derive CONFIG_CONT0_PAGER_LMA__ from ((CONFIG_CONT0_TYPE_LINUX==y) ? CONFIG_CONT0_LINUX_LMA____ : CONFIG_CONT0_PAGER_LMA)
|
||||||
|
#derive CONFIG_CONT0_PAGER_VMA__ from CONFIG_CONT0_LINUX_PAGE_OFFSET
|
||||||
#derive CONFIG_CONT0_PAGER_LMA__ from CONFIG_CONT0_PAGER_LMA
|
#derive CONFIG_CONT0_PAGER_LMA__ from CONFIG_CONT0_PAGER_LMA
|
||||||
#derive CONFIG_CONT0_PAGER_VMA__ from CONFIG_CONT0_LINUX_VMA
|
#derive CONFIG_CONT0_PAGER_VMA__ from CONFIG_CONT0_PAGER_VMA
|
||||||
|
|
||||||
|
derive CONFIG_CONT1_PAGER_LMA__ from CONFIG_CONT1_PAGER_LMA
|
||||||
|
derive CONFIG_CONT1_PAGER_VMA__ from CONFIG_CONT1_PAGER_VMA
|
||||||
|
#derive CONFIG_CONT1_PAGER_LMA__ from CONFIG_CONT1_LINUX_PHYS_OFFSET + CONFIG_CONT1_LINUX_TEXT_OFFSET
|
||||||
|
#derive CONFIG_CONT1_PAGER_VMA__ from CONFIG_CONT1_LINUX_PAGE_OFFSET
|
||||||
|
|
||||||
symbols
|
symbols
|
||||||
containers_menu 'Configure Containers'
|
containers_menu 'Configure Containers'
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ cinfo_file_start = \
|
|||||||
#include <l4/generic/capability.h>
|
#include <l4/generic/capability.h>
|
||||||
#include <l4/generic/cap-types.h>
|
#include <l4/generic/cap-types.h>
|
||||||
|
|
||||||
|
%s
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FIXME:
|
* FIXME:
|
||||||
* Add irqs, exceptions
|
* Add irqs, exceptions
|
||||||
@@ -94,9 +96,35 @@ cap_physmem = \
|
|||||||
\t\t\t},
|
\t\t\t},
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
pager_ifdefs_todotext = \
|
||||||
|
'''
|
||||||
|
/*
|
||||||
|
* TODO:
|
||||||
|
* This had to be defined this way because in CML2 there
|
||||||
|
* is no straightforward way to derive symbols from expressions
|
||||||
|
* (a ternary expression of (? : ) form complains for type deduction.
|
||||||
|
*/'''
|
||||||
|
|
||||||
|
pager_ifdefs = \
|
||||||
|
'''
|
||||||
|
#if defined(CONFIG_CONT%d_TYPE_LINUX)
|
||||||
|
#define CONFIG_CONT%d_PAGER_LMA CONFIG_CONT%d_LINUX_PHYS_OFFSET + CONFIG_CONT%d_TEXT_OFFSET
|
||||||
|
#define CONFIG_CONT%d_PAGER_VMA CONFIG_CONT%d_LINUX_PAGE_OFFSET + CONFIG_CONT%d_TEXT_OFFSET
|
||||||
|
#define CONFIG_CONT%d_PAGER_SIZE CONFIG_CONT%d_LINUX_MAPSIZE
|
||||||
|
#endif
|
||||||
|
'''
|
||||||
|
def generate_pager_memory_ifdefs(containers):
|
||||||
|
pager_ifdef_string = pager_ifdefs_todotext
|
||||||
|
for c in containers:
|
||||||
|
pager_ifdef_string += pager_ifdefs % (c.id, c.id, \
|
||||||
|
c.id, c.id, \
|
||||||
|
c.id, c.id, \
|
||||||
|
c.id, c.id, c.id)
|
||||||
|
return pager_ifdef_string
|
||||||
def generate_kernel_cinfo(containers, cinfo_path):
|
def generate_kernel_cinfo(containers, cinfo_path):
|
||||||
|
pager_ifdefs = generate_pager_memory_ifdefs(containers)
|
||||||
with open(cinfo_path, 'w+') as cinfo_file:
|
with open(cinfo_path, 'w+') as cinfo_file:
|
||||||
fbody = cinfo_file_start
|
fbody = cinfo_file_start % pager_ifdefs
|
||||||
for c in containers:
|
for c in containers:
|
||||||
# Currently only these are considered as capabilities
|
# Currently only these are considered as capabilities
|
||||||
total_caps = c.virt_regions + c.phys_regions
|
total_caps = c.virt_regions + c.phys_regions
|
||||||
|
|||||||
Reference in New Issue
Block a user