diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-02-02 02:01:30 -0700 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-02-09 22:22:28 -0700 |
commit | 4a6fbecab34616a7b16a859f9458a21b339bb6b0 (patch) | |
tree | 4ffc6a8f2732ac29e6e75d0677c93c2213db6948 /libhw/host_include | |
parent | fa10ceb13e66309ba24605dd5df91c4d626f0614 (diff) |
Have main() set `bootclock`
Diffstat (limited to 'libhw/host_include')
-rw-r--r-- | libhw/host_include/libhw/host_alarmclock.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libhw/host_include/libhw/host_alarmclock.h b/libhw/host_include/libhw/host_alarmclock.h new file mode 100644 index 0000000..163fb9f --- /dev/null +++ b/libhw/host_include/libhw/host_alarmclock.h @@ -0,0 +1,29 @@ +/* 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 { + implements_alarmclock; + 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) +}; + +extern struct alarmclock_vtable hostclock_vtable; + +#endif /* _LIBHW_HOST_ALARMCLOCK_H_ */ |