[Cbe-oss-dev] [PATCH 11/17]MARS/modules/task: Increase exec bss int size

Yuji Mano yuji.mano at am.sony.com
Wed Dec 3 13:59:10 EST 2008


Update task context structure definition.

This updates the task context structure to adjust to the updated definition of
the mars_workload_module structure.

This also fixes a bug that increases the 'exec_size' and 'bss_size' structure
members from 16-bit to 32-bit integers in order to support task executables
greater than 64K.

This also removes the unnecessary structure member 'vaddr' since it should be a
static define.

Signed-off-by: Yuji Mano <yuji.mano at am.sony.com>

---
 modules/task/src/common/task_internal_types.h |   12 +++++-------
 modules/task/src/host/lib/task.c              |    1 -
 modules/task/src/mpu/module/task_module.c     |    8 ++++----
 3 files changed, 9 insertions(+), 12 deletions(-)

--- a/modules/task/src/common/task_internal_types.h
+++ b/modules/task/src/common/task_internal_types.h
@@ -52,18 +52,16 @@
 
 struct mars_task_context {
 	struct mars_workload_module module;	/* workload module */
-	struct mars_task_id id;			/* task id */
-	struct mars_task_args args;		/* task args */
+	int32_t exit_code;			/* exit code */
 	uint64_t exec_ea;			/* ea of exec */
-	uint16_t exec_size;			/* text/data size of exec */
-	uint16_t bss_size;			/* bss size of exec */
-	uint32_t vaddr;				/* vaddr address of exec */
+	uint32_t exec_size;			/* text/data size of exec */
+	uint32_t bss_size;			/* bss size of exec */
 	uint32_t entry;				/* entry address of exec */
 	uint32_t stack;				/* stack pointer of exec */
 	uint64_t context_save_area_ea;		/* context save area */
 	uint64_t context_save_unit_ea;		/* context save unit list */
-	int32_t exit_code;			/* exit code */
-	uint8_t pad[4];				/* padding */
+	struct mars_task_id id;			/* task id */
+	struct mars_task_args args;		/* task args */
 } __attribute__((aligned(MARS_TASK_CONTEXT_ALIGN)));
 
 #endif
--- a/modules/task/src/host/lib/task.c
+++ b/modules/task/src/host/lib/task.c
@@ -136,7 +136,6 @@ int mars_task_create(struct mars_context
 		goto error_map_exec;
 	}
 	task->bss_size = phdr_task->p_memsz - phdr_task->p_filesz;
-	task->vaddr = phdr_task->p_vaddr;
 	task->entry = ehdr_task->e_entry;
 
 	/* initialize task id */
--- a/modules/task/src/mpu/module/task_module.c
+++ b/modules/task/src/mpu/module/task_module.c
@@ -203,7 +203,7 @@ static void __attribute__((noinline)) co
 			break;
 
 		/* request dma put of the context save unit specified */
-		mars_dma_large_put((void *)(task->vaddr + list[i].addr),
+		mars_dma_large_put((void *)(MARS_TASK_ELF_VADDR + list[i].addr),
 			task->context_save_area_ea + offset,
 			list[i].size, MARS_DMA_TAG);
 
@@ -230,7 +230,7 @@ static void __attribute__((noinline)) co
 			break;
 
 		/* request dma get of the context save unit specified */
-		mars_dma_large_get((void *)(task->vaddr + list[i].addr),
+		mars_dma_large_get((void *)(MARS_TASK_ELF_VADDR + list[i].addr),
 			task->context_save_area_ea + offset,
 			list[i].size, MARS_DMA_TAG);
 
@@ -418,11 +418,11 @@ void mars_module_main(void)
 	/* if stack pointer is uninitialized run fresh, otherwise resume */
 	if (!task->stack) {
 		/* dma the exec code into mpu storage from host storage */
-		mars_dma_large_get_and_wait((void *)task->vaddr,
+		mars_dma_large_get_and_wait((void *)MARS_TASK_ELF_VADDR,
 			task->exec_ea, task->exec_size, MARS_DMA_TAG);
 
 		/* 0 the bss section */
-		memset((void *)task->vaddr + task->exec_size, 0,
+		memset((void *)MARS_TASK_ELF_VADDR + task->exec_size, 0,
 			task->bss_size);
 
 		/* call entry function */






More information about the cbe-oss-dev mailing list