|
1 | 1 | /* |
2 | 2 | * Copyright (c) Microsoft |
3 | 3 | * Copyright (c) 2024 Eclipse Foundation |
| 4 | + * Copyright (c) 2026 Eclipse ThreadX contributors |
4 | 5 | * |
5 | 6 | * This program and the accompanying materials are made available |
6 | 7 | * under the terms of the MIT license which is available at |
|
13 | 14 | * Frédéric Desbiens - 2024 version. |
14 | 15 | */ |
15 | 16 |
|
| 17 | +// Some portions generated by Codex (GPT-5). |
| 18 | + |
| 19 | +/* |
| 20 | + * Bare-metal C library integration for the MXChip sample. |
| 21 | + * |
| 22 | + * Newlib and newlib-nano implement the C library, but delegate services that |
| 23 | + * normally come from an operating system to target-provided system calls. |
| 24 | + * This file supplies the subset needed by this sample. The board console in |
| 25 | + * app/common/console.c supplies _read() and _write() separately. |
| 26 | + * |
| 27 | + * These functions are not part of ThreadX or its POSIX compatibility layer. |
| 28 | + * The exact system calls required by an application depend on the Newlib |
| 29 | + * version and configuration, the linker specifications, and the C library |
| 30 | + * routines that the application uses. |
| 31 | + * |
| 32 | + * Several functions below are minimal stubs because the sample has no file |
| 33 | + * system or process model. The _sbrk() implementation is also sample-specific: |
| 34 | + * it starts the C library heap at the linker-defined _end symbol, has no upper |
| 35 | + * bound, and provides no synchronization. Applications that allocate from |
| 36 | + * multiple threads, use a different memory layout, or require the unsupported |
| 37 | + * services must provide suitable replacements in their BSP. |
| 38 | + */ |
| 39 | + |
16 | 40 | #ifdef __GNUC__ |
17 | 41 |
|
18 | 42 | #include <stdio.h> |
|
0 commit comments