From 8bb1069553c43f4bbe3746a23774a66550d20d91 Mon Sep 17 00:00:00 2001 From: Amit Mahajan Date: Tue, 20 Oct 2009 23:53:20 +0530 Subject: [PATCH] Adding mechanism to have differnt run and load address for pagers --- scripts/kernel/generate_kernel_cinfo.py | 10 ++++++++-- src/generic/container.c | 2 +- src/generic/resource.c | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/kernel/generate_kernel_cinfo.py b/scripts/kernel/generate_kernel_cinfo.py index 7e4a6b3..d3cd2ba 100755 --- a/scripts/kernel/generate_kernel_cinfo.py +++ b/scripts/kernel/generate_kernel_cinfo.py @@ -60,6 +60,7 @@ cinfo_end = \ pager_start = \ ''' \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_vma = __pfn(CONFIG_CONT%d_PAGER_VMA), \t\t\t.pager_size = __pfn(CONFIG_CONT%d_PAGER_SIZE), @@ -170,9 +171,14 @@ pager_ifdefs_todotext = \ pager_ifdefs = \ ''' #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_VMA (CONFIG_CONT%(cn)d_LINUX_PAGE_OFFSET) #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 ''' def generate_pager_memory_ifdefs(containers): @@ -183,7 +189,7 @@ def generate_pager_memory_ifdefs(containers): if linux == 0: pager_ifdef_string += pager_ifdefs_todotext linux = 1 - pager_ifdef_string += pager_ifdefs % { 'cn' : c.id } + pager_ifdef_string += pager_ifdefs % { 'cn' : c.id } return pager_ifdef_string 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 total_caps = c.virt_regions + c.phys_regions + total_other_caps 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 for mem_index in range(c.virt_regions): fbody += cap_virtmem % { 'capidx' : cap_index, 'cn' : c.id, 'vn' : mem_index } diff --git a/src/generic/container.c b/src/generic/container.c index 5813937..69cfbd1 100644 --- a/src/generic/container.c +++ b/src/generic/container.c @@ -105,7 +105,7 @@ int init_pager(struct pager *pager, } /* Initialize ktcb */ - task_init_registers(task, pager->start_vma); + task_init_registers(task, pager->start_address); /* Initialize container/pager relationships */ pager->tcb = task; diff --git a/src/generic/resource.c b/src/generic/resource.c index f0c5d68..267dccb 100644 --- a/src/generic/resource.c +++ b/src/generic/resource.c @@ -417,6 +417,7 @@ int copy_pager_info(struct pager *pager, struct pager_info *pinfo) struct capability *cap; struct cap_info *cap_info; + pager->start_address = pinfo->start_address; pager->start_lma = __pfn_to_addr(pinfo->pager_lma); pager->start_vma = __pfn_to_addr(pinfo->pager_vma); pager->memsize = __pfn_to_addr(pinfo->pager_size);