From 17a83000e062a7dadb6ea51ed3860a1442e11d6b Mon Sep 17 00:00:00 2001 From: James Benton Date: Sun, 1 Jul 2018 16:25:03 +0100 Subject: [PATCH] coreinit: Add OSSwitchFiber{Ex} functions. --- include/coreinit/fiber.h | 35 ++++++++++++++++++++++ tests/test_compile_headers_as_c/main.c | 1 + tests/test_compile_headers_as_cpp/main.cpp | 1 + 3 files changed, 37 insertions(+) create mode 100644 include/coreinit/fiber.h diff --git a/include/coreinit/fiber.h b/include/coreinit/fiber.h new file mode 100644 index 00000000..1c5b1e1e --- /dev/null +++ b/include/coreinit/fiber.h @@ -0,0 +1,35 @@ +#pragma once +#include + +/** + * \defgroup coreinit_fiber Fiber + * \ingroup coreinit + * + * @{ + */ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void (*OSFiberEntryFn)(); +typedef void (*OSFiberExEntryFn)(uint32_t arg1, uint32_t arg2, + uint32_t arg3, uint32_t arg4); + +int32_t +OSSwitchFiber(OSFiberEntryFn entry, + void *stack); + +int32_t +OSSwitchFiberEx(uint32_t arg1, + uint32_t arg2, + uint32_t arg3, + uint32_t arg4, + OSFiberExEntryFn entry, + void *stack); + +#ifdef __cplusplus +} +#endif + +/** @} */ diff --git a/tests/test_compile_headers_as_c/main.c b/tests/test_compile_headers_as_c/main.c index 9e7c4db9..5f70c2cb 100644 --- a/tests/test_compile_headers_as_c/main.c +++ b/tests/test_compile_headers_as_c/main.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include diff --git a/tests/test_compile_headers_as_cpp/main.cpp b/tests/test_compile_headers_as_cpp/main.cpp index 9e7c4db9..5f70c2cb 100644 --- a/tests/test_compile_headers_as_cpp/main.cpp +++ b/tests/test_compile_headers_as_cpp/main.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include