[Cbe-oss-dev] [PATCH 09/10]MARS: Kernel syscalls structure static initializer
Yuji Mano
yuji.mano at am.sony.com
Fri Oct 3 04:31:46 EST 2008
This removes the internal syscall_setup function and uses a static initializer
to initialize the mars_kernel_syscalls structure.
Signed-off-by: Yuji Mano <yuji.mano at am.sony.com>
---
include/mpu/mars/mars_kernel.h | 1
src/mpu/kernel/mars_kernel.c | 2 -
src/mpu/kernel/mars_kernel_syscalls.c | 40 ++++++++++++++++------------------
3 files changed, 19 insertions(+), 24 deletions(-)
--- a/include/mpu/mars/mars_kernel.h
+++ b/include/mpu/mars/mars_kernel.h
@@ -92,7 +92,6 @@ uint64_t syscall_get_workload_ea(void);
struct mars_workload_context *syscall_get_workload(void);
struct mars_workload_context *syscall_get_workload_by_id(uint16_t workload_id);
-void syscall_setup(void);
void syscall_init(void);
void syscall_exit(void);
void syscall_yield(void);
--- a/src/mpu/kernel/mars_kernel.c
+++ b/src/mpu/kernel/mars_kernel.c
@@ -49,8 +49,6 @@ int main(unsigned long long mpu_context_
int exit_flag = 0;
- syscall_setup();
-
mars_dma_get_and_wait(&kernel_params, kernel_params_ea,
sizeof(struct mars_kernel_params), MARS_DMA_TAG);
--- a/src/mpu/kernel/mars_kernel_syscalls.c
+++ b/src/mpu/kernel/mars_kernel_syscalls.c
@@ -37,33 +37,31 @@
#include "mars/mars_kernel.h"
-struct mars_kernel_syscalls kernel_syscalls;
-
void *kernel_stack;
void *workload_stack;
-void mars_reentry(void)
+struct mars_kernel_syscalls kernel_syscalls =
{
- syscall_resume();
-}
+ syscall_get_mars_context_ea,
+ syscall_get_kernel_id,
+ syscall_get_workload_id,
+ syscall_get_workload_ea,
+ syscall_get_workload,
+ syscall_get_workload_by_id,
+ syscall_init,
+ syscall_exit,
+ syscall_yield,
+ syscall_schedule,
+ syscall_wait,
+ syscall_try_wait,
+ syscall_signal_send,
+ syscall_signal_wait,
+ syscall_signal_try_wait
+};
-void syscall_setup(void)
+void mars_reentry(void)
{
- kernel_syscalls.get_mars_context_ea = syscall_get_mars_context_ea;
- kernel_syscalls.get_kernel_id = syscall_get_kernel_id;
- kernel_syscalls.get_workload_id = syscall_get_workload_id;
- kernel_syscalls.get_workload_ea = syscall_get_workload_ea;
- kernel_syscalls.get_workload = syscall_get_workload;
- kernel_syscalls.get_workload_by_id = syscall_get_workload_by_id;
- kernel_syscalls.init = syscall_init;
- kernel_syscalls.exit = syscall_exit;
- kernel_syscalls.yield = syscall_yield;
- kernel_syscalls.schedule = syscall_schedule;
- kernel_syscalls.wait = syscall_wait;
- kernel_syscalls.try_wait = syscall_try_wait;
- kernel_syscalls.signal_send = syscall_signal_send;
- kernel_syscalls.signal_wait = syscall_signal_wait;
- kernel_syscalls.signal_try_wait = syscall_signal_try_wait;
+ syscall_resume();
}
uint64_t syscall_get_mars_context_ea(void)
More information about the cbe-oss-dev
mailing list