From 297918637971684915f70d9aa24eceed6c72d12e Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Sun, 6 Dec 2020 03:18:41 -0600 Subject: [PATCH] common: define libucontext_ucontext_t for non-freestanding case --- arch/common/common-defs.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/common/common-defs.h b/arch/common/common-defs.h index e32d47f..631d15d 100644 --- a/arch/common/common-defs.h +++ b/arch/common/common-defs.h @@ -46,4 +46,19 @@ __proc: \ #define REG_OFFSET(__reg) (MCONTEXT_GREGS + ((__reg) * REG_SZ)) +#ifndef LIBUCONTEXT_ASSEMBLY + +#ifndef FREESTANDING + +typedef ucontext_t libucontext_ucontext_t; + +#endif + +int libucontext_getcontext(libucontext_ucontext_t *); +void libucontext_makecontext(libucontext_ucontext_t *, void (*)(), int, ...); +int libucontext_setcontext(const libucontext_ucontext_t *); +int libucontext_swapcontext(libucontext_ucontext_t *, const libucontext_ucontext_t *); + +#endif + #endif