diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/cyclic.h | 2 | ||||
-rw-r--r-- | include/os.h | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/include/cyclic.h b/include/cyclic.h index 7601636433..9c5c4fcc54 100644 --- a/include/cyclic.h +++ b/include/cyclic.h @@ -39,6 +39,7 @@ struct cyclic_drv { * @run_cnt: Counter of executions occurances * @next_call: Next time in us, when the function shall be executed again * @list: List node + * @already_warned: Flag that we've warned about exceeding CPU time usage */ struct cyclic_info { void (*func)(void *ctx); @@ -50,6 +51,7 @@ struct cyclic_info { uint64_t run_cnt; uint64_t next_call; struct list_head list; + bool already_warned; }; /** Function type for cyclic functions */ diff --git a/include/os.h b/include/os.h index 5b353ae9d9..54874f5e0e 100644 --- a/include/os.h +++ b/include/os.h @@ -109,6 +109,23 @@ int os_unlink(const char *pathname); void os_exit(int exit_code) __attribute__((noreturn)); /** + * os_alarm() - access to the OS alarm() system call + */ +unsigned int os_alarm(unsigned int seconds); + +/** + * os_set_alarm_handler() - set handler for SIGALRM + * + * @handler: The handler function. Pass NULL for SIG_DFL. + */ +void os_set_alarm_handler(void (*handler)(int)); + +/** + * os_raise_sigalrm() - do raise(SIGALRM) + */ +void os_raise_sigalrm(void); + +/** * os_tty_raw() - put tty into raw mode to mimic serial console better * * @fd: File descriptor of stdin (normally 0) |