aboutsummaryrefslogtreecommitdiff
path: root/nuttx/include
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2012-08-26 16:26:39 -0700
committerpx4dev <px4@purgatory.org>2012-08-26 16:26:39 -0700
commite214981d11eb5766456b1d60330d4b281e585944 (patch)
tree85bc0f7cd41e79dcaca4c0f897fe1dae50d245c6 /nuttx/include
parent234b746a7352675b79ca8a72a7aeab72f68534cc (diff)
parent029bbeb3dbf2c51e86fe5a67424a356fb2d17aa1 (diff)
downloadpx4-firmware-e214981d11eb5766456b1d60330d4b281e585944.tar.gz
px4-firmware-e214981d11eb5766456b1d60330d4b281e585944.tar.bz2
px4-firmware-e214981d11eb5766456b1d60330d4b281e585944.zip
Merge branch 'NuttX/master'
Conflicts: apps/netutils/thttpd/thttpd_cgi.c nuttx/Documentation/NuttX.html nuttx/arch/8051/src/Makefile nuttx/arch/arm/src/lpc17xx/lpc17_usbhost.c nuttx/arch/avr/Kconfig nuttx/arch/avr/src/atmega/atmega_lowinit.c nuttx/arch/mips/Kconfig nuttx/arch/z80/src/Makefile.sdcc nuttx/configs/amber/README.txt nuttx/configs/amber/hello/defconfig nuttx/configs/avr32dev1/README.txt nuttx/configs/avr32dev1/nsh/defconfig nuttx/configs/avr32dev1/ostest/defconfig nuttx/configs/c5471evm/README.txt nuttx/configs/c5471evm/httpd/defconfig nuttx/configs/c5471evm/nettest/defconfig nuttx/configs/c5471evm/nsh/defconfig nuttx/configs/c5471evm/ostest/defconfig nuttx/configs/compal_e88/nsh_highram/defconfig nuttx/configs/compal_e99/nsh_compalram/defconfig nuttx/configs/compal_e99/nsh_highram/defconfig nuttx/configs/demo9s12ne64/README.txt nuttx/configs/demo9s12ne64/ostest/defconfig nuttx/configs/ea3131/nsh/defconfig nuttx/configs/ea3131/ostest/defconfig nuttx/configs/ea3131/pgnsh/defconfig nuttx/configs/ea3131/usbserial/defconfig nuttx/configs/ea3131/usbstorage/defconfig nuttx/configs/ea3152/ostest/defconfig nuttx/configs/eagle100/README.txt nuttx/configs/eagle100/httpd/defconfig nuttx/configs/eagle100/nettest/defconfig nuttx/configs/eagle100/nsh/defconfig nuttx/configs/eagle100/nxflat/defconfig nuttx/configs/eagle100/ostest/defconfig nuttx/configs/eagle100/thttpd/defconfig nuttx/configs/ekk-lm3s9b96/README.txt nuttx/configs/ekk-lm3s9b96/nsh/defconfig nuttx/configs/ekk-lm3s9b96/ostest/defconfig nuttx/configs/ez80f910200kitg/ostest/defconfig nuttx/configs/ez80f910200zco/dhcpd/defconfig nuttx/configs/ez80f910200zco/httpd/defconfig nuttx/configs/ez80f910200zco/nettest/defconfig nuttx/configs/ez80f910200zco/nsh/defconfig nuttx/configs/ez80f910200zco/ostest/defconfig nuttx/configs/ez80f910200zco/poll/defconfig nuttx/configs/hymini-stm32v/README.txt nuttx/configs/hymini-stm32v/buttons/defconfig nuttx/configs/hymini-stm32v/nsh/defconfig nuttx/configs/hymini-stm32v/nsh2/defconfig nuttx/configs/hymini-stm32v/nx/defconfig nuttx/configs/hymini-stm32v/nxlines/defconfig nuttx/configs/hymini-stm32v/usbserial/defconfig nuttx/configs/hymini-stm32v/usbstorage/defconfig nuttx/configs/kwikstik-k40/README.txt nuttx/configs/kwikstik-k40/ostest/defconfig nuttx/configs/lincoln60/README.txt nuttx/configs/lincoln60/nsh/defconfig nuttx/configs/lincoln60/ostest/defconfig nuttx/configs/lm3s6432-s2e/README.txt nuttx/configs/lm3s6432-s2e/nsh/defconfig nuttx/configs/lm3s6432-s2e/ostest/defconfig nuttx/configs/lm3s6965-ek/README.txt nuttx/configs/lm3s6965-ek/nsh/defconfig nuttx/configs/lm3s6965-ek/nx/defconfig nuttx/configs/lm3s6965-ek/ostest/defconfig nuttx/configs/lm3s8962-ek/README.txt nuttx/configs/lm3s8962-ek/nsh/defconfig nuttx/configs/lm3s8962-ek/nx/defconfig nuttx/configs/lm3s8962-ek/ostest/defconfig nuttx/configs/lpc4330-xplorer/README.txt nuttx/configs/lpc4330-xplorer/nsh/defconfig nuttx/configs/lpc4330-xplorer/ostest/defconfig nuttx/configs/lpcxpresso-lpc1768/README.txt nuttx/configs/lpcxpresso-lpc1768/dhcpd/defconfig nuttx/configs/lpcxpresso-lpc1768/nsh/defconfig nuttx/configs/lpcxpresso-lpc1768/nx/defconfig nuttx/configs/lpcxpresso-lpc1768/ostest/defconfig nuttx/configs/lpcxpresso-lpc1768/thttpd/defconfig nuttx/configs/lpcxpresso-lpc1768/usbstorage/defconfig nuttx/configs/m68332evb/defconfig nuttx/configs/mbed/README.txt nuttx/configs/mbed/hidkbd/defconfig nuttx/configs/mbed/nsh/defconfig nuttx/configs/mcu123-lpc214x/README.txt nuttx/configs/mcu123-lpc214x/composite/defconfig nuttx/configs/mcu123-lpc214x/nsh/defconfig nuttx/configs/mcu123-lpc214x/ostest/defconfig nuttx/configs/mcu123-lpc214x/usbserial/defconfig nuttx/configs/mcu123-lpc214x/usbstorage/defconfig nuttx/configs/micropendous3/README.txt nuttx/configs/micropendous3/hello/defconfig nuttx/configs/mirtoo/README.txt nuttx/configs/mirtoo/nsh/defconfig nuttx/configs/mirtoo/nxffs/defconfig nuttx/configs/mirtoo/ostest/defconfig nuttx/configs/mx1ads/ostest/defconfig nuttx/configs/ne64badge/README.txt nuttx/configs/ne64badge/ostest/defconfig nuttx/configs/ntosd-dm320/nettest/defconfig nuttx/configs/ntosd-dm320/nsh/defconfig nuttx/configs/ntosd-dm320/ostest/defconfig nuttx/configs/ntosd-dm320/poll/defconfig nuttx/configs/ntosd-dm320/thttpd/defconfig nuttx/configs/ntosd-dm320/udp/defconfig nuttx/configs/ntosd-dm320/uip/defconfig nuttx/configs/nucleus2g/README.txt nuttx/configs/nucleus2g/nsh/defconfig nuttx/configs/nucleus2g/ostest/defconfig nuttx/configs/nucleus2g/usbserial/defconfig nuttx/configs/nucleus2g/usbstorage/defconfig nuttx/configs/olimex-lpc1766stk/README.txt nuttx/configs/olimex-lpc1766stk/ftpc/defconfig nuttx/configs/olimex-lpc1766stk/hidkbd/defconfig nuttx/configs/olimex-lpc1766stk/nettest/defconfig nuttx/configs/olimex-lpc1766stk/nsh/defconfig nuttx/configs/olimex-lpc1766stk/nx/defconfig nuttx/configs/olimex-lpc1766stk/ostest/defconfig nuttx/configs/olimex-lpc1766stk/slip-httpd/defconfig nuttx/configs/olimex-lpc1766stk/thttpd/defconfig nuttx/configs/olimex-lpc1766stk/usbserial/defconfig nuttx/configs/olimex-lpc1766stk/usbstorage/defconfig nuttx/configs/olimex-lpc1766stk/wlan/defconfig nuttx/configs/olimex-lpc2378/nsh/defconfig nuttx/configs/olimex-lpc2378/ostest/defconfig nuttx/configs/olimex-stm32-p107/nsh/defconfig nuttx/configs/olimex-stm32-p107/ostest/defconfig nuttx/configs/olimex-strp711/nettest/defconfig nuttx/configs/olimex-strp711/nsh/defconfig nuttx/configs/olimex-strp711/ostest/defconfig nuttx/configs/pcblogic-pic32mx/README.txt nuttx/configs/pcblogic-pic32mx/nsh/defconfig nuttx/configs/pcblogic-pic32mx/ostest/defconfig nuttx/configs/pic32-starterkit/README.txt nuttx/configs/pic32-starterkit/nsh/defconfig nuttx/configs/pic32-starterkit/nsh2/defconfig nuttx/configs/pic32-starterkit/ostest/defconfig nuttx/configs/pic32mx7mmb/README.txt nuttx/configs/pic32mx7mmb/nsh/defconfig nuttx/configs/pic32mx7mmb/ostest/defconfig nuttx/configs/pjrc-8051/defconfig nuttx/configs/qemu-i486/nsh/defconfig nuttx/configs/qemu-i486/ostest/defconfig nuttx/configs/rgmp/arm/default/defconfig nuttx/configs/rgmp/arm/nsh/defconfig nuttx/configs/rgmp/x86/default/defconfig nuttx/configs/rgmp/x86/nsh/defconfig nuttx/configs/sam3u-ek/README.txt nuttx/configs/sam3u-ek/knsh/defconfig nuttx/configs/sam3u-ek/nsh/defconfig nuttx/configs/sam3u-ek/nx/defconfig nuttx/configs/sam3u-ek/ostest/defconfig nuttx/configs/sam3u-ek/touchscreen/defconfig nuttx/configs/sim/mount/defconfig nuttx/configs/sim/nettest/defconfig nuttx/configs/sim/nsh/defconfig nuttx/configs/sim/nsh2/defconfig nuttx/configs/sim/nx/defconfig nuttx/configs/sim/nx11/defconfig nuttx/configs/sim/nxffs/defconfig nuttx/configs/sim/nxwm/defconfig nuttx/configs/sim/ostest/defconfig nuttx/configs/sim/pashello/defconfig nuttx/configs/sim/touchscreen/defconfig nuttx/configs/skp16c26/ostest/defconfig nuttx/configs/stm3210e-eval/Kconfig nuttx/configs/stm3210e-eval/README.txt nuttx/configs/stm3210e-eval/RIDE/defconfig nuttx/configs/stm3210e-eval/buttons/defconfig nuttx/configs/stm3210e-eval/composite/defconfig nuttx/configs/stm3210e-eval/nsh/defconfig nuttx/configs/stm3210e-eval/nsh2/defconfig nuttx/configs/stm3210e-eval/nx/defconfig nuttx/configs/stm3210e-eval/nxconsole/defconfig nuttx/configs/stm3210e-eval/nxlines/defconfig nuttx/configs/stm3210e-eval/nxtext/defconfig nuttx/configs/stm3210e-eval/ostest/defconfig nuttx/configs/stm3210e-eval/pm/defconfig nuttx/configs/stm3210e-eval/src/up_idle.c nuttx/configs/stm3210e-eval/usbserial/defconfig nuttx/configs/stm3210e-eval/usbstorage/defconfig nuttx/configs/stm3220g-eval/Kconfig nuttx/configs/stm3220g-eval/README.txt nuttx/configs/stm3220g-eval/dhcpd/defconfig nuttx/configs/stm3220g-eval/include/board.h nuttx/configs/stm3220g-eval/nettest/defconfig nuttx/configs/stm3220g-eval/nsh/defconfig nuttx/configs/stm3220g-eval/nsh2/defconfig nuttx/configs/stm3220g-eval/nxwm/defconfig nuttx/configs/stm3220g-eval/ostest/defconfig nuttx/configs/stm3220g-eval/src/Makefile nuttx/configs/stm3220g-eval/src/stm3220g-internal.h nuttx/configs/stm3220g-eval/src/up_boot.c nuttx/configs/stm3220g-eval/src/up_nsh.c nuttx/configs/stm3220g-eval/telnetd/defconfig nuttx/configs/stm3240g-eval/Kconfig nuttx/configs/stm3240g-eval/README.txt nuttx/configs/stm3240g-eval/dhcpd/defconfig nuttx/configs/stm3240g-eval/include/board.h nuttx/configs/stm3240g-eval/nettest/defconfig nuttx/configs/stm3240g-eval/nsh/defconfig nuttx/configs/stm3240g-eval/nsh2/defconfig nuttx/configs/stm3240g-eval/nxconsole/defconfig nuttx/configs/stm3240g-eval/nxwm/defconfig nuttx/configs/stm3240g-eval/ostest/defconfig nuttx/configs/stm3240g-eval/telnetd/defconfig nuttx/configs/stm32f4discovery/README.txt nuttx/configs/stm32f4discovery/include/board.h nuttx/configs/stm32f4discovery/nsh/defconfig nuttx/configs/stm32f4discovery/nxlines/defconfig nuttx/configs/stm32f4discovery/ostest/defconfig nuttx/configs/stm32f4discovery/pm/defconfig nuttx/configs/sure-pic32mx/README.txt nuttx/configs/sure-pic32mx/nsh/defconfig nuttx/configs/sure-pic32mx/ostest/defconfig nuttx/configs/sure-pic32mx/usbnsh/defconfig nuttx/configs/teensy/README.txt nuttx/configs/teensy/hello/defconfig nuttx/configs/teensy/nsh/defconfig nuttx/configs/teensy/src/up_spi.c nuttx/configs/teensy/usbstorage/defconfig nuttx/configs/twr-k60n512/README.txt nuttx/configs/twr-k60n512/nsh/defconfig nuttx/configs/twr-k60n512/ostest/defconfig nuttx/configs/ubw32/README.txt nuttx/configs/ubw32/nsh/defconfig nuttx/configs/ubw32/ostest/defconfig nuttx/configs/us7032evb1/nsh/defconfig nuttx/configs/us7032evb1/ostest/defconfig nuttx/configs/vsn/README.txt nuttx/configs/vsn/nsh/defconfig nuttx/configs/xtrs/nsh/defconfig nuttx/configs/xtrs/ostest/defconfig nuttx/configs/xtrs/pashello/defconfig nuttx/configs/z16f2800100zcog/ostest/defconfig nuttx/configs/z16f2800100zcog/pashello/defconfig nuttx/configs/z80sim/nsh/defconfig nuttx/configs/z80sim/ostest/defconfig nuttx/configs/z80sim/pashello/defconfig nuttx/configs/z8encore000zco/ostest/defconfig nuttx/configs/z8f64200100kit/ostest/defconfig
Diffstat (limited to 'nuttx/include')
-rw-r--r--nuttx/include/nuttx/usb/usbhost.h28
-rw-r--r--nuttx/include/semaphore.h23
2 files changed, 33 insertions, 18 deletions
diff --git a/nuttx/include/nuttx/usb/usbhost.h b/nuttx/include/nuttx/usb/usbhost.h
index 133fd4387..acfe9a829 100644
--- a/nuttx/include/nuttx/usb/usbhost.h
+++ b/nuttx/include/nuttx/usb/usbhost.h
@@ -1,7 +1,7 @@
/************************************************************************************
* include/nuttx/usb/usbhost.h
*
- * Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2010-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* References:
@@ -284,7 +284,7 @@
* Some hardware supports special memory in which request and descriptor data can
* be accessed more efficiently. This method provides a mechanism to allocate
* the request/descriptor memory. If the underlying hardware does not support
- * such "special" memory, this functions may simply map to malloc.
+ * such "special" memory, this functions may simply map to kmalloc.
*
* This interface was optimized under a particular assumption. It was assumed
* that the driver maintains a pool of small, pre-allocated buffers for descriptor
@@ -317,7 +317,7 @@
* Some hardware supports special memory in which request and descriptor data can
* be accessed more efficiently. This method provides a mechanism to free that
* request/descriptor memory. If the underlying hardware does not support
- * such "special" memory, this functions may simply map to free().
+ * such "special" memory, this functions may simply map to kfree().
*
* Input Parameters:
* drvr - The USB host driver instance obtained as a parameter from the call to
@@ -342,7 +342,7 @@
* Some hardware supports special memory in which larger IO buffers can
* be accessed more efficiently. This method provides a mechanism to allocate
* the request/descriptor memory. If the underlying hardware does not support
- * such "special" memory, this functions may simply map to malloc.
+ * such "special" memory, this functions may simply map to kmalloc.
*
* This interface differs from DRVR_ALLOC in that the buffers are variable-sized.
*
@@ -371,7 +371,7 @@
* Some hardware supports special memory in which IO data can be accessed more
* efficiently. This method provides a mechanism to free that IO buffer
* memory. If the underlying hardware does not support such "special" memory,
- * this functions may simply map to free().
+ * this functions may simply map to kfree().
*
* Input Parameters:
* drvr - The USB host driver instance obtained as a parameter from the call to
@@ -448,7 +448,13 @@
*
* Returned Values:
* On success, zero (OK) is returned. On a failure, a negated errno value is
- * returned indicating the nature of the failure
+ * returned indicating the nature of the failure:
+ *
+ * EAGAIN - If devices NAKs the transfer (or NYET or other error where
+ * it may be appropriate to restart the entire transaction).
+ * EPERM - If the endpoint stalls
+ * EIO - On a TX or data toggle error
+ * EPIPE - Overrun errors
*
* Assumptions:
* This function will *not* be called from an interrupt handler.
@@ -553,7 +559,7 @@ struct usbhost_class_s
};
/* This structure describes one endpoint. It is used as an input to the
- * allocep() method. Most of this information comes from the endpoint
+ * epalloc() method. Most of this information comes from the endpoint
* descriptor.
*/
@@ -562,12 +568,12 @@ struct usbhost_epdesc_s
uint8_t addr; /* Endpoint address */
bool in; /* Direction: true->IN */
uint8_t funcaddr; /* USB address of function containing endpoint */
- uint8_t xfrtype; /* Transfer type. See SB_EP_ATTR_XFER_* in usb.h */
+ uint8_t xfrtype; /* Transfer type. See USB_EP_ATTR_XFER_* in usb.h */
uint8_t interval; /* Polling interval */
uint16_t mxpacketsize; /* Max packetsize */
};
-/* This type represents one endpoint configured by the allocep() method.
+/* This type represents one endpoint configured by the epalloc() method.
* The actual form is know only internally to the USB host controller
* (for example, for an OHCI driver, this would probably be a pointer
* to an endpoint descriptor).
@@ -615,7 +621,7 @@ struct usbhost_driver_s
* be accessed more efficiently. The following methods provide a mechanism
* to allocate and free the transfer descriptor memory. If the underlying
* hardware does not support such "special" memory, these functions may
- * simply map to malloc and free.
+ * simply map to kmalloc and kfree.
*
* This interface was optimized under a particular assumption. It was assumed
* that the driver maintains a pool of small, pre-allocated buffers for descriptor
@@ -630,7 +636,7 @@ struct usbhost_driver_s
/* Some hardware supports special memory in which larger IO buffers can
* be accessed more efficiently. This method provides a mechanism to allocate
* the request/descriptor memory. If the underlying hardware does not support
- * such "special" memory, this functions may simply map to malloc.
+ * such "special" memory, this functions may simply map to kmalloc.
*
* This interface differs from DRVR_ALLOC in that the buffers are variable-sized.
*/
diff --git a/nuttx/include/semaphore.h b/nuttx/include/semaphore.h
index 85214b9c2..257a5826f 100644
--- a/nuttx/include/semaphore.h
+++ b/nuttx/include/semaphore.h
@@ -60,16 +60,16 @@ extern "C" {
* Public Type Declarations
****************************************************************************/
-/* This structure contains the holder of a semaphore */
+/* This structure contains information about the holder of a semaphore */
#ifdef CONFIG_PRIORITY_INHERITANCE
struct semholder_s
{
#if CONFIG_SEM_PREALLOCHOLDERS > 0
- struct semholder_s *flink; /* Implements singly linked list */
+ struct semholder_s *flink; /* Implements singly linked list */
#endif
- void *holder; /* Holder TCB (actual type is _TCB) */
- int16_t counts; /* Number of counts owned by this holder */
+ void *htcb; /* Holder TCB (actual type is _TCB) */
+ int16_t counts; /* Number of counts owned by this holder */
};
#if CONFIG_SEM_PREALLOCHOLDERS > 0
@@ -83,12 +83,21 @@ struct semholder_s
struct sem_s
{
- int16_t semcount; /* >0 -> Num counts available */
- /* <0 -> Num tasks waiting for semaphore */
+ int16_t semcount; /* >0 -> Num counts available */
+ /* <0 -> Num tasks waiting for semaphore */
+ /* If priority inheritance is enabled, then we have to keep track of which
+ * tasks hold references to the semaphore.
+ */
+
#ifdef CONFIG_PRIORITY_INHERITANCE
- struct semholder_s hlist; /* List of holders of semaphore counts */
+# if CONFIG_SEM_PREALLOCHOLDERS > 0
+ FAR struct semholder_s *hhead; /* List of holders of semaphore counts */
+# else
+ struct semholder_s holder; /* Single holder */
+# endif
#endif
};
+
typedef struct sem_s sem_t;
/* Initializers */