changeset 1052:ee5b3444e088

* src/ecos/synch.c (spl_any): Put call to cyg_mutex_lock() into a loop so that releases of the current thread do not get mistaken for locks and trigger the asserts. * include/sys/malloc.h (M_DEVBUF): Added this definition. * include/netinet/in.h: Changed size of sockaddr_in.sin_zero[] to 24 bytes. This makes a sockaddr_in the same size as a sockaddr. Otherwise the definitions of things like ifaliasreq and in_aliasreq do not match when they should.
author nickg
date Sat, 14 Jun 2003 15:03:03 +0000
parents 7d1bfa2391f9
children 657f409c5dfe
files packages/net/bsd_tcpip/current/ChangeLog packages/net/bsd_tcpip/current/include/netinet/in.h packages/net/bsd_tcpip/current/include/sys/malloc.h packages/net/bsd_tcpip/current/src/ecos/synch.c
diffstat 4 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/packages/net/bsd_tcpip/current/ChangeLog
+++ b/packages/net/bsd_tcpip/current/ChangeLog
@@ -1,3 +1,16 @@
+2003-06-09  Nick Garnett  <nickg@balti.calivar.com>
+
+	* src/ecos/synch.c (spl_any): Put call to cyg_mutex_lock() into a
+	loop so that releases of the current thread do not get mistaken
+	for locks and trigger the asserts.
+
+	* include/sys/malloc.h (M_DEVBUF): Added this definition.
+
+	* include/netinet/in.h: Changed size of sockaddr_in.sin_zero[] to
+	24 bytes. This makes a sockaddr_in the same size as a sockaddr.
+	Otherwise the definitions of things like ifaliasreq and
+	in_aliasreq do not match when they should.
+
 2003-05-12  Motoya Kurotsu  <kurotsu@allied-telesis.co.jp>
 
 	* src/ecos/timeout.c (do_timeout): The head of the linked list of
--- a/packages/net/bsd_tcpip/current/include/netinet/in.h
+++ b/packages/net/bsd_tcpip/current/include/netinet/in.h
@@ -306,7 +306,7 @@ struct sockaddr_in {
 	u_char	sin_family;
 	u_short	sin_port;
 	struct	in_addr sin_addr;
-	char	sin_zero[8];
+	char	sin_zero[24];
 };
 
 #define	INET_ADDRSTRLEN                 16
--- a/packages/net/bsd_tcpip/current/include/sys/malloc.h
+++ b/packages/net/bsd_tcpip/current/include/sys/malloc.h
@@ -42,6 +42,7 @@ externC void cyg_net_free(caddr_t addr, 
 #define free(addr, type) FREE(addr, (int)type)
 
 // Memory types
+#define M_DEVBUF        3
 #define M_PCB           (void *)4       /* protocol control block */
 #define M_RTABLE        5       /* routing tables */
 #define M_IFADDR        9       /* interface address */
--- a/packages/net/bsd_tcpip/current/src/ecos/synch.c
+++ b/packages/net/bsd_tcpip/current/src/ecos/synch.c
@@ -130,7 +130,8 @@ spl_any( cyg_uint32 which )
 {
     cyg_uint32 old_spl = spl_state;
     if ( cyg_thread_self() != splx_thread ) {
-        cyg_mutex_lock( &splx_mutex );
+        while ( !cyg_mutex_lock( &splx_mutex ) )
+            continue;
         old_spl = 0; // Free when we unlock this context
         CYG_ASSERT( 0 == splx_thread, "Thread still owned" );
         CYG_ASSERT( 0 == spl_state, "spl still set" );