From a04f2c6b61a9039c441bc33809f1c6fa95177533 Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Thu, 28 Dec 2023 03:45:24 -0500 Subject: [PATCH] file_io, mbstring OK --- configure.py | 8 ++++---- include/global.h | 2 ++ .../MSL/MSL_C/MSL_Common/Include/string.h | 7 ++++--- src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Src/alloc.c | 3 --- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/configure.py b/configure.py index e52e44397..1be98c3f7 100644 --- a/configure.py +++ b/configure.py @@ -1090,17 +1090,17 @@ config.libs = [ "host": False, "objects": [ Object(NonMatching, "PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Src/abort_exit.c"), - Object(NonMatching, "PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Src/alloc.c"), + Object(NonMatching, "PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Src/alloc.c", extra_cflags=["-inline noauto"]), Object(Matching, "PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Src/errno.c"), Object(Matching, "PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Src/ansi_files.c"), - Object(NonMatching, "PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Src/ansi_fp.c"), + Object(NonMatching, "PowerPC_EABI_Support/MSL/MSL_C/MSL_Common_Embedded/Src/ansi_fp.c", extra_cflags=["-inline noauto"]), Object(Matching, "PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Src/arith.c"), Object(Matching, "PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Src/buffer_io.c"), Object(Matching, "PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Src/ctype.c"), Object(Matching, "PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Src/direct_io.c"), - Object(NonMatching, "PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Src/file_io.c"), + Object(Matching, "PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Src/file_io.c", extra_cflags=["-inline noauto"]), Object(Matching, "PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Src/FILE_POS.c"), - Object(NonMatching, "PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Src/mbstring.c"), + Object(Matching, "PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Src/mbstring.c", extra_cflags=["-inline noauto"]), Object(Matching, "PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Src/mem.c"), Object(NonMatching, "PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Src/mem_funcs.c"), Object(Matching, "PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Src/misc_io.c"), diff --git a/include/global.h b/include/global.h index d63cabbeb..edd37af4c 100644 --- a/include/global.h +++ b/include/global.h @@ -32,10 +32,12 @@ #define STATIC_ASSERT(cond) typedef char GLUE2(static_assertion_failed, __LINE__)[(cond) ? 1 : -1] #define ALIGN_DECL(ALIGNMENT) __attribute__((aligned(ALIGNMENT))) #define SECTION_DATA __declspec(section ".data") +#define SECTION_INIT __declspec(section ".init") #else #define STATIC_ASSERT(...) #define ALIGN_DECL(...) #define SECTION_DATA +#define SECTION_INIT #endif // hack to make functions that return comparisons as int match diff --git a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/string.h b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/string.h index 7b69d4e16..4f93326f8 100644 --- a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/string.h +++ b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/string.h @@ -3,14 +3,15 @@ #include "stddef.h" #include "extras.h" +#include "global.h" #ifdef __cplusplus extern "C" { #endif -__declspec(section ".init") void* memcpy(void* dest, const void* src, size_t n); -__declspec(section ".init") void __fill_mem(void* dest, int val, size_t count); -__declspec(section ".init") void* memset(void* dest, int val, size_t count); +SECTION_INIT void* memcpy(void* dest, const void* src, size_t n); +SECTION_INIT void __fill_mem(void* dest, int val, size_t count); +SECTION_INIT void* memset(void* dest, int val, size_t count); int memcmp(const void* lhs, const void* rhs, size_t count); void* __memrchr(const void* ptr, int ch, size_t count); diff --git a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Src/alloc.c b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Src/alloc.c index d04885df0..777ba409e 100644 --- a/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Src/alloc.c +++ b/src/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Src/alloc.c @@ -82,9 +82,6 @@ typedef struct mem_pool_obj { } mem_pool_obj; -mem_pool_obj __malloc_pool; -static int initialized = 0; - static SubBlock* SubBlock_merge_prev(SubBlock*, SubBlock**); static void SubBlock_merge_next(SubBlock*, SubBlock**);