move mailbox example to tests.c
This commit is contained in:
parent
11e25ee5c8
commit
de216756d1
4 changed files with 9 additions and 54 deletions
|
@ -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
|
||||
|
|
|
@ -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 <metalsvm/stddef.h>
|
||||
#include <metalsvm/stdio.h>
|
||||
#include <metalsvm/time.h>
|
||||
#include <metalsvm/tasks.h>
|
||||
#include <metalsvm/semaphore.h>
|
||||
#include <metalsvm/mailbox.h>
|
||||
#include <metalsvm/syscall.h>
|
||||
#ifdef CONFIG_ROCKCREEK
|
||||
#include <asm/icc.h>
|
||||
|
||||
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
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue