diff --git a/src/sys/net/api/err.c b/src/sys/net/api/err.c index f4ce209..25677a8 100644 --- a/src/sys/net/api/err.c +++ b/src/sys/net/api/err.c @@ -42,6 +42,8 @@ #include +int errno; + #if !NO_SYS /** Table to quickly map an lwIP error (err_t) to a socket error * by using -err as an index */ diff --git a/src/sys/net/net/sys_arch.c b/src/sys/net/net/sys_arch.c index e13fd9b..a81a285 100644 --- a/src/sys/net/net/sys_arch.c +++ b/src/sys/net/net/sys_arch.c @@ -98,6 +98,19 @@ static spinLock_t netThreadSpinlock = SPIN_LOCK_INITIALIZER; static struct sys_thread *threads = 0x0; +struct sys_mbox *sys_mbox_new() { + struct sys_mbox *mbox; + + mbox = kmalloc(sizeof(struct sys_mbox)); + memset(mbox, 0x0, sizeof(struct sys_mbox)); + mbox->first = mbox->last = 0; + mbox->mail = sys_sem_new_(0); + mbox->mutex = sys_sem_new_(1); + + return (mbox); +} + + sys_thread_t sys_thread_new(const char *name, void (*thread)(void *arg), void *arg, int stacksize, int prio) { //void sys_thread_new(void (*function)(void), void *arg) { struct sys_thread *new_thread = 0x0; @@ -187,18 +200,6 @@ -struct sys_mbox *sys_mbox_new() { - struct sys_mbox *mbox; - - mbox = kmalloc(sizeof(struct sys_mbox)); - memset(mbox, 0x0, sizeof(struct sys_mbox)); - mbox->first = mbox->last = 0; - mbox->mail = sys_sem_new_(0); - mbox->mutex = sys_sem_new_(1); - - return (mbox); -} - void sys_mbox_free(struct sys_mbox *mbox) { if (mbox != SYS_MBOX_NULL) { sys_sem_wait(mbox->mutex);