diff options
author | Davide Grohmann <davide.grohmann@arm.com> | 2021-10-19 15:33:23 +0200 |
---|---|---|
committer | Davide Grohmann <davide.grohmann@arm.com> | 2021-10-27 14:25:20 +0200 |
commit | e446b42e711e56974d07f242e18129c335966604 (patch) | |
tree | dc028d171323ac19909cb3314b6051f05f0f8911 /driver_library/src/ethosu_stub.cpp | |
parent | c90bfab219bff42227047329659b8dabf020953f (diff) | |
download | ethos-u-linux-driver-stack-e446b42e711e56974d07f242e18129c335966604.tar.gz |
Improve granularity of wait call in Inference class
It now accepts a timeout expressed in nanoseconds.
Change-Id: I77fb89c33dc117f846b86494883548ef3241f0ab
Diffstat (limited to 'driver_library/src/ethosu_stub.cpp')
-rw-r--r-- | driver_library/src/ethosu_stub.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/driver_library/src/ethosu_stub.cpp b/driver_library/src/ethosu_stub.cpp index 510007f..428d276 100644 --- a/driver_library/src/ethosu_stub.cpp +++ b/driver_library/src/ethosu_stub.cpp @@ -76,9 +76,15 @@ int eioctl(int, unsigned long cmd, void *) { } } -int epoll(struct pollfd *, nfds_t, int timeout_ms) { - int t = 1000 * timeout_ms / 2; - usleep(t); +int eppoll(struct pollfd *, nfds_t, const struct timespec *tmo_p, const sigset_t *) { + if (tmo_p == NULL) { + // sleep one second + usleep(1000000ul); + } else { + unsigned long t = tmo_p->tv_sec / 2; // sleep half of the time + t = t * 1000ul * 1000ul; // sec to microsec + usleep(t); + } return 1; } } // namespace EthosU |