Skip to content

[ATfE] Document _platform_debug_putc()#723

Merged
voltur01 merged 2 commits intoarm:arm-softwarefrom
voltur01:add_libc_debug_puts_doc
Feb 19, 2026
Merged

[ATfE] Document _platform_debug_putc()#723
voltur01 merged 2 commits intoarm:arm-softwarefrom
voltur01:add_libc_debug_puts_doc

Conversation

@voltur01
Copy link
Contributor

Add more details about void _platform_debug_putc(int c) to the documentation page.

Add more details about `void _platform_debug_putc(int c)` to the documentation page.
@voltur01 voltur01 requested a review from a team as a code owner February 11, 2026 16:21
smithp35
smithp35 previously approved these changes Feb 11, 2026
Copy link
Contributor

@smithp35 smithp35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small suggestion, which I don't think is necessary if you prefer the original. Otherwise looks good to me.

With `crt0` the output is discarded. You can implement
`void _platform_debug_putc(int c)` in your application to redirect it,
for example, to an UART. The implementation must be safe to be called with
only the assumption that the stack pointer is setup: it must not use heap or
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the assumption that this may be called before we copy code and data from flash to RAM could be worth mentioning that. Possibly:

it must not use the heap or call other LLVM libc functions. It must not access any code or data that depends on _platform_init_data_segments().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really good point, thanks - added!

Copy link
Contributor

@smithp35 smithp35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@voltur01
Copy link
Contributor Author

@MarkMurrayARM could you please re-review, thank you!

Copy link
Contributor

@MarkMurrayARM MarkMurrayARM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@voltur01 voltur01 merged commit 66976ff into arm:arm-software Feb 19, 2026
1 check passed
voltur01 added a commit to voltur01/arm-toolchain that referenced this pull request Feb 20, 2026
Add more details about `void _platform_debug_putc(int c)` to the
documentation page.
voltur01 added a commit that referenced this pull request Feb 20, 2026
This cherry-picks changes relevant to llvmlibc-support from current
arm-software into the 22.x release branch:

12a4f2c [ATfE] Document _platform_debug_putc() (#723)
75faad2 [ATfE] Support command line options in LLVM libc (#705)
2ae2b6c [ATfE] Fix libc v7-R no-fpregs attribute build failure
(#720)
bc8a58b [ATfE] Provide LLVM libc handlers for hardware and runtime
setup (#706)
852e751 [ATfE] Provide debug output handler in LLVM libc crt0
9be5d72 (origin/add_unhosted_exit, add_unhosted_exit) Simplified
implementation of exit to avoid issues with privileged assembly
instructions
983f37c [ATfE] Provide nohost init and exit in llvmlibc startup
code
6859f67 [ATfE] Replace call to abort with __llvm_libc_exit in libc
startup code (#678)
a284205 (origin/update_exit_comment, update_exit_comment) [ATfE]
Update comment about handling cleanup for exit()
fb865b8 (origin/remove_abort_redefinition,
remove_abort_redefinition) [ATfE] Replace call to abort with
__llvm_libc_exit in libc startup code
28c43df (origin/use_sys_readc_for_stdin) Merge branch
'arm-software' into use_sys_readc_for_stdin
53e062f (use_sys_readc_for_stdin) Added a comment with rationale
and TODO
bbf19b6 (origin/add_semihosting_abort, add_semihosting_abort) Mark
internal semihosting function as static
52d1d90 Provide semihosting_call_exit() and add TODO for exit()
99c608d Replace exit() with direct call to __llvm_libc_exit()
07fe14b [ATfE] Use semihosting SYS_READC for stdin with llvm libc
ab08655 [ATfE] Redirect libc abort() to semihosting exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants