From 91fefb09f03cc49966aee1a7c371f439d1834a4b Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Sun, 17 Nov 2024 22:08:54 -0700 Subject: libcr: Add cr_is_in_intrhandler() and _cr_plat_are_interrupts_enabled() --- libcr/include/libcr/coroutine.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libcr/include') diff --git a/libcr/include/libcr/coroutine.h b/libcr/include/libcr/coroutine.h index 8aeab7e..dc51a0f 100644 --- a/libcr/include/libcr/coroutine.h +++ b/libcr/include/libcr/coroutine.h @@ -152,6 +152,12 @@ bool _cr_plat_save_and_disable_interrupts(void); } while (0) void _cr_plat_enable_interrupts(void); +/** + * Return whether the current code is running in an interrupt handler + * or "normally". + */ +bool cr_is_in_intrhandler(void); + /** * cr_unpause_from_intrhandler() is like cr_unpause(), but safe to * call from a interrupt handler. -- cgit v1.2.3-2-g168b