summaryrefslogtreecommitdiff
path: root/src/sys/include/os
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-09-21 01:02:53 -0400
committerIan Moffett <ian@osmora.org>2025-09-21 01:02:53 -0400
commit0c75ed9fb14275603b478c5bbd96bcd4d3f982e6 (patch)
tree7873c662de94f8c3d34ff5168adc64fa98e2e9dd /src/sys/include/os
parent4353697bba19742123233aa6ad1322215a5304ad (diff)
kern: clkdev: Add callback to get elapsed time
Add new clock device callback to get the elapsed time from the timer being initialized, in microseconds. Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'src/sys/include/os')
-rw-r--r--src/sys/include/os/clkdev.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sys/include/os/clkdev.h b/src/sys/include/os/clkdev.h
index 1f776cd..e70d91b 100644
--- a/src/sys/include/os/clkdev.h
+++ b/src/sys/include/os/clkdev.h
@@ -34,7 +34,8 @@
#include <sys/param.h>
/* Clock attributes */
-#define CLKDEV_MSLEEP BIT(0) /* Has msleep() */
+#define CLKDEV_MSLEEP BIT(0) /* Has msleep() */
+#define CLKDEV_GET_USEC BIT(1) /* Get elapsed usec */
#define MAX_CLKDEV 4
@@ -44,11 +45,13 @@
*
* @name: Name of clock
* @msleep: Sleep for 'n' msec
+ * @get_time_usec: Get time since init in microseconds
* @attr: Attribute mask
*/
struct clkdev {
const char *name;
int(*msleep)(size_t ms);
+ size_t(*get_time_usec)(void);
uint16_t attr;
};