/* libhw/common_alarmclock.c - Device-independent utilities * * Copyright (C) 2024 Luke T. Shumaker * SPDX-License-Identifier: AGPL-3.0-or-later */ #include #include #include 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); }