Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions MXChip/AZ3166/deps/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,4 +32,4 @@ target_link_libraries(${TARGET}
azrtos::netxduo
jsmn
nanoprintf
)
)
24 changes: 24 additions & 0 deletions MXChip/AZ3166/deps/src/newlib_nano.c
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 <stdio.h>
Expand Down
Loading