stuff.c

Go to the documentation of this file.
00001 /*!
00002  * \file        log/server/src/stuff.c
00003  * \brief       Log-Server, div. stuff like thread creation.
00004  *
00005  * \date        03/02/2001
00006  * \author      Jork Loeser <jork.loeser@inf.tu-dresden.de>
00007  *
00008  */
00009 /* (c) 2003 Technische Universitaet Dresden
00010  * This file is part of DROPS, which is distributed under the terms of the
00011  * GNU General Public License 2. Please see the COPYING file for details.
00012  */
00013 
00014 #include <l4/sys/syscalls.h>
00015 #include <l4/sys/ipc.h>
00016 #include <l4/util/thread.h>
00017 #include <l4/log/l4log.h>
00018 #include <l4/names/libnames.h>
00019 #include <stdio.h>
00020 #include "stuff.h"
00021 #include "flusher.h"
00022 #include "config.h"
00023 
00024 #if CONFIG_USE_TCPIP
00025 /* We need heap for the net, 512KB seems to be sufficient. Define this here.
00026  */
00027 oskit_addr_t l4libc_heapsize = 1024*512;
00028 #endif
00029 
00030 #define STACKSIZE 16384
00031 
00032 static char stacks[MAXTHREADS][STACKSIZE];
00033 /* Create a new thread. */
00034 int thread_create(void(*func)(void), l4_threadid_t *id, const char*name){
00035     static int next_thread = 1;
00036     l4_threadid_t thread;
00037 
00038     if(next_thread>MAXTHREADS){
00039         LOG_Error("No more space to create a thread");
00040         return -1;
00041     }
00042 
00043     thread = l4util_create_thread(next_thread, func,
00044                                   (l4_umword_t*)&stacks[next_thread][0]);
00045     names_register_thread_weak(name, thread);
00046     next_thread++;
00047     if(id) *id = thread;
00048 
00049     return 0;
00050 }

Generated on Wed Apr 11 06:40:52 2012 for Logging and output facility for DROPS by  doxygen 1.5.6