[Cbe-oss-dev] [PATCH 02/10]MARS: Rename variable names for consistency

Yuji Mano yuji.mano at am.sony.com
Fri Oct 3 04:31:16 EST 2008


This renames some variables for consistency, to add the _ea suffix to all
variables that are effective addresses.

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

---
 include/common/mars/mars_task_types.h |    4 ++--
 src/host/lib/mars_task.c              |   10 +++++-----
 src/mpu/kernel/mars_kernel_task.c     |   10 +++++-----
 src/mpu/lib/mars_task.c               |    4 ++--
 src/mpu/lib/mars_task_barrier.c       |    4 ++--
 src/mpu/lib/mars_task_event_flag.c    |    2 +-
 src/mpu/lib/mars_task_queue.c         |    2 +-
 src/mpu/lib/mars_task_semaphore.c     |    2 +-
 src/mpu/lib/mars_task_signal.c        |    2 +-
 9 files changed, 20 insertions(+), 20 deletions(-)

--- a/include/common/mars/mars_task_types.h
+++ b/include/common/mars/mars_task_types.h
@@ -150,14 +150,14 @@ struct mars_task_id {
 struct mars_task_context {
 	struct mars_task_id id;		/* task id */
 	struct mars_task_args args;	/* task args */
-	uint64_t exec;			/* ea of exec */
+	uint64_t exec_ea;		/* ea of exec */
 	uint32_t exec_size;		/* size of text and data of exec */
 	uint32_t bss_size;		/* size of bss in memory of exec */
 	uint32_t vaddr;			/* vaddr address of exec */
 	uint32_t entry;			/* entry address of exec */
 	uint32_t stack;			/* stack pointer of exec */
 	uint32_t context_save_size;	/* context save size */
-	uint64_t context_save_area;	/* context save area */
+	uint64_t context_save_ea;	/* context save ea */
 	int32_t exit_code;		/* exit code */
 	uint8_t pad[20];		/* padding */
 } __attribute__((aligned(MARS_TASK_CONTEXT_ALIGN)));
--- a/src/host/lib/mars_task.c
+++ b/src/host/lib/mars_task.c
@@ -89,7 +89,7 @@ int mars_task_initialize(struct mars_con
 	memcpy(&task->id, id, sizeof(struct mars_task_id));
 
 	/* initialize the elf parameters */
-	task->exec = mars_ptr_to_ea((void *)ehdr + phdr->p_offset);
+	task->exec_ea = mars_ptr_to_ea((void *)ehdr + phdr->p_offset);
 	task->exec_size = phdr->p_filesz;
 	task->bss_size = phdr->p_memsz - phdr->p_filesz;
 	task->vaddr = phdr->p_vaddr;
@@ -98,16 +98,16 @@ int mars_task_initialize(struct mars_con
 	/* allocate the task context area if specified */
 	if (context_save_size) {
 		task->context_save_size = context_save_size;
-		task->context_save_area = mars_ptr_to_ea(memalign(
+		task->context_save_ea = mars_ptr_to_ea(memalign(
 			MARS_TASK_CONTEXT_SAVE_ALIGN, task->context_save_size));
 
-		MARS_CHECK_CLEANUP_RET(task->context_save_area,
+		MARS_CHECK_CLEANUP_RET(task->context_save_ea,
 			workload_queue_add_cancel(mars->workload_queue,
 				id->workload_id),
 			MARS_ERROR_MEMORY);
 	} else {
 		task->context_save_size = 0;
-		task->context_save_area = 0;
+		task->context_save_ea = 0;
 	}
 
 	/* end process to add the task to the workload queue */
@@ -144,7 +144,7 @@ int mars_task_finalize(struct mars_task_
 
 	/* free the allocated task context area if it has one */
 	if (task->context_save_size)
-		free(mars_ea_to_ptr(task->context_save_area));
+		free(mars_ea_to_ptr(task->context_save_ea));
 
 	/* end process to remove the task from the workload queue */
 	ret = workload_queue_remove_end(mars->workload_queue, id->workload_id);
--- a/src/mpu/kernel/mars_kernel_task.c
+++ b/src/mpu/kernel/mars_kernel_task.c
@@ -47,7 +47,7 @@ void task_exec(struct mars_task_context 
 	if (!task->stack) {
 		/* dma the exec code into mpu storage from host storage */
 		mars_dma_large_get_and_wait((void *)task->vaddr,
-					task->exec,
+					task->exec_ea,
 					task->exec_size,
 					MARS_DMA_TAG);
 
@@ -72,7 +72,7 @@ void task_exit(struct mars_task_context 
 void task_yield(struct mars_task_context *task)
 {
 	MARS_ASSERT(task);
-	MARS_ASSERT(task->context_save_area);
+	MARS_ASSERT(task->context_save_ea);
 	MARS_ASSERT(task->context_save_size);
 
 	/* save workload stack pointer */
@@ -80,7 +80,7 @@ void task_yield(struct mars_task_context
 
 	/* dma context into context save area in host storage */
 	mars_dma_large_put_and_wait((void *)task->vaddr,
-					task->context_save_area,
+					task->context_save_ea,
 					task->context_save_size,
 					MARS_DMA_TAG);
 }
@@ -88,7 +88,7 @@ void task_yield(struct mars_task_context
 void task_resume(struct mars_task_context *task)
 {
 	MARS_ASSERT(task);
-	MARS_ASSERT(task->context_save_area);
+	MARS_ASSERT(task->context_save_ea);
 	MARS_ASSERT(task->context_save_size);
 
 	/* restore workload stack pointer */
@@ -96,7 +96,7 @@ void task_resume(struct mars_task_contex
 
 	/* dma context to mpu storage from context save area in host storage */
 	mars_dma_large_get_and_wait((void *)task->vaddr,
-					task->context_save_area,
+					task->context_save_ea,
 					task->context_save_size,
 					MARS_DMA_TAG);
 }
--- a/src/mpu/lib/mars_task.c
+++ b/src/mpu/lib/mars_task.c
@@ -60,7 +60,7 @@ int mars_task_yield(void)
 	task = (struct mars_task_context *)mars_get_workload();
 
 	/* make sure task context has a context save area */
-	MARS_CHECK_RET(task->context_save_size && task->context_save_area,
+	MARS_CHECK_RET(task->context_save_size && task->context_save_ea,
 			MARS_ERROR_FORMAT);
 
 	mars_yield();
@@ -86,7 +86,7 @@ int mars_task_wait(struct mars_task_id *
 	task = (struct mars_task_context *)mars_get_workload();
 
 	/* make sure task context has a context save area */
-	MARS_CHECK_RET(task->context_save_size && task->context_save_area,
+	MARS_CHECK_RET(task->context_save_size && task->context_save_ea,
 			MARS_ERROR_FORMAT);
 
 	ret = mars_wait(id->workload_id);
--- a/src/mpu/lib/mars_task_barrier.c
+++ b/src/mpu/lib/mars_task_barrier.c
@@ -78,7 +78,7 @@ int mars_task_barrier_notify(uint64_t ba
 	task = (struct mars_task_context *)mars_get_workload();
 
 	/* make sure task context has a context save area */
-	MARS_CHECK_RET(task->context_save_size && task->context_save_area,
+	MARS_CHECK_RET(task->context_save_size && task->context_save_ea,
 			MARS_ERROR_FORMAT);
 
 	mars_mutex_lock_get(barrier_ea, (struct mars_mutex *)&barrier);
@@ -160,7 +160,7 @@ int mars_task_barrier_wait(uint64_t barr
 	task = (struct mars_task_context *)mars_get_workload();
 
 	/* make sure task context has a context save area */
-	MARS_CHECK_RET(task->context_save_size && task->context_save_area,
+	MARS_CHECK_RET(task->context_save_size && task->context_save_ea,
 			MARS_ERROR_FORMAT);
 
 	mars_mutex_lock_get(barrier_ea, (struct mars_mutex *)&barrier);
--- a/src/mpu/lib/mars_task_event_flag.c
+++ b/src/mpu/lib/mars_task_event_flag.c
@@ -175,7 +175,7 @@ int mars_task_event_flag_wait(uint64_t e
 	task = (struct mars_task_context *)mars_get_workload();
 
 	/* make sure task context has a context save area */
-	MARS_CHECK_RET(task->context_save_size && task->context_save_area,
+	MARS_CHECK_RET(task->context_save_size && task->context_save_ea,
 			MARS_ERROR_FORMAT);
 
 	mars_mutex_lock_get(event_flag_ea, (struct mars_mutex *)&event_flag);
--- a/src/mpu/lib/mars_task_queue.c
+++ b/src/mpu/lib/mars_task_queue.c
@@ -299,7 +299,7 @@ static int pop(uint64_t queue_ea, void *
 	task = (struct mars_task_context *)mars_get_workload();
 
 	/* make sure task context has a context save area */
-	MARS_CHECK_RET(task->context_save_size && task->context_save_area,
+	MARS_CHECK_RET(task->context_save_size && task->context_save_ea,
 			MARS_ERROR_FORMAT);
 
 	mars_mutex_lock_get(queue_ea, (struct mars_mutex *)&queue);
--- a/src/mpu/lib/mars_task_semaphore.c
+++ b/src/mpu/lib/mars_task_semaphore.c
@@ -78,7 +78,7 @@ int mars_task_semaphore_acquire(uint64_t
 	task = (struct mars_task_context *)mars_get_workload();
 
 	/* make sure task context has a context save area */
-	MARS_CHECK_RET(task->context_save_size && task->context_save_area,
+	MARS_CHECK_RET(task->context_save_size && task->context_save_ea,
 			MARS_ERROR_FORMAT);
 
 	mars_mutex_lock_get(semaphore_ea, (struct mars_mutex *)&semaphore);
--- a/src/mpu/lib/mars_task_signal.c
+++ b/src/mpu/lib/mars_task_signal.c
@@ -55,7 +55,7 @@ int mars_task_signal_wait(void)
 	task = (struct mars_task_context *)mars_get_workload();
 
 	/* make sure task context has a context save area */
-	MARS_CHECK_RET(task->context_save_size && task->context_save_area,
+	MARS_CHECK_RET(task->context_save_size && task->context_save_ea,
 			MARS_ERROR_FORMAT);
 
 	mars_signal_wait();






More information about the cbe-oss-dev mailing list