nuttx/drivers/syslog
Justin Hammond 875e86bd35 syslog/ramlog: Survive writes made before the OS is ready.
The RAM log is the natural home for boot messages, yet writing to it
during early boot could crash the system it was meant to describe.
ramlog_addbuf took the critical section on every write, and
enter_critical_section consults the current task; on ports whose
first syslog output happens before the task lists exist, that lookup
walks uninitialized state and faults.  The notification path was
worse still, locking a scheduler that did not exist yet.

Guard both.  Before the task lists exist, plain interrupt masking
protects the buffer just as well, since there is only one thread of
control; and readers are only notified once there is an operating
system to notify them through.  The bytes land in the buffer either
way, so nothing logged before the OS is ready is lost.

Found on the EIC7700X port, which logs from its start routine before
the MMU is up: enabling RAMLOG_SYSLOG there turned the boot into a
silent wedge two characters in.  With this change the same
configuration boots and `dmesg` replays the full early history.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Justin Hammond <justin@dynam.ac>
2026-08-08 15:20:54 -03:00
..
CMakeLists.txt sched/syslog: Add early_syslog() for early boot or system down debugging 2025-10-31 08:29:17 -03:00
Kconfig drivers/syslog: add millisecond option for syslog timestamp formatting 2026-02-27 08:09:31 -03:00
Make.defs Documentation: Add description for early_syslog() 2025-10-31 08:29:17 -03:00
ramlog.c syslog/ramlog: Survive writes made before the OS is ready. 2026-08-08 15:20:54 -03:00
syslog.h syslog/inbuffer: refactor intbuffer to circbuf 2024-12-17 20:48:23 +08:00
syslog_channel.c drivers/syslog/syslog_channel.c: fix incompatible-pointer-types compile errors 2025-08-07 10:16:20 -03:00
syslog_chardev.c drivers/: Multiple Drivers Are Registered With World Writable - Part 2 2026-07-15 15:27:28 +08:00
syslog_console.c drivers/: Multiple Drivers Are Registered With World Writable - Part 2 2026-07-15 15:27:28 +08:00
syslog_consolechannel.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
syslog_devchannel.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
syslog_device.c style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
syslog_early.c sched/syslog: Add early_syslog() for early boot or system down debugging 2025-10-31 08:29:17 -03:00
syslog_filechannel.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
syslog_flush.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
syslog_initialize.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
syslog_intbuffer.c sched/spin_lock: rename raw_spin_lock to spin_lock_notrace 2025-02-13 20:48:15 +08:00
syslog_rpmsg.c drivers/: Multiple Drivers Are Registered With World Writable - Part 2 2026-07-15 15:27:28 +08:00
syslog_rpmsg.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
syslog_rpmsg_server.c drivers/: Multiple Drivers Are Registered With World Writable - Part 2 2026-07-15 15:27:28 +08:00
syslog_stream.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
syslog_write.c drivers/syslog: fix syslog_write() returning -EIO on every write 2026-07-29 07:57:29 +02:00
vsyslog.c !nuttx: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-19 16:21:28 +08:00
vsyslog_rfc5424.c drivers/syslog: Add RFC 5424 protocol support 2025-06-13 20:26:57 +08:00