Allow minimal unix target to build in cygwin (but not necessarily run).

Applied a patch from Marc Boucher which has the following changes:

1) Fixed sys_arch.txt documentation to have new return type from
   sys_thread_new.

2) Removed unnecessary casts on calling sys_timeout() in certain files.

3) Removed some unnecessary break statements after return statements.

4) Changed sys_timeout_remove() to sys_untimeout().

5) Added some forgotten #ifndef SYS_LIGHTWEIGHT_PROT to memp.c

6) Changed LWIP_DIAG and LWIP_PLATFORM_ASSERT to have do while().
This commit is contained in:
davidhaas
2003-02-18 19:27:48 +00:00
parent 1660e800e0
commit 7f1becc682
11 changed files with 37 additions and 50 deletions

View File

@@ -108,7 +108,6 @@ ip_lookup(void *header, struct netif *inp)
#if LWIP_UDP > 0
case IP_PROTO_UDP:
return udp_lookup(iphdr, inp);
break;
#endif /* LWIP_UDP */
#if LWIP_TCP > 0
case IP_PROTO_TCP:
@@ -116,7 +115,6 @@ ip_lookup(void *header, struct netif *inp)
#endif /* LWIP_TCP */
case IP_PROTO_ICMP:
return 1;
break;
default:
return 0;
}

View File

@@ -95,7 +95,7 @@ ip_reass_timer(void *arg)
{
if(ip_reasstmr > 1) {
ip_reasstmr--;
sys_timeout(IP_REASS_TMO, (sys_timeout_handler) ip_reass_timer, NULL);
sys_timeout(IP_REASS_TMO, ip_reass_timer, NULL);
} else if(ip_reasstmr == 1)
ip_reasstmr = 0;
}
@@ -121,7 +121,7 @@ ip_reass(struct pbuf *p)
DEBUGF(IP_REASS_DEBUG, ("ip_reass: new packet\n"));
memcpy(iphdr, fraghdr, IP_HLEN);
ip_reasstmr = IP_REASS_MAXAGE;
sys_timeout(IP_REASS_TMO, (sys_timeout_handler) ip_reass_timer, NULL);
sys_timeout(IP_REASS_TMO, ip_reass_timer, NULL);
ip_reassflags = 0;
/* Clear the bitmap. */
memset(ip_reassbitmap, 0, sizeof(ip_reassbitmap));
@@ -148,7 +148,7 @@ ip_reass(struct pbuf *p)
DEBUGF(IP_REASS_DEBUG,
("ip_reass: fragment outside of buffer (%d:%d/%d).\n", offset,
offset + len, IP_REASS_BUFSIZE));
sys_timeout_remove((sys_timeout_handler) ip_reass_timer, NULL);
sys_untimeout(ip_reass_timer, NULL);
ip_reasstmr = 0;
goto nullreturn;
}
@@ -236,7 +236,7 @@ ip_reass(struct pbuf *p)
/* If we have come this far, we have a full packet in the
buffer, so we allocate a pbuf and copy the packet into it. We
also reset the timer. */
sys_timeout_remove((sys_timeout_handler) ip_reass_timer, NULL);
sys_untimeout(ip_reass_timer, NULL);
ip_reasstmr = 0;
pbuf_free(p);
p = pbuf_alloc(PBUF_LINK, ip_reasslen, PBUF_POOL);

View File

@@ -110,7 +110,9 @@ static u8_t memp_memory[(MEMP_NUM_PBUF *
sizeof(struct memp)))];
/*-----------------------------------------------------------------------------------*/
#ifndef SYS_LIGHTWEIGHT_PROT
static sys_sem_t mutex;
#endif
/*-----------------------------------------------------------------------------------*/
#ifdef LWIP_DEBUG
static int
@@ -168,7 +170,9 @@ memp_init(void)
}
}
#ifndef SYS_LIGHTWEIGHT_PROT
mutex = sys_sem_new(1);
#endif
}

View File

@@ -206,7 +206,7 @@ sys_timeout(u32_t msecs, sys_timeout_handler h, void *arg)
*/
/*-----------------------------------------------------------------------------------*/
void
sys_timeout_remove(sys_timeout_handler h, void *arg)
sys_untimeout(sys_timeout_handler h, void *arg)
{
struct sys_timeouts *timeouts;
struct sys_timeout *prev_t, *t;
@@ -245,7 +245,7 @@ sswt_handler(void *arg)
{
struct sswt_cb *sswt_cb = (struct sswt_cb *) arg;
/* Timeout. Set flag to TRUE and signal semephore */
/* Timeout. Set flag to TRUE and signal semaphore */
sswt_cb->timeflag = 1;
sys_sem_signal(*(sswt_cb->psem));
}
@@ -274,7 +274,7 @@ sys_sem_wait_timeout(sys_sem_t sem, u32_t timeout)
return 0;
} else {
/* Not a timeout. Remove timeout entry */
sys_timeout_remove(sswt_handler, &sswt_cb);
sys_untimeout(sswt_handler, &sswt_cb);
return 1;
}