aboutsummaryrefslogtreecommitdiff
path: root/nuttx/include
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-26 23:49:02 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-26 23:49:02 +0000
commit47b94bafa5045532f239ea57a3610873b1a71368 (patch)
tree59eb55cb25bbd20b052a87de5838d80a410a1439 /nuttx/include
parentb82c36961aa730fc39a9fc8eac17e2518128cb67 (diff)
downloadpx4-firmware-47b94bafa5045532f239ea57a3610873b1a71368.tar.gz
px4-firmware-47b94bafa5045532f239ea57a3610873b1a71368.tar.bz2
px4-firmware-47b94bafa5045532f239ea57a3610873b1a71368.zip
Move socket data from TCB to task group structure.
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5570 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include')
-rw-r--r--nuttx/include/nuttx/net/net.h8
-rw-r--r--nuttx/include/nuttx/sched.h13
2 files changed, 9 insertions, 12 deletions
diff --git a/nuttx/include/nuttx/net/net.h b/nuttx/include/nuttx/net/net.h
index b625b2fbe..d23fb8796 100644
--- a/nuttx/include/nuttx/net/net.h
+++ b/nuttx/include/nuttx/net/net.h
@@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/net/net.h
*
- * Copyright (C) 2007, 2009-2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007, 2009-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -106,7 +106,6 @@ struct socket
struct socketlist
{
sem_t sl_sem; /* Manage access to the socket list */
- int16_t sl_crefs; /* Reference count */
struct socket sl_sockets[CONFIG_NSOCKET_DESCRIPTORS];
};
#endif
@@ -145,9 +144,8 @@ int net_checksd(int fd, int oflags);
*/
void weak_function net_initialize(void);
-FAR struct socketlist *net_alloclist(void);
-int net_addreflist(FAR struct socketlist *list);
-int net_releaselist(FAR struct socketlist *list);
+void net_initlist(FAR struct socketlist *list);
+void net_releaselist(FAR struct socketlist *list);
/* Given a socket descriptor, return the underly NuttX-specific socket
* structure.
diff --git a/nuttx/include/nuttx/sched.h b/nuttx/include/nuttx/sched.h
index a084d50ba..244455cd4 100644
--- a/nuttx/include/nuttx/sched.h
+++ b/nuttx/include/nuttx/sched.h
@@ -83,6 +83,8 @@
# define HAVE_TASK_GROUP 1
# elif CONFIG_NFILE_STREAMS > 0
# define HAVE_TASK_GROUP 1
+# elif CONFIG_NSOCKET_DESCRIPTORS > 0
+# define HAVE_TASK_GROUP 1
# endif
#endif
@@ -311,7 +313,10 @@ struct task_group_s
#endif /* CONFIG_NFILE_STREAMS */
/* Sockets ********************************************************************/
- /* Not yet (see struct socketlist) */
+
+#if CONFIG_NSOCKET_DESCRIPTORS > 0
+ struct socketlist tg_socketlist; /* Maps socket descriptor to socket */
+#endif
};
#endif
@@ -450,12 +455,6 @@ struct _TCB
int pterrno; /* Current per-thread errno */
- /* Network socket *************************************************************/
-
-#if CONFIG_NSOCKET_DESCRIPTORS > 0
- FAR struct socketlist *sockets; /* Maps file descriptor to file */
-#endif
-
/* State save areas ***********************************************************/
/* The form and content of these fields are processor-specific. */