summaryrefslogtreecommitdiff
path: root/libhw_cr/host_include/libhw/host_alarmclock.h
diff options
context:
space:
mode:
Diffstat (limited to 'libhw_cr/host_include/libhw/host_alarmclock.h')
-rw-r--r--libhw_cr/host_include/libhw/host_alarmclock.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/libhw_cr/host_include/libhw/host_alarmclock.h b/libhw_cr/host_include/libhw/host_alarmclock.h
new file mode 100644
index 0000000..89df68a
--- /dev/null
+++ b/libhw_cr/host_include/libhw/host_alarmclock.h
@@ -0,0 +1,27 @@
+/* libhw/host_alarmclock.h - <libhw/generic/alarmclock.h> implementation for hosted glibc
+ *
+ * Copyright (C) 2024-2025 Luke T. Shumaker <lukeshu@lukeshu.com>
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+#ifndef _LIBHW_HOST_ALARMCLOCK_H_
+#define _LIBHW_HOST_ALARMCLOCK_H_
+
+#include <stdbool.h> /* for bool */
+#include <time.h> /* for clockid_t, timer_t */
+
+#include <libmisc/private.h>
+#include <libhw/generic/alarmclock.h>
+
+struct hostclock {
+ clockid_t clock_id;
+
+ BEGIN_PRIVATE(LIBHW_HOST_ALARMCLOCK_H)
+ bool initialized;
+ timer_t timer_id;
+ struct alarmclock_trigger *queue;
+ END_PRIVATE(LIBHW_HOST_ALARMCLOCK_H)
+};
+LO_IMPLEMENTATION_H(alarmclock, struct hostclock, hostclock)
+
+#endif /* _LIBHW_HOST_ALARMCLOCK_H_ */