mirror of
https://github.com/drasko/codezero.git
synced 2026-04-11 14:39:12 +02:00
Adding mechanism to have differnt run and load address for pagers
This commit is contained in:
@@ -60,6 +60,7 @@ cinfo_end = \
|
|||||||
pager_start = \
|
pager_start = \
|
||||||
'''
|
'''
|
||||||
\t\t[0] = {
|
\t\t[0] = {
|
||||||
|
\t\t\t.start_address = (CONFIG_CONT%d_INIT_PROG_COUNTER),
|
||||||
\t\t\t.pager_lma = __pfn(CONFIG_CONT%d_PAGER_LMA),
|
\t\t\t.pager_lma = __pfn(CONFIG_CONT%d_PAGER_LMA),
|
||||||
\t\t\t.pager_vma = __pfn(CONFIG_CONT%d_PAGER_VMA),
|
\t\t\t.pager_vma = __pfn(CONFIG_CONT%d_PAGER_VMA),
|
||||||
\t\t\t.pager_size = __pfn(CONFIG_CONT%d_PAGER_SIZE),
|
\t\t\t.pager_size = __pfn(CONFIG_CONT%d_PAGER_SIZE),
|
||||||
@@ -170,9 +171,14 @@ pager_ifdefs_todotext = \
|
|||||||
pager_ifdefs = \
|
pager_ifdefs = \
|
||||||
'''
|
'''
|
||||||
#if defined(CONFIG_CONT%(cn)d_TYPE_LINUX)
|
#if defined(CONFIG_CONT%(cn)d_TYPE_LINUX)
|
||||||
|
#define CONFIG_CONT%(cn)d_INIT_PROG_COUNTER \
|
||||||
|
(CONFIG_CONT%(cn)d_LINUX_ZRELADDR - CONFIG_CONT%(cn)d_LINUX_PHYS_OFFSET + \
|
||||||
|
CONFIG_CONT%(cn)d_LINUX_PAGE_OFFSET)
|
||||||
#define CONFIG_CONT%(cn)d_PAGER_LMA (CONFIG_CONT%(cn)d_LINUX_PHYS_OFFSET)
|
#define CONFIG_CONT%(cn)d_PAGER_LMA (CONFIG_CONT%(cn)d_LINUX_PHYS_OFFSET)
|
||||||
#define CONFIG_CONT%(cn)d_PAGER_VMA (CONFIG_CONT%(cn)d_LINUX_PAGE_OFFSET)
|
#define CONFIG_CONT%(cn)d_PAGER_VMA (CONFIG_CONT%(cn)d_LINUX_PAGE_OFFSET)
|
||||||
#define CONFIG_CONT%(cn)d_PAGER_SIZE CONFIG_CONT%(cn)d_LINUX_MAPSIZE
|
#define CONFIG_CONT%(cn)d_PAGER_SIZE CONFIG_CONT%(cn)d_LINUX_MAPSIZE
|
||||||
|
#else
|
||||||
|
#define CONFIG_CONT%(cn)d_INIT_PROG_COUNTER (CONFIG_CONT%(cn)d_PAGER_LMA)
|
||||||
#endif
|
#endif
|
||||||
'''
|
'''
|
||||||
def generate_pager_memory_ifdefs(containers):
|
def generate_pager_memory_ifdefs(containers):
|
||||||
@@ -183,7 +189,7 @@ def generate_pager_memory_ifdefs(containers):
|
|||||||
if linux == 0:
|
if linux == 0:
|
||||||
pager_ifdef_string += pager_ifdefs_todotext
|
pager_ifdef_string += pager_ifdefs_todotext
|
||||||
linux = 1
|
linux = 1
|
||||||
pager_ifdef_string += pager_ifdefs % { 'cn' : c.id }
|
pager_ifdef_string += pager_ifdefs % { 'cn' : c.id }
|
||||||
return pager_ifdef_string
|
return pager_ifdef_string
|
||||||
|
|
||||||
def generate_kernel_cinfo(config, cinfo_path):
|
def generate_kernel_cinfo(config, cinfo_path):
|
||||||
@@ -202,7 +208,7 @@ def generate_kernel_cinfo(config, cinfo_path):
|
|||||||
# Currently only these are considered as capabilities
|
# Currently only these are considered as capabilities
|
||||||
total_caps = c.virt_regions + c.phys_regions + total_other_caps
|
total_caps = c.virt_regions + c.phys_regions + total_other_caps
|
||||||
fbody += cinfo_start % (c.id, c.name)
|
fbody += cinfo_start % (c.id, c.name)
|
||||||
fbody += pager_start % (c.id, c.id, c.id, total_caps)
|
fbody += pager_start % (c.id, c.id, c.id, c.id, total_caps)
|
||||||
cap_index = 0
|
cap_index = 0
|
||||||
for mem_index in range(c.virt_regions):
|
for mem_index in range(c.virt_regions):
|
||||||
fbody += cap_virtmem % { 'capidx' : cap_index, 'cn' : c.id, 'vn' : mem_index }
|
fbody += cap_virtmem % { 'capidx' : cap_index, 'cn' : c.id, 'vn' : mem_index }
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ int init_pager(struct pager *pager,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize ktcb */
|
/* Initialize ktcb */
|
||||||
task_init_registers(task, pager->start_vma);
|
task_init_registers(task, pager->start_address);
|
||||||
|
|
||||||
/* Initialize container/pager relationships */
|
/* Initialize container/pager relationships */
|
||||||
pager->tcb = task;
|
pager->tcb = task;
|
||||||
|
|||||||
@@ -417,6 +417,7 @@ int copy_pager_info(struct pager *pager, struct pager_info *pinfo)
|
|||||||
struct capability *cap;
|
struct capability *cap;
|
||||||
struct cap_info *cap_info;
|
struct cap_info *cap_info;
|
||||||
|
|
||||||
|
pager->start_address = pinfo->start_address;
|
||||||
pager->start_lma = __pfn_to_addr(pinfo->pager_lma);
|
pager->start_lma = __pfn_to_addr(pinfo->pager_lma);
|
||||||
pager->start_vma = __pfn_to_addr(pinfo->pager_vma);
|
pager->start_vma = __pfn_to_addr(pinfo->pager_vma);
|
||||||
pager->memsize = __pfn_to_addr(pinfo->pager_size);
|
pager->memsize = __pfn_to_addr(pinfo->pager_size);
|
||||||
|
|||||||
Reference in New Issue
Block a user