oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
Loading...
Searching...
No Matches
irq.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2026 Kamil Lulko <kamil.lulko@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 *
6 * This file is part of oveRTOS.
7 */
8
28#ifndef OVE_IRQ_H
29#define OVE_IRQ_H
30
31#include "ove/types.h"
32#include "ove_config.h"
33#include <stdbool.h>
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
54typedef uint64_t ove_irq_key_t;
55
56#ifdef CONFIG_OVE_ASYNC
57
71
80
95bool ove_is_in_isr(void);
96
97#else /* !CONFIG_OVE_ASYNC */
98
99static inline ove_irq_key_t ove_irq_lock(void)
100{
101 return 0;
102}
103static inline void ove_irq_unlock(ove_irq_key_t key)
104{
105 (void)key;
106}
107static inline bool ove_is_in_isr(void)
108{
109 return false;
110}
111
112#endif /* CONFIG_OVE_ASYNC */
113
114#ifdef __cplusplus
115}
116#endif
117
/* end of ove_irq group */
119
120#endif /* OVE_IRQ_H */
ove_irq_key_t ove_irq_lock(void)
Enter a critical section: disable interrupts (or equivalent backend mechanism) and return an opaque r...
bool ove_is_in_isr(void)
Return true if the caller is currently in interrupt context.
void ove_irq_unlock(ove_irq_key_t key)
Leave a critical section, restoring the interrupt state captured by the corresponding ove_irq_lock.
uint64_t ove_irq_key_t
Opaque cookie returned by ove_irq_lock for use with ove_irq_unlock.
Definition irq.h:54