-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New improved printk implementation #101
Conversation
93edbbb
to
924c4d8
Compare
@josecm at least one CI check is failing |
A from-sratch improved implementation of printk that allows printing strings larger than the allocated print buffer. It also makes this buffer statically allocated instead of allocating it on the printing cpu stack. Finally, it removes the per-uart implementation uart_puts function as this is essnetially replicated behavior, only the uart_putc is needed. This logic is now part of the console itself. The format printf attribute is also added so that errors in the format string type identifiers are detected at compile time. Signed-off-by: Jose Martins <[email protected]>
924c4d8
to
1201159
Compare
The error was due to an "undefined reference to __aeabi_uldivmod" error in 32-bit arm architectures since we don't link the GCC lib. I don't fully understand why this intrinsic was being invoked for one of the divisions but not for the others. Anyway, I believe I fixed this by removing the use of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested console_printk
locally with some unit tests and it seems to been working properly.
Thanks! |
The quality of the previous printk implementation was less than desirable. This PR introduces a new improved, and more robust printk implementation that allows to print strings larger than the allocated print buffers and also adds the "format printf" attribute so that incorrect type identifiers in the format string are detected at compile-time.