2026-02-19 19:21:50 +00:00
|
|
|
#include <kernel/printk.h>
|
|
|
|
|
#include <kernel/sched.h>
|
2026-03-12 20:29:36 +00:00
|
|
|
#include <kernel/task.h>
|
2026-03-18 21:07:43 +00:00
|
|
|
#include <kernel/thread.h>
|
2026-02-19 19:21:50 +00:00
|
|
|
|
|
|
|
|
kern_status_t sys_kern_log(const char *s)
|
|
|
|
|
{
|
2026-03-29 11:51:05 +01:00
|
|
|
#ifdef TRACE
|
2026-04-01 18:17:05 +01:00
|
|
|
struct task *task = get_current_task();
|
|
|
|
|
struct thread *thread = get_current_thread();
|
2026-03-18 21:07:43 +00:00
|
|
|
printk("%s[%d.%d]: %s", task->t_name, task->t_id, thread->tr_id, s);
|
2026-04-01 18:17:05 +01:00
|
|
|
put_current_thread(thread);
|
|
|
|
|
put_current_task(task);
|
2026-03-29 11:51:05 +01:00
|
|
|
#else
|
|
|
|
|
printk("%s", s);
|
|
|
|
|
#endif
|
2026-02-19 19:21:50 +00:00
|
|
|
return KERN_OK;
|
|
|
|
|
}
|