diff options
Diffstat (limited to 'libhw_generic')
-rw-r--r-- | libhw_generic/CMakeLists.txt | 1 | ||||
-rw-r--r-- | libhw_generic/alarmclock.c | 18 |
2 files changed, 1 insertions, 18 deletions
diff --git a/libhw_generic/CMakeLists.txt b/libhw_generic/CMakeLists.txt index e38fbe9..b1632aa 100644 --- a/libhw_generic/CMakeLists.txt +++ b/libhw_generic/CMakeLists.txt @@ -8,7 +8,6 @@ target_include_directories(libhw_generic SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE target_link_libraries(libhw_generic INTERFACE libmisc libobj - libcr ) target_sources(libhw_generic INTERFACE diff --git a/libhw_generic/alarmclock.c b/libhw_generic/alarmclock.c index 7fd049e..31fbbaf 100644 --- a/libhw_generic/alarmclock.c +++ b/libhw_generic/alarmclock.c @@ -1,25 +1,9 @@ -/* libhw_generic/alarmclock.c - Device-independent <libhw/generic/alarmclock.h> utilities +/* libhw_generic/alarmclock.c - Device-independent <libhw/generic/alarmclock.h> storage * * Copyright (C) 2024-2025 Luke T. Shumaker <lukeshu@lukeshu.com> * SPDX-License-Identifier: AGPL-3.0-or-later */ -#include <libcr/coroutine.h> - #include <libhw/generic/alarmclock.h> lo_interface alarmclock bootclock = {0}; - -static void alarmclock_sleep_intrhandler(void *_arg) { - cid_t cid = *(cid_t *)_arg; - cr_unpause_from_intrhandler(cid); -} - -void alarmclock_sleep_until_ns(lo_interface alarmclock clock, uint64_t abstime_ns) { - bool saved = cr_save_and_disable_interrupts(); - cid_t cid = cr_getcid(); - struct alarmclock_trigger trigger; - LO_CALL(clock, add_trigger, &trigger, abstime_ns, alarmclock_sleep_intrhandler, &cid); - cr_pause_and_yield(); - cr_restore_interrupts(saved); -} |