diff --git a/MXChip/AZ3166/deps/src/CMakeLists.txt b/MXChip/AZ3166/deps/src/CMakeLists.txt index 9c3e3766..85d113cd 100644 --- a/MXChip/AZ3166/deps/src/CMakeLists.txt +++ b/MXChip/AZ3166/deps/src/CMakeLists.txt @@ -16,7 +16,7 @@ set(TARGET app_common) # Initialize sources set(SOURCES "") -# Allow to disable the newlib stubbing +# Add the sample's Newlib system-call glue unless the BSP provides its own. if(NOT DEFINED DISABLE_NEWLIB_STUB) list(APPEND SOURCES newlib_nano.c @@ -32,4 +32,4 @@ target_link_libraries(${TARGET} azrtos::netxduo jsmn nanoprintf -) \ No newline at end of file +) diff --git a/MXChip/AZ3166/deps/src/newlib_nano.c b/MXChip/AZ3166/deps/src/newlib_nano.c index 98c66eb9..7b714d0e 100644 --- a/MXChip/AZ3166/deps/src/newlib_nano.c +++ b/MXChip/AZ3166/deps/src/newlib_nano.c @@ -1,6 +1,7 @@ /* * Copyright (c) Microsoft * Copyright (c) 2024 Eclipse Foundation + * Copyright (c) 2026 Eclipse ThreadX contributors * * This program and the accompanying materials are made available * under the terms of the MIT license which is available at @@ -13,6 +14,29 @@ * Frédéric Desbiens - 2024 version. */ +// Some portions generated by Codex (GPT-5). + +/* + * Bare-metal C library integration for the MXChip sample. + * + * Newlib and newlib-nano implement the C library, but delegate services that + * normally come from an operating system to target-provided system calls. + * This file supplies the subset needed by this sample. The board console in + * app/common/console.c supplies _read() and _write() separately. + * + * These functions are not part of ThreadX or its POSIX compatibility layer. + * The exact system calls required by an application depend on the Newlib + * version and configuration, the linker specifications, and the C library + * routines that the application uses. + * + * Several functions below are minimal stubs because the sample has no file + * system or process model. The _sbrk() implementation is also sample-specific: + * it starts the C library heap at the linker-defined _end symbol, has no upper + * bound, and provides no synchronization. Applications that allocate from + * multiple threads, use a different memory layout, or require the unsupported + * services must provide suitable replacements in their BSP. + */ + #ifdef __GNUC__ #include