diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-06-01 16:42:55 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-06-01 16:42:55 +0300 |
| commit | 7a1c7ed1b1c30ba4c668194a955fb414e471bade (patch) | |
| tree | 2f49f04e455f004af640918abfcd6f91ce6a1323 /include | |
| parent | e8f80bae97a835b6b256228d4bbeaf48ae16dcbb (diff) | |
| download | kmi-7a1c7ed1b1c30ba4c668194a955fb414e471bade.tar.gz kmi-7a1c7ed1b1c30ba4c668194a955fb414e471bade.zip | |
add sleep syscall
+ Sets the current core to sleep
Diffstat (limited to 'include')
| -rw-r--r-- | include/kmi/power.h | 8 | ||||
| -rw-r--r-- | include/kmi/syscalls.h | 3 | ||||
| -rw-r--r-- | include/kmi/uapi.h | 5 |
3 files changed, 16 insertions, 0 deletions
diff --git a/include/kmi/power.h b/include/kmi/power.h index d11b9d1..db00999 100644 --- a/include/kmi/power.h +++ b/include/kmi/power.h @@ -35,4 +35,12 @@ enum poweroff_type { */ stat_t poweroff(enum poweroff_type type); +/** + * Set the current core to sleep. + * + * @return Nothing on success (we should be sleeping), + * \ref ERR_MISC if sleep was not successful + */ +stat_t sleep(); + #endif diff --git a/include/kmi/syscalls.h b/include/kmi/syscalls.h index 1de4fb2..e503709 100644 --- a/include/kmi/syscalls.h +++ b/include/kmi/syscalls.h @@ -142,6 +142,9 @@ enum { /** Shutdown, reboot, etc. */ SYS_POWEROFF, + /** Set this core to sleep. */ + SYS_SLEEP, + /** Request to handle IRQ. */ SYS_IRQ_REQ, diff --git a/include/kmi/uapi.h b/include/kmi/uapi.h index 40cfae4..d1d3a38 100644 --- a/include/kmi/uapi.h +++ b/include/kmi/uapi.h @@ -764,6 +764,11 @@ SYSCALL_DECLARE3(clear_cap, tid, off, cap); SYSCALL_DECLARE1(poweroff, type); /** + * Sets the current core to sleep. Might take parameters in the future if there + * arises a need for different levels of sleep, but for now zero params. */ +SYSCALL_DECLARE0(sleep); + +/** * Request to handle IRQ. * * @param t Current tcb. |
