1
0
mirror of https://github.com/livingcomputermuseum/UniBone.git synced 2026-02-08 17:21:58 +00:00

DMA/INTR arbitration rework, emulated CPU20 with DMA&INTR, runs XXDP

This commit is contained in:
Joerg Hoppe
2019-10-04 12:45:26 +02:00
parent 73b9d2f9fb
commit f314317e2a
57 changed files with 2498 additions and 1795 deletions

View File

@@ -122,12 +122,16 @@ bool timeout_c::reached() {
return (elapsed_ns() > duration_ns);
}
/***
Tests indicate that any nano_sleep() often causes delays of 60-80 µs
***/
// wait a number of nanoseconds, resolution in 0.1 millisecs
void timeout_c::wait_ns(uint64_t duration_ns) {
struct timespec ts = { (long) (duration_ns / BILLION), (long) (duration_ns % BILLION) };
int res = nanosleep(&ts, NULL);
if (res)
DEBUG("nanosleep() return a %d", res);
assert(res == 0);
// DEBUG("nanosleep() return a %d", res);
}
// wait a number of milliseconds