|
|
@ -60,14 +60,19 @@ |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define system_exit exit |
|
|
|
|
|
|
|
#define system_clock_gettime clock_gettime |
|
|
|
|
|
|
|
#define system_clock_settime clock_settime |
|
|
|
|
|
|
|
#define system_pthread_cond_timedwait pthread_cond_timedwait |
|
|
|
|
|
|
|
#define system_usleep usleep |
|
|
|
|
|
|
|
#define system_sleep sleep |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef PX4_DISABLE_GCC_POISON |
|
|
|
|
|
|
|
|
|
|
|
/* exit() is used on NuttX to exit a task. However on Posix, it will exit the
|
|
|
|
/* exit() is used on NuttX to exit a task. However on Posix, it will exit the
|
|
|
|
* whole application, so we prevent its use there. There are cases where it |
|
|
|
* whole application, so we prevent its use there. There are cases where it |
|
|
|
* still needs to be used, thus we remap system_exit to exit. |
|
|
|
* still needs to be used, thus we remap system_exit to exit. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
#define system_exit exit |
|
|
|
|
|
|
|
#if !defined(__PX4_NUTTX) |
|
|
|
#if !defined(__PX4_NUTTX) |
|
|
|
#include <stdlib.h> |
|
|
|
#include <stdlib.h> |
|
|
|
#ifdef __cplusplus |
|
|
|
#ifdef __cplusplus |
|
|
@ -83,8 +88,6 @@ |
|
|
|
/* For SITL lockstep we fake the clock, sleeping, and timedwaits
|
|
|
|
/* For SITL lockstep we fake the clock, sleeping, and timedwaits
|
|
|
|
* Therefore, we prefix these syscalls with system_. */ |
|
|
|
* Therefore, we prefix these syscalls with system_. */ |
|
|
|
#include <time.h> |
|
|
|
#include <time.h> |
|
|
|
#define system_clock_gettime clock_gettime |
|
|
|
|
|
|
|
#define system_clock_settime clock_settime |
|
|
|
|
|
|
|
/* We can't poison clock_settime/clock_gettime because they are
|
|
|
|
/* We can't poison clock_settime/clock_gettime because they are
|
|
|
|
* used in DriverFramework. */ |
|
|
|
* used in DriverFramework. */ |
|
|
|
|
|
|
|
|
|
|
@ -93,20 +96,17 @@ |
|
|
|
// We can't include this for NuttX otherwise we get conflicts for read/write
|
|
|
|
// We can't include this for NuttX otherwise we get conflicts for read/write
|
|
|
|
// symbols in cannode.
|
|
|
|
// symbols in cannode.
|
|
|
|
#endif // !defined(__PX4_NUTTX)
|
|
|
|
#endif // !defined(__PX4_NUTTX)
|
|
|
|
#define system_pthread_cond_timedwait pthread_cond_timedwait |
|
|
|
|
|
|
|
/* We can't poison pthread_cond_timedwait because it seems to be used in the
|
|
|
|
/* We can't poison pthread_cond_timedwait because it seems to be used in the
|
|
|
|
* <string> include. */ |
|
|
|
* <string> include. */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* We don't poison usleep and sleep because it is used in dependencies
|
|
|
|
/* We don't poison usleep and sleep because it is used in dependencies
|
|
|
|
* like uavcan and DriverFramework. */ |
|
|
|
* like uavcan. */ |
|
|
|
#if !defined(__PX4_NUTTX) |
|
|
|
#if !defined(__PX4_NUTTX) |
|
|
|
#include <unistd.h> |
|
|
|
#include <unistd.h> |
|
|
|
// We can't include this for NuttX otherwise we get conflicts for read/write
|
|
|
|
// We can't include this for NuttX otherwise we get conflicts for read/write
|
|
|
|
// symbols in cannode.
|
|
|
|
// symbols in cannode.
|
|
|
|
#endif // !defined(__PX4_NUTTX)
|
|
|
|
#endif // !defined(__PX4_NUTTX)
|
|
|
|
#define system_usleep usleep |
|
|
|
|
|
|
|
#define system_sleep sleep |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* On NuttX we call clearenv() so we cannot use getenv() and others (see
|
|
|
|
/* On NuttX we call clearenv() so we cannot use getenv() and others (see
|
|
|
@ -123,3 +123,5 @@ |
|
|
|
* need to get changed. */ |
|
|
|
* need to get changed. */ |
|
|
|
#pragma GCC poison getenv setenv putenv |
|
|
|
#pragma GCC poison getenv setenv putenv |
|
|
|
#endif // defined(__PX4_NUTTX)
|
|
|
|
#endif // defined(__PX4_NUTTX)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // PX4_DISABLE_GCC_POISON
|
|
|
|