This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
NET: Some minor fixes
- From: Nick Garnett <nickg at ecoscentric dot com>
- To: ecos-patches at sources dot redhat dot com
- Date: 14 Jun 2003 18:59:04 +0100
- Subject: NET: Some minor fixes
Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/bsd_tcpip/current/ChangeLog,v
retrieving revision 1.24
diff -u -5 -r1.24 ChangeLog
--- ChangeLog 12 May 2003 11:03:05 -0000 1.24
+++ ChangeLog 14 Jun 2003 15:01:58 -0000
@@ -1,5 +1,18 @@
+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
timers is timeout, not _timeout.
* src/ecos/timeout.c (timeout): Linear search the array for empty
Index: include/netinet/in.h
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/bsd_tcpip/current/include/netinet/in.h,v
retrieving revision 1.2
diff -u -5 -r1.2 in.h
--- include/netinet/in.h 5 Jun 2002 16:37:53 -0000 1.2
+++ include/netinet/in.h 14 Jun 2003 15:01:59 -0000
@@ -304,11 +304,11 @@
struct sockaddr_in {
u_char sin_len;
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
/*
Index: include/sys/malloc.h
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/bsd_tcpip/current/include/sys/malloc.h,v
retrieving revision 1.1
diff -u -5 -r1.1 malloc.h
--- include/sys/malloc.h 20 May 2002 22:25:01 -0000 1.1
+++ include/sys/malloc.h 14 Jun 2003 15:02:00 -0000
@@ -40,10 +40,11 @@
#define malloc(size, type, flags) cyg_net_malloc((u_long)size, (int)type, flags)
#define FREE(addr, type) cyg_net_free((caddr_t)(addr), (int)type)
#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 */
#define M_IFMADDR 55 /* link-level multicast address */
#define M_IPMADDR 66 /* link-level multicast address */
Index: src/ecos/synch.c
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/bsd_tcpip/current/src/ecos/synch.c,v
retrieving revision 1.1
diff -u -5 -r1.1 synch.c
--- src/ecos/synch.c 20 May 2002 22:25:01 -0000 1.1
+++ src/ecos/synch.c 14 Jun 2003 15:02:01 -0000
@@ -128,11 +128,12 @@
static inline cyg_uint32
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" );
splx_thread = cyg_thread_self();
}
--
Nick Garnett eCos Kernel Architect
http://www.ecoscentric.com/ The eCos and RedBoot experts