sys_thread_new() now returns the thread (request from Marc Boucher).

Removed some unused .h files in coldfire port.

Support LWIP_DIAG and LWIP_ASSERT in coldfire (sort of).

Fix to last api fix to make sure select() is triggered, even when there has
been a FIN.

Allow build of unixsim from cygwin by specifying "make ARCH=cygwin" or from
linux by specifying "make ARCH=linux".
This commit is contained in:
davidhaas 2003-02-11 20:59:49 +00:00
parent d33bf3a9e2
commit ae49c020d7
8 changed files with 34 additions and 90 deletions

View File

@ -113,8 +113,9 @@ sys_arch_timeouts(void)
return &timeouts;
}
/*-----------------------------------------------------------------------------------*/
void
sys_thread_t
sys_thread_new(void (* function)(void *arg), void *arg)
{
return 0;
}
/*-----------------------------------------------------------------------------------*/

View File

@ -30,13 +30,17 @@
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: cc.h,v 1.1 2003/01/18 18:47:22 jani Exp $
* $Id: cc.h,v 1.2 2003/02/11 20:59:49 davidhaas Exp $
*/
#ifndef __CC_H__
#define __CC_H__
#include <types.h>
#define BYTE_ORDER BIG_ENDIAN
#define IMM_ADDRESS (0x10000000)
#define FEC_LEVEL 4
// typedef unsigned char u8_t;
// typedef signed char s8_t;
// typedef unsigned short u16_t;
@ -46,6 +50,7 @@
typedef u32_t mem_ptr_t;
/* Compiler hints for packing structures */
#define PACK_STRUCT_BEGIN #pragma pack(1,1,0)
#define PACK_STRUCT_STRUCT
#define ALIGN_STRUCT_8_BEGIN #pragma pack(1,8,0)
@ -83,4 +88,19 @@ typedef struct _types_fd_set {
*__tmp++ = 0; \
} while (0)
/* prototypes for printf() and abort() */
#include <stdio.h>
#include <stdlib.h>
/* Plaform specific diagnostic output */
#if 0
#define LWIP_PLATFORM_DIAG(x) {printf x;}
#define LWIP_PLATFORM_ASSERT(x) {printf("Assertion \"%s\" failed at line %d in %s\n", \
x, __LINE__, __FILE__); fflush(NULL); abort();}
#endif
#define LWIP_PLATFORM_DIAG(x) ;
#define LWIP_PLATFORM_ASSERT(x) ;
#endif /* __CC_H__ */

View File

@ -1,43 +0,0 @@
/* @(#)cpu.h
* Copyright (c) 2001-2003, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the lwIP TCP/IP stack.
*
* Author: David Haas <dhaas@alum.rpi.edu>
*
*/
#ifndef _CPU_H
#define _CPU_H 1
#define BYTE_ORDER BIG_ENDIAN
#define IMM_ADDRESS (0x10000000)
#define FEC_LEVEL 4
#endif /* _CPU_H */

View File

@ -1,40 +0,0 @@
/*
* Copyright (c) 2001-2003, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the lwIP TCP/IP stack.
*
* Author: Adam Dunkels <adam@sics.se>
*
* $Id: lib.h,v 1.1 2003/01/18 18:47:22 jani Exp $
*/
#ifndef __LIB_H__
#define __LIB_H__
#include <string.h>
#endif /* __LIB_H__ */

View File

@ -126,7 +126,7 @@ introduce_thread(NU_TASK *id, void (*function)(void *arg), void *arg)
/*---------------------------------------------------------------------------------*/
/* We use Nucleus task as thread. Create one with a standard size stack at a standard
* priority. */
void
sys_thread_t
sys_thread_new(void (*function)(void *arg), void *arg)
{
NU_TASK *p_thread;
@ -161,7 +161,7 @@ sys_thread_new(void (*function)(void *arg), void *arg)
NU_PREEMPT,
NU_START);
if (status == NU_SUCCESS)
return;
return p_thread;
}
}

View File

@ -241,7 +241,7 @@ sys_thread(void)
KS_terminate(0);
}
/*-----------------------------------------------------------------------------------*/
void
sys_thread_t
sys_thread_new(void (* function)(void *arg), void *arg)
{
TASK newtask;
@ -262,6 +262,7 @@ sys_thread_new(void (* function)(void *arg), void *arg)
KS_deftask_arg(newtask, &threadarg);
KS_execute(newtask);
KS_wait(THRDSYNC);
return newtask;
}

View File

@ -31,7 +31,11 @@
CCDEP=gcc
CC=gcc
CFLAGS=-g -Wall -DIPv4 -DLWIP_DEBUG -pedantic
#To Compile for linux: make ARCH=linux
#To Compile for cygwin: make ARCH=cygwin
ARCH=unix
CFLAGS=-g -Wall -D$(ARCH) -DIPv4 -DLWIP_DEBUG -pedantic
LDFLAGS=-lpcap
CONTRIBDIR=../../../..
LWIPARCH=$(CONTRIBDIR)/ports/unix

View File

@ -150,7 +150,7 @@ current_thread(void)
return st;
}
/*-----------------------------------------------------------------------------------*/
void
sys_thread_t
sys_thread_new(void (*function)(void *arg), void *arg)
{
int code;
@ -172,6 +172,7 @@ sys_thread_new(void (*function)(void *arg), void *arg)
code, (int)st));
abort();
}
return st;
}
/*-----------------------------------------------------------------------------------*/
struct sys_mbox *