Merge remote-tracking branch 'origin/master' into ieee802154
This commit is contained in:
commit
aa823e8d6e
9
TODO
9
TODO
@ -1,4 +1,4 @@
|
||||
NuttX TODO List (Last updated March 26, 2017)
|
||||
NuttX TODO List (Last updated April 10, 2017)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
This file summarizes known NuttX bugs, limitations, inconsistencies with
|
||||
@ -108,9 +108,10 @@ o Task/Scheduler (sched/)
|
||||
2. They run in supervisor mode (if applicable), and
|
||||
3. They do not obey any setup of PIC or address
|
||||
environments. Do they need to?
|
||||
4. In the case of task_delete() and pthread_cancel(), these
|
||||
callbacks will run on the thread of execution and address
|
||||
context of the caller of task. That is very bad!
|
||||
4. In the case of task_delete() and pthread_cancel() without
|
||||
defferred cancellation, these callbacks will run on the
|
||||
thread of execution and address context of the caller of
|
||||
task_delete() or pthread_cancel(). That is very bad!
|
||||
|
||||
The fix for all of these issues it to have the callbacks
|
||||
run on the caller's thread as is currently done with
|
||||
|
@ -44,6 +44,8 @@
|
||||
|
||||
#include "chip.h"
|
||||
|
||||
#ifdef CONFIG_STM32_COMP
|
||||
|
||||
#if defined(CONFIG_STM32_STM32F30XX)
|
||||
# error "COMP support for STM32F30XX not implemented yet"
|
||||
#elif defined(CONFIG_STM32_STM32F33XX)
|
||||
@ -211,4 +213,5 @@ FAR struct comp_dev_s* stm32_compinitialize(int intf);
|
||||
#endif
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
#endif /* CONFIG_STM23_COMP */
|
||||
#endif /* __ARCH_ARM_SRC_STM32_STM32_COMP_H */
|
||||
|
@ -120,7 +120,7 @@ void board_button_initialize(void)
|
||||
* Description:
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* 32-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* definitions in the board.h header file for the meaning of each bit in
|
||||
* the returned value.
|
||||
*
|
||||
|
@ -111,7 +111,7 @@ uint32_t board_buttons(void)
|
||||
* handlers.
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
|
@ -145,7 +145,7 @@ uint32_t board_buttons(void)
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button. See the
|
||||
* 32-bit bit set with each bit associated with a button. See the
|
||||
* BUTTON_*_BIT and JOYSTICK_*_BIT definitions in board.h for the meaning
|
||||
* of each bit.
|
||||
*
|
||||
|
@ -137,7 +137,7 @@ uint32_t board_buttons(void)
|
||||
* handlers.
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
|
@ -121,7 +121,7 @@ uint32_t board_buttons(void)
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button. See the
|
||||
* 32-bit bit set with each bit associated with a button. See the
|
||||
* BUTTON_*_BIT and JOYSTICK_*_BIT definitions in board.h for the meaning
|
||||
* of each bit.
|
||||
*
|
||||
|
@ -120,7 +120,7 @@ uint32_t board_buttons(void)
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may
|
||||
* be called to collect the state of all buttons. board_buttons() returns
|
||||
* an 8-bit bit set with each bit associated with a button. See the
|
||||
* an 32-bit bit set with each bit associated with a button. See the
|
||||
* BUTTON_*_BIT and JOYSTICK_*_BIT definitions in board.h for the meaning
|
||||
* of each bit.
|
||||
*
|
||||
|
@ -124,7 +124,7 @@ uint32_t board_buttons(void)
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may
|
||||
* be called to collect the state of all buttons. board_buttons() returns
|
||||
* an 8-bit bit set with each bit associated with a button. See the
|
||||
* an 32-bit bit set with each bit associated with a button. See the
|
||||
* BUTTON_*_BIT and JOYSTICK_*_BIT definitions in board.h for the meaning
|
||||
* of each bit.
|
||||
*
|
||||
|
@ -120,7 +120,7 @@ uint32_t board_buttons(void)
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button. See the
|
||||
* 32-bit bit set with each bit associated with a button. See the
|
||||
* BUTTON_*_BIT and JOYSTICK_*_BIT definitions in board.h for the meaning
|
||||
* of each bit.
|
||||
*
|
||||
|
@ -92,7 +92,7 @@ uint32_t board_buttons(void)
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button. See the
|
||||
* 32-bit bit set with each bit associated with a button. See the
|
||||
* BUTTON_*_BIT and JOYSTICK_*_BIT definitions in board.h for the meaning
|
||||
* of each bit.
|
||||
*
|
||||
|
@ -154,7 +154,7 @@ void board_button_initialize(void)
|
||||
* Description:
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* 32-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* definitions above for the meaning of each bit in the returned value.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
@ -92,7 +92,7 @@ uint32_t board_buttons(void)
|
||||
* handlers.
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
|
@ -83,7 +83,7 @@ void board_button_initialize(void)
|
||||
* Description:
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit unsigned integer with each bit associated with a button. See the
|
||||
* 32-bit unsigned integer with each bit associated with a button. See the
|
||||
* BUTTON_*_BIT definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
@ -98,7 +98,7 @@ uint32_t board_buttons(void)
|
||||
* handlers.
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
|
@ -98,7 +98,7 @@ uint32_t board_buttons(void)
|
||||
* handlers.
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
|
@ -120,7 +120,7 @@ void board_button_initialize(void)
|
||||
* Description:
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* 32-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* definitions above for the meaning of each bit in the returned value.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
@ -121,7 +121,7 @@ uint32_t board_buttons(void)
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button. See the BUTTON_*_BIT
|
||||
* 32-bit bit set with each bit associated with a button. See the BUTTON_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
* board_button_irq() may be called to register an interrupt handler that
|
||||
|
@ -120,7 +120,7 @@ uint32_t board_buttons(void)
|
||||
* handlers.
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
|
@ -121,7 +121,7 @@ uint32_t board_buttons(void)
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button. See the BUTTON_*_BIT
|
||||
* 32-bit bit set with each bit associated with a button. See the BUTTON_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
* board_button_irq() may be called to register an interrupt handler that
|
||||
|
@ -156,7 +156,7 @@ uint32_t board_buttons(void)
|
||||
* handlers.
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
|
@ -158,7 +158,7 @@ uint32_t board_buttons(void)
|
||||
* handlers.
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
|
@ -63,7 +63,7 @@
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button.
|
||||
* 32-bit bit set with each bit associated with a button.
|
||||
* See the BUTTON_*_BIT definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
* board_button_irq() may be called to register an interrupt handler that
|
||||
@ -97,7 +97,7 @@ void board_button_initialize(void)
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button.
|
||||
* 32-bit bit set with each bit associated with a button.
|
||||
* See the BUTTON_*_BIT definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
@ -78,7 +78,7 @@ void board_button_initialize(void)
|
||||
*
|
||||
* Description:
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON* definitions
|
||||
* above for the meaning of each bit in the returned value.
|
||||
*
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/mount.h>
|
||||
#include <syslog.h>
|
||||
|
||||
#include <nuttx/input/buttons.h>
|
||||
@ -70,7 +71,17 @@ int stm32_bringup(void)
|
||||
{
|
||||
int ret = OK;
|
||||
|
||||
#ifdef CONFIG_USERLED
|
||||
#ifdef CONFIG_FS_PROCFS
|
||||
/* Mount the procfs file system */
|
||||
|
||||
ret = mount(NULL, "/proc", "procfs", 0, NULL);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to mount procfs at /proc: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_USERLED) && !defined(CONFIG_ARCH_LEDS)
|
||||
#ifdef CONFIG_USERLED_LOWER
|
||||
/* Register the LED driver */
|
||||
|
||||
@ -81,9 +92,11 @@ int stm32_bringup(void)
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
/* Enable USER LED support for some other purpose */
|
||||
|
||||
board_userled_initialize();
|
||||
#endif /* CONFIG_USERLED_LOWER */
|
||||
#endif /* CONFIG_USERLED */
|
||||
#endif /* CONFIG_USERLED && !CONFIG_ARCH_LEDS */
|
||||
|
||||
#ifdef CONFIG_BUTTONS
|
||||
#ifdef CONFIG_BUTTONS_LOWER
|
||||
@ -96,16 +109,19 @@ int stm32_bringup(void)
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
/* Enable BUTTON support for some other purpose */
|
||||
|
||||
board_button_initialize();
|
||||
#endif /* CONFIG_BUTTONS_LOWER */
|
||||
#endif /* CONFIG_BUTTONS */
|
||||
|
||||
#ifdef CONFIG_STM32_IWDG
|
||||
/* Initialize the watchdog timer */
|
||||
|
||||
stm32_iwdginitialize("/dev/watchdog0", STM32_LSI_FREQUENCY);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PHOTON_WDG
|
||||
|
||||
/* Start WDG kicker thread */
|
||||
|
||||
ret = photon_watchdog_initialize();
|
||||
@ -117,7 +133,6 @@ int stm32_bringup(void)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PHOTON_WLAN
|
||||
|
||||
/* Initialize wlan driver and hardware */
|
||||
|
||||
ret = photon_wlan_initialize();
|
||||
|
@ -140,7 +140,7 @@ uint32_t board_buttons(void)
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button. See the
|
||||
* 32-bit bit set with each bit associated with a button. See the
|
||||
* BUTTON_*_BIT definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
* board_button_irq() may be called to register an interrupt handler that
|
||||
|
@ -127,7 +127,7 @@ void board_button_initialize(void)
|
||||
*
|
||||
* Description:
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to collect
|
||||
* the state of all buttons. board_buttons() returns an 8-bit bit set with each bit
|
||||
* the state of all buttons. board_buttons() returns an 32-bit bit set with each bit
|
||||
* associated with a button. See the BUTTON* definitions above for the meaning of
|
||||
* each bit in the returned value.
|
||||
*
|
||||
|
@ -130,7 +130,7 @@ void board_button_initialize(void)
|
||||
* Description:
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* 32-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* definitions above for the meaning of each bit in the returned value.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
@ -79,7 +79,7 @@ void board_button_initialize(void)
|
||||
* Description:
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* 32-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* definitions above for the meaning of each bit in the returned value.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
@ -81,7 +81,7 @@ void board_button_initialize(void)
|
||||
* Description:
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* 32-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* definitions above for the meaning of each bit in the returned value.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
@ -80,7 +80,7 @@ void board_button_initialize(void)
|
||||
* Description:
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* 32-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* definitions above for the meaning of each bit in the returned value.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
@ -91,7 +91,7 @@ void board_button_initialize(void)
|
||||
* Description:
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* 32-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* definitions above for the meaning of each bit in the returned value.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
@ -95,7 +95,7 @@ void board_button_initialize(void)
|
||||
* Description:
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* 32-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* definitions above for the meaning of each bit in the returned value.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
@ -95,7 +95,7 @@ void board_button_initialize(void)
|
||||
* Description:
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* 32-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* definitions above for the meaning of each bit in the returned value.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
@ -91,7 +91,7 @@ void board_button_initialize(void)
|
||||
* Description:
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* 32-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* definitions above for the meaning of each bit in the returned value.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
@ -79,7 +79,7 @@ void board_button_initialize(void)
|
||||
*
|
||||
* Description:
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to collect
|
||||
* the state of all buttons. board_buttons() returns an 8-bit bit set with each bit
|
||||
* the state of all buttons. board_buttons() returns an 32-bit bit set with each bit
|
||||
* associated with a button. See the BUTTON* definitions above for the meaning of
|
||||
* each bit in the returned value.
|
||||
*
|
||||
|
@ -79,7 +79,7 @@ void board_button_initialize(void)
|
||||
*
|
||||
* Description:
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to collect
|
||||
* the state of all buttons. board_buttons() returns an 8-bit bit set with each bit
|
||||
* the state of all buttons. board_buttons() returns an 32-bit bit set with each bit
|
||||
* associated with a button. See the BUTTON* definitions above for the meaning of
|
||||
* each bit in the returned value.
|
||||
*
|
||||
|
@ -142,7 +142,7 @@ void board_button_initialize(void)
|
||||
* Description:
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* 32-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* definitions above for the meaning of each bit in the returned value.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
@ -79,7 +79,7 @@ void board_button_initialize(void)
|
||||
*
|
||||
* Description:
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to collect
|
||||
* the state of all buttons. board_buttons() returns an 8-bit bit set with each bit
|
||||
* the state of all buttons. board_buttons() returns an 32-bit bit set with each bit
|
||||
* associated with a button. See the BUTTON* definitions above for the meaning of
|
||||
* each bit in the returned value.
|
||||
*
|
||||
|
@ -158,7 +158,7 @@ void board_button_initialize(void)
|
||||
* Description:
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* 32-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* definitions above for the meaning of each bit in the returned value.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
@ -136,7 +136,7 @@ uint32_t board_buttons(void)
|
||||
* handlers.
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
|
@ -95,7 +95,7 @@ uint32_t board_buttons(void)
|
||||
* handlers.
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
|
@ -148,7 +148,7 @@ uint32_t board_buttons(void)
|
||||
* handlers.
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
|
@ -136,7 +136,7 @@ uint32_t board_buttons(void)
|
||||
* handlers.
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
|
@ -144,7 +144,7 @@ uint32_t board_buttons(void)
|
||||
* handlers.
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
|
@ -140,7 +140,7 @@ uint32_t board_buttons(void)
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns
|
||||
* an 8-bit bit set with each bit associated with a button. See the
|
||||
* an 32-bit bit set with each bit associated with a button. See the
|
||||
* BUTTON_*_BIT definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
* board_button_irq() may be called to register an interrupt handler that
|
||||
|
@ -131,7 +131,7 @@ uint32_t board_buttons(void)
|
||||
* handlers.
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
|
@ -131,7 +131,7 @@ uint32_t board_buttons(void)
|
||||
* handlers.
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
|
@ -131,7 +131,7 @@ uint32_t board_buttons(void)
|
||||
* handlers.
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
|
@ -92,7 +92,7 @@ uint32_t board_buttons(void)
|
||||
* handlers.
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
|
@ -138,7 +138,7 @@ uint32_t board_buttons(void)
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button. See the
|
||||
* 32-bit bit set with each bit associated with a button. See the
|
||||
* BUTTON_*_BIT definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
* board_button_irq() may be called to register an interrupt handler that
|
||||
|
@ -306,7 +306,7 @@ uint32_t board_buttons(void)
|
||||
* handlers.
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
|
@ -131,7 +131,7 @@ uint32_t board_buttons(void)
|
||||
* handlers.
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
|
@ -94,7 +94,7 @@ uint32_t board_buttons(void)
|
||||
* handlers.
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
|
@ -185,7 +185,7 @@ uint32_t board_buttons(void)
|
||||
* handlers.
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
|
@ -113,7 +113,7 @@ void board_button_initialize(void)
|
||||
* Description:
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* 32-bit bit set with each bit associated with a button. See the BUTTON*
|
||||
* definitions above for the meaning of each bit in the returned value.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
@ -59,7 +59,7 @@
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DEBUG_SPI_INFO)
|
||||
#ifdef CONFIG_DEBUG_SPI_INFO
|
||||
# define ssi_dumpgpio(m) tiva_dumpgpio(SDCCS_GPIO, m)
|
||||
#else
|
||||
# define ssi_dumpgpio(m)
|
||||
|
@ -121,7 +121,7 @@ uint32_t board_buttons(void)
|
||||
* handlers.
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
|
@ -160,7 +160,7 @@ uint32_t board_buttons(void)
|
||||
* handlers.
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON_*_BIT definitions in
|
||||
* board.h for the meaning of each bit.
|
||||
*
|
||||
|
@ -132,7 +132,7 @@ uint32_t board_buttons(void)
|
||||
* handlers.
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
|
@ -142,7 +142,7 @@ uint32_t board_buttons(void)
|
||||
* handlers.
|
||||
*
|
||||
* After board_button_initialize() has been called, board_buttons() may be called to
|
||||
* collect the state of all buttons. board_buttons() returns an 8-bit bit set
|
||||
* collect the state of all buttons. board_buttons() returns an 32-bit bit set
|
||||
* with each bit associated with a button. See the BUTTON_*_BIT and JOYSTICK_*_BIT
|
||||
* definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
|
@ -581,7 +581,7 @@ void board_button_initialize(void);
|
||||
* Description:
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button. A bit set to
|
||||
* 32-bit bit set with each bit associated with a button. A bit set to
|
||||
* "1" means that the button is depressed; a bit set to "0" means that
|
||||
* the button is released. The correspondence of the each button bit
|
||||
* and physical buttons is board-specific.
|
||||
|
@ -203,6 +203,22 @@
|
||||
|
||||
#define IW_ESSID_MAX_SIZE 32
|
||||
|
||||
/* Modes of operation */
|
||||
|
||||
#define IW_MODE_AUTO 0 /* Let the driver decides */
|
||||
#define IW_MODE_ADHOC 1 /* Single cell network */
|
||||
#define IW_MODE_INFRA 2 /* Multi cell network, roaming, ... */
|
||||
#define IW_MODE_MASTER 3 /* Synchronisation master or Access Point */
|
||||
#define IW_MODE_REPEAT 4 /* Wireless Repeater (forwarder) */
|
||||
#define IW_MODE_SECOND 5 /* Secondary master/repeater (backup) */
|
||||
#define IW_MODE_MONITOR 6 /* Passive monitor (listen only) */
|
||||
#define IW_MODE_MESH 7 /* Mesh (IEEE 802.11s) network */
|
||||
|
||||
/* Frequency flags */
|
||||
|
||||
#define IW_FREQ_AUTO 0x00 /* Let the driver decides */
|
||||
#define IW_FREQ_FIXED 0x01 /* Force a specific value */
|
||||
|
||||
/************************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
@ -303,8 +319,8 @@ union iwreq_data
|
||||
|
||||
struct iwreq
|
||||
{
|
||||
char ifrn_name[IFNAMSIZ]; /* Interface name, e.g. "eth0" */
|
||||
union iwreq_data u; /* Data payload */
|
||||
char ifrn_name[IFNAMSIZ]; /* Interface name, e.g. "eth0" */
|
||||
union iwreq_data u; /* Data payload */
|
||||
};
|
||||
|
||||
#endif /* CONFIG_DRIVERS_WIRELESS */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* libc/pthread/pthread_rwlockread.c
|
||||
* libc/pthread/pthread_rwlock_rdlock.c
|
||||
*
|
||||
* Copyright (C) 2017 Mark Schulte. All rights reserved.
|
||||
* Author: Mark Schulte <mark@mjs.pw>
|
||||
@ -50,6 +50,15 @@
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PTHREAD_CLEANUP
|
||||
static void rdlock_cleanup(FAR void *arg)
|
||||
{
|
||||
FAR pthread_rwlock_t *rw_lock = (FAR pthread_rwlock_t *)arg;
|
||||
|
||||
(void)pthread_mutex_unlock(&rw_lock->lock);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int tryrdlock(FAR pthread_rwlock_t *rw_lock)
|
||||
{
|
||||
int err;
|
||||
@ -116,6 +125,9 @@ int pthread_rwlock_timedrdlock(FAR pthread_rwlock_t *rw_lock,
|
||||
return err;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PTHREAD_CLEANUP
|
||||
pthread_cleanup_push(&rdlock_cleanup, rw_lock);
|
||||
#endif
|
||||
while ((err = tryrdlock(rw_lock)) == EBUSY)
|
||||
{
|
||||
if (ts != NULL)
|
||||
@ -132,6 +144,9 @@ int pthread_rwlock_timedrdlock(FAR pthread_rwlock_t *rw_lock,
|
||||
break;
|
||||
}
|
||||
}
|
||||
#ifdef CONFIG_PTHREAD_CLEANUP
|
||||
pthread_cleanup_pop(0);
|
||||
#endif
|
||||
|
||||
pthread_mutex_unlock(&rw_lock->lock);
|
||||
return err;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* libc/pthread/pthread_rwlockwrite.c
|
||||
* libc/pthread/pthread_rwlock_wrlock.c
|
||||
*
|
||||
* Copyright (C) 2017 Mark Schulte. All rights reserved.
|
||||
* Author: Mark Schulte <mark@mjs.pw>
|
||||
@ -46,15 +46,29 @@
|
||||
|
||||
#include <nuttx/semaphore.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PTHREAD_CLEANUP
|
||||
static void wrlock_cleanup(FAR void *arg)
|
||||
{
|
||||
FAR pthread_rwlock_t *rw_lock = (FAR pthread_rwlock_t *)arg;
|
||||
|
||||
rw_lock->num_writers--;
|
||||
(void)pthread_mutex_unlock(&rw_lock->lock);
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: pthread_rwlock_rdlock
|
||||
* Name: pthread_rwlock_wrlock
|
||||
*
|
||||
* Description:
|
||||
* Locks a read/write lock for reading
|
||||
* Locks a read/write lock for writing
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
@ -106,6 +120,9 @@ int pthread_rwlock_timedwrlock(FAR pthread_rwlock_t *rw_lock,
|
||||
|
||||
rw_lock->num_writers++;
|
||||
|
||||
#ifdef CONFIG_PTHREAD_CLEANUP
|
||||
pthread_cleanup_push(&wrlock_cleanup, rw_lock);
|
||||
#endif
|
||||
while (rw_lock->write_in_progress || rw_lock->num_readers > 0)
|
||||
{
|
||||
if (ts != NULL)
|
||||
@ -122,12 +139,14 @@ int pthread_rwlock_timedwrlock(FAR pthread_rwlock_t *rw_lock,
|
||||
break;
|
||||
}
|
||||
}
|
||||
#ifdef CONFIG_PTHREAD_CLEANUP
|
||||
pthread_cleanup_pop(0);
|
||||
#endif
|
||||
|
||||
if (err == 0)
|
||||
{
|
||||
rw_lock->write_in_progress = true;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
/* In case of error, notify any blocked readers. */
|
||||
|
@ -62,7 +62,9 @@
|
||||
|
||||
static int netprocfs_linklayer(FAR struct netprocfs_file_s *netfile);
|
||||
static int netprocfs_ipaddresses(FAR struct netprocfs_file_s *netfile);
|
||||
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
static int netprocfs_dripaddress(FAR struct netprocfs_file_s *netfile);
|
||||
#endif
|
||||
#ifdef CONFIG_NETDEV_STATISTICS
|
||||
static int netprocfs_rxstatistics_header(FAR struct netprocfs_file_s *netfile);
|
||||
static int netprocfs_rxstatistics(FAR struct netprocfs_file_s *netfile);
|
||||
@ -83,6 +85,9 @@ static const linegen_t g_linegen[] =
|
||||
{
|
||||
netprocfs_linklayer,
|
||||
netprocfs_ipaddresses
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
, netprocfs_dripaddress
|
||||
#endif
|
||||
#ifdef CONFIG_NETDEV_STATISTICS
|
||||
, netprocfs_rxstatistics_header,
|
||||
netprocfs_rxstatistics,
|
||||
@ -292,7 +297,7 @@ static int netprocfs_ipaddresses(FAR struct netprocfs_file_s *netfile)
|
||||
|
||||
addr.s_addr = dev->d_netmask;
|
||||
len += snprintf(&netfile->line[len], NET_LINELEN - len,
|
||||
"Mask:%s\n", inet_ntoa(addr));
|
||||
"Mask:%s\n\n", inet_ntoa(addr));
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
@ -307,19 +312,42 @@ static int netprocfs_ipaddresses(FAR struct netprocfs_file_s *netfile)
|
||||
len += snprintf(&netfile->line[len], NET_LINELEN - len,
|
||||
"\tinet6 addr:%s/%d\n", addrstr, preflen);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* REVISIT: Show the IPv6 default router address */
|
||||
return len;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: netprocfs_dripaddress
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NET_IPv6
|
||||
static int netprocfs_dripaddress(FAR struct netprocfs_file_s *netfile)
|
||||
{
|
||||
FAR struct net_driver_s *dev;
|
||||
char addrstr[INET6_ADDRSTRLEN];
|
||||
uint8_t preflen;
|
||||
int len = 0;
|
||||
|
||||
DEBUGASSERT(netfile != NULL && netfile->dev != NULL);
|
||||
dev = netfile->dev;
|
||||
|
||||
/* Convert the 128 network mask to a human friendly prefix length */
|
||||
|
||||
preflen = net_ipv6_mask2pref(dev->d_ipv6netmask);
|
||||
|
||||
|
||||
/* Show the IPv6 default router address */
|
||||
|
||||
if (inet_ntop(AF_INET6, dev->d_ipv6draddr, addrstr, INET6_ADDRSTRLEN))
|
||||
{
|
||||
len += snprintf(&netfile->line[len], NET_LINELEN - len,
|
||||
"\tinet6 DRaddr:%s/%d\n", addrstr, preflen);
|
||||
"\tinet6 DRaddr:%s/%d\n\n", addrstr, preflen);
|
||||
}
|
||||
#endif
|
||||
|
||||
len += snprintf(&netfile->line[len], NET_LINELEN - len, "\n");
|
||||
return len;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: netprocfs_rxstatistics_header
|
||||
|
@ -601,8 +601,6 @@ config PTHREAD_CLEANUP_STACKSIZE
|
||||
8 for a CPU with 32-bit addressing and 4 for a CPU with 16-bit
|
||||
addressing.
|
||||
|
||||
endmenu # Pthread Options
|
||||
|
||||
config CANCELLATION_POINTS
|
||||
bool "Cancellation points"
|
||||
default n
|
||||
@ -611,6 +609,8 @@ config CANCELLATION_POINTS
|
||||
cancellation points will also used with the () task_delete() API even if
|
||||
pthreads are not enabled.
|
||||
|
||||
endmenu # Pthread Options
|
||||
|
||||
menu "Performance Monitoring"
|
||||
|
||||
config SCHED_CPULOAD
|
||||
|
@ -150,9 +150,9 @@ int pthread_cancel(pthread_t thread)
|
||||
*
|
||||
* REVISIT: In this case, the clean-up callback will execute on the
|
||||
* thread of the caller of pthread cancel, not on the thread of
|
||||
* the thread-to-be-canceled. Is that an issue? Presumably they
|
||||
* are both within the same group and within the same process address
|
||||
* space.
|
||||
* the thread-to-be-canceled. This is a problem when deferred
|
||||
* cancellation is not supported because, for example, the clean-up
|
||||
* function will be unable to unlock its own mutexes.
|
||||
*/
|
||||
|
||||
pthread_cleanup_popall(tcb);
|
||||
|
@ -125,10 +125,12 @@ int pthread_mutex_take(FAR struct pthread_mutex_s *mutex, bool intr)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Take semaphore underlying the mutex */
|
||||
/* Take semaphore underlying the mutex. pthread_takesemaphore
|
||||
* returns zero on success and a positive errno value on failue.
|
||||
*/
|
||||
|
||||
ret = pthread_takesemaphore(&mutex->sem, intr);
|
||||
if (ret < OK)
|
||||
if (ret != OK)
|
||||
{
|
||||
ret = get_errno();
|
||||
}
|
||||
|
@ -104,13 +104,14 @@ int pthread_mutex_consistent(FAR pthread_mutex_t *mutex)
|
||||
DEBUGASSERT(mutex->pid != 0); /* < 0: available, >0 owned, ==0 error */
|
||||
if (mutex->pid >= 0)
|
||||
{
|
||||
/* No.. Verify that the PID still exists. We may be destroying
|
||||
* the mutex after cancelling a pthread and the mutex may have
|
||||
* been in a bad state owned by the dead pthread. NOTE: The
|
||||
* folling is unspecified behavior (see pthread_mutex_consistent()).
|
||||
/* No.. Verify that the thread associated with the PID still
|
||||
* exists. We may be destroying the mutex after cancelling a
|
||||
* pthread and the mutex may have been in a bad state owned by
|
||||
* the dead pthread. NOTE: The following is unspecified behavior
|
||||
* (see pthread_mutex_consistent()).
|
||||
*
|
||||
* If the holding thread is still valid, then we should be able to
|
||||
* map its PID to the underlying TCB. That is what sched_gettcb()
|
||||
* map its PID to the underlying TCB. That is what sched_gettcb()
|
||||
* does.
|
||||
*/
|
||||
|
||||
@ -130,6 +131,21 @@ int pthread_mutex_consistent(FAR pthread_mutex_t *mutex)
|
||||
status = sem_reset((FAR sem_t *)&mutex->sem, 1);
|
||||
ret = (status != OK) ? get_errno() : OK;
|
||||
}
|
||||
|
||||
/* Otherwise the mutex is held by some active thread. Let's not
|
||||
* touch anything!
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
/* There is no holder of the mutex. Just make sure the
|
||||
* inconsistent flag is cleared and the number of locks is zero.
|
||||
*/
|
||||
|
||||
mutex->flags &= _PTHREAD_MFLAGS_ROBUST;
|
||||
#ifdef CONFIG_PTHREAD_MUTEX_TYPES
|
||||
mutex->nlocks = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
sched_unlock();
|
||||
|
Loading…
x
Reference in New Issue
Block a user