summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/os.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/os.h b/include/os.h
index d5df22f..f3af4f0 100644
--- a/include/os.h
+++ b/include/os.h
@@ -76,3 +76,25 @@ void os_exit(int exit_code);
* Put tty into raw mode to mimic serial console better
*/
void os_tty_raw(int fd);
+
+/**
+ * Acquires some memory from the underlying os.
+ *
+ * \param length Number of bytes to be allocated
+ * \return Pointer to length bytes or NULL on error
+ */
+void *os_malloc(size_t length);
+
+/**
+ * Access to the usleep function of the os
+ *
+ * \param usec Time to sleep in micro seconds
+ */
+void os_usleep(unsigned long usec);
+
+/**
+ * Gets a monotonic increasing number of nano seconds from the OS
+ *
+ * \return A monotonic increasing time scaled in nano seconds
+ */
+u64 os_get_nsec(void);