From de216756d1c9d2655748b725261c261d91e60085 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Wed, 29 Jun 2011 12:29:04 -0700 Subject: [PATCH] move mailbox example to tests.c --- kernel/Makefile | 2 +- kernel/mailbox.c | 42 ------------------------------------------ kernel/main.c | 7 +++---- kernel/tests.c | 12 +++++------- 4 files changed, 9 insertions(+), 54 deletions(-) delete mode 100644 kernel/mailbox.c diff --git a/kernel/Makefile b/kernel/Makefile index f70f6a77..fdddee71 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -1,4 +1,4 @@ -C_source := main.c tasks.c syscall.c tests.c echo.c ping.c init.c mailbox.c +C_source := main.c tasks.c syscall.c tests.c echo.c ping.c init.c MODULE := kernel include $(TOPDIR)/Makefile.inc diff --git a/kernel/mailbox.c b/kernel/mailbox.c deleted file mode 100644 index c790f984..00000000 --- a/kernel/mailbox.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2010 Stefan Lankes, Chair for Operating Systems, - * RWTH Aachen University - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of MetalSVM. - */ - -#include -#include -#include -#include -#include -#include -#include -#ifdef CONFIG_ROCKCREEK -#include - -int STDCALL mail_ping(void* arg) { - icc_mail_ping(); - - return 0; -} - -int mailbox_test_init(void) -{ - create_kernel_task(NULL, mail_ping, NULL); - - return 0; -} -#endif diff --git a/kernel/main.c b/kernel/main.c index 91e3c1ea..566ff932 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -35,7 +35,7 @@ #endif extern int test_init(void); -extern int mailbox_test_init(void); + /* * Note that linker symbols are not variables, they have no memory allocated for * maintaining a value, rather their address is their value. @@ -112,11 +112,10 @@ int main(void) sleep(5); list_root(); -// test_init(); - mailbox_test_init(); + test_init(); per_core(current_task)->status = TASK_IDLE; reschedule(); - while(1); + while(1) { #ifdef CONFIG_ROCKCREEK icc_halt(); diff --git a/kernel/tests.c b/kernel/tests.c index 1fbc7a48..ad600b3e 100644 --- a/kernel/tests.c +++ b/kernel/tests.c @@ -87,13 +87,13 @@ static int STDCALL foo(void* arg) } #ifdef CONFIG_ROCKCREEK -static int STDCALL ping(void* arg) -{ +int STDCALL mail_ping(void* arg) { int i; for(i=0; i<20; i++) { - icc_ping(1); - HALT; + icc_mail_ping(); + //icc_halt(); + udelay(500000); } return 0; @@ -117,8 +117,6 @@ static int STDCALL join_test(void* arg) return 0; } -void ping_send_now(); - int test_init(void) { char* argv[] = {"/bin/tests", NULL}; @@ -131,7 +129,7 @@ int test_init(void) //create_kernel_task(NULL, join_test, NULL); //create_kernel_task(NULL, producer, NULL); //create_kernel_task(NULL, consumer, NULL); - //create_kernel_task(NULL, ping, NULL); + //create_kernel_task(NULL, mail_ping, NULL); //create_user_task(NULL, "/bin/hello", argv); create_user_task(NULL, "/bin/tests", argv); //create_user_task(NULL, "/bin/jacobi", argv);