# HG changeset patch # User nickg # Date 1055602983 0 # Node ID ee5b3444e088f8ad6734f8d6a89601921c8ff245 # Parent 7d1bfa2391f96bdab306331a14c63c577830470c * 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. diff --git a/packages/net/bsd_tcpip/current/ChangeLog b/packages/net/bsd_tcpip/current/ChangeLog --- a/packages/net/bsd_tcpip/current/ChangeLog +++ b/packages/net/bsd_tcpip/current/ChangeLog @@ -1,3 +1,16 @@ +2003-06-09 Nick Garnett + + * 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 * src/ecos/timeout.c (do_timeout): The head of the linked list of diff --git a/packages/net/bsd_tcpip/current/include/netinet/in.h b/packages/net/bsd_tcpip/current/include/netinet/in.h --- 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 diff --git a/packages/net/bsd_tcpip/current/include/sys/malloc.h b/packages/net/bsd_tcpip/current/include/sys/malloc.h --- 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 */ diff --git a/packages/net/bsd_tcpip/current/src/ecos/synch.c b/packages/net/bsd_tcpip/current/src/ecos/synch.c --- 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" );