From d16d8bfeb1766c339da797eb2de3126e63a5a44c Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Mon, 30 Sep 2024 14:55:35 -0600 Subject: make coroutine.c signal-safe, add cr_cid_info() --- libcr/include/libcr/coroutine.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libcr/include') diff --git a/libcr/include/libcr/coroutine.h b/libcr/include/libcr/coroutine.h index f580b09..0c5eac3 100644 --- a/libcr/include/libcr/coroutine.h +++ b/libcr/include/libcr/coroutine.h @@ -126,4 +126,16 @@ cid_t cr_getcid(void); * another as paused; a coroutine may only do those things to itself. */ +/* While the following are defined here unconditionally, the + * implementations are #if'd on CONFIG_COROUTINE_MEASURE_STACK. + */ + +struct cr_cid_info { + size_t stack_cap; + size_t stack_max; + size_t stack_cur; +}; + +void cr_cid_info(cid_t cid, struct cr_cid_info *ret); + #endif /* _COROUTINE_H_ */ -- cgit v1.2.3-2-g168b