diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-11-15 11:58:59 -0700 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-11-19 20:15:16 -0700 |
commit | 936fd0145896acbf55de496f036af55a01b80e82 (patch) | |
tree | a81cfff1fe552a184d614e7a0639583f0a8f8252 /libhw/common_alarmclock.c | |
parent | 573b0f7d4d4a7e84ae8d1e4a7c0611dd9f513fa2 (diff) |
libhw_generic: Split into a separate library
Diffstat (limited to 'libhw/common_alarmclock.c')
-rw-r--r-- | libhw/common_alarmclock.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/libhw/common_alarmclock.c b/libhw/common_alarmclock.c deleted file mode 100644 index 9812d44..0000000 --- a/libhw/common_alarmclock.c +++ /dev/null @@ -1,21 +0,0 @@ -/* libhw/common_alarmclock.c - Device-independent <libhw/generic/alarmclock.h> utilities - * - * Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com> - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -#include <libcr/coroutine.h> -#include <libmisc/vcall.h> - -#include <libhw/generic/alarmclock.h> - -static void alarmclock_sleep_intrhandler(void *_arg) { - cid_t *cid = _arg; - cr_unpause_from_intrhandler(*cid); -} - -void alarmclock_sleep_until_ns(implements_alarmclock *clock, uint64_t abstime_ns) { - cid_t cid = cr_getcid(); - struct alarmclock_trigger trigger; - VCALL(clock, add_trigger, &trigger, abstime_ns, alarmclock_sleep_intrhandler, &cid); -} |