|
1 | 1 | #include "uspace_rtapi_posix.hh" |
2 | 2 | #include "rtapi.h" |
3 | | -#include "uspace_common.h" |
4 | 3 |
|
5 | 4 | #include <stdio.h> |
6 | 5 | #include <stdlib.h> |
@@ -96,6 +95,8 @@ pthread_once_t Posix::lock_once = PTHREAD_ONCE_INIT; |
96 | 95 | pthread_key_t Posix::key; |
97 | 96 | pthread_mutex_t Posix::thread_lock; |
98 | 97 |
|
| 98 | +extern RtapiApp &App(); //ToDo: Nicer |
| 99 | + |
99 | 100 | void *Posix::wrapper(void *arg) |
100 | 101 | { |
101 | 102 | struct rtapi_task *task; |
@@ -171,7 +172,7 @@ void Posix::wait() { |
171 | 172 | } |
172 | 173 | else |
173 | 174 | { |
174 | | - int res = rtapi_clock_nanosleep(RTAPI_CLOCK, TIMER_ABSTIME, &task->nextstart, nullptr, &now); |
| 175 | + int res = clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &task->nextstart, nullptr); |
175 | 176 | if(res < 0) perror("clock_nanosleep"); |
176 | 177 | } |
177 | 178 | if(do_thread_lock) |
@@ -204,7 +205,7 @@ void Posix::do_outb(unsigned char val, unsigned int port) |
204 | 205 |
|
205 | 206 | void Posix::do_delay(long ns) { |
206 | 207 | struct timespec ts = {0, ns}; |
207 | | - rtapi_clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, NULL, NULL); |
| 208 | + clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, nullptr); |
208 | 209 | } |
209 | 210 |
|
210 | 211 | int Posix::run_threads(int fd, int(*callback)(int fd)) { |
|
0 commit comments