QuRT: Changes to enable qurt target to build

QuRT doesn't support unlink and does not provide getpid().
The DSPAL layer provides access to usleep so an implementation is
no longer needed.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
Mark Charlebois
2015-06-08 22:22:00 -07:00
parent a5c214a7bb
commit cb231e89f6
9 changed files with 34 additions and 17 deletions
@@ -48,7 +48,6 @@
#include <errno.h>
#include <unistd.h>
#include <semaphore.h>
#include <qurt.h>
#include "systemlib/param/param.h"
@@ -57,14 +56,10 @@ __BEGIN_DECLS
// FIXME - sysconf(_SC_CLK_TCK) not supported
long PX4_TICKS_PER_SEC = 1000;
void usleep(useconds_t usec) {
qurt_timer_sleep(usec);
}
unsigned int sleep(unsigned int sec)
{
for (unsigned int i=0; i< sec; i++)
qurt_timer_sleep(1000000);
usleep(1000000);
return 0;
}
@@ -245,6 +245,20 @@ int px4_task_kill(px4_task_t id, int sig)
return rv;
}
pid_t px4_getpid()
{
pthread_t pid = pthread_self();
// Get pthread ID from the opaque ID
for (int i=0; i<PX4_MAX_TASKS; ++i) {
if (taskmap[i].pid == pid) {
return i;
}
}
PX4_ERR("px4_getpid() called from non-thread context!");
return -EINVAL;
}
void px4_show_tasks()
{
int idx;