From 5f2f2495edc505d9eeb92ab3df2387eb9ea537c2 Mon Sep 17 00:00:00 2001 From: Antti Kantee Date: Mon, 20 Apr 2015 14:06:32 +0000 Subject: [PATCH] Provide bmk_sched_threadname() in both schedulers --- include/bmk-core/sched.h | 1 + platform/baremetal/sched.c | 7 +++++++ platform/xen/xen/arch/x86/traps.c | 2 +- platform/xen/xen/include/mini-os/sched.h | 2 -- platform/xen/xen/sched.c | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/bmk-core/sched.h b/include/bmk-core/sched.h index a900e1f..e58b707 100644 --- a/include/bmk-core/sched.h +++ b/include/bmk-core/sched.h @@ -71,6 +71,7 @@ struct bmk_thread *bmk_sched_init_mainlwp(void *); struct bmk_thread *bmk_sched_current(void); int *bmk_sched_geterrno(void); +const char *bmk_sched_threadname(struct bmk_thread *); bmk_time_t bmk_clock_monotonic(void); bmk_time_t bmk_clock_epochoffset(void); diff --git a/platform/baremetal/sched.c b/platform/baremetal/sched.c index ee53121..c905adf 100644 --- a/platform/baremetal/sched.c +++ b/platform/baremetal/sched.c @@ -472,6 +472,13 @@ bmk_sched_init_mainlwp(void *cookie) return current; } +const char * +bmk_sched_threadname(struct bmk_thread *thread) +{ + + return thread->bt_name; +} + int * bmk_sched_geterrno(void) { diff --git a/platform/xen/xen/arch/x86/traps.c b/platform/xen/xen/arch/x86/traps.c index 02b7aba..83cc1cc 100644 --- a/platform/xen/xen/arch/x86/traps.c +++ b/platform/xen/xen/arch/x86/traps.c @@ -35,7 +35,7 @@ void _minios_entry_machine_check(void); void dump_regs(struct pt_regs *regs) { - minios_printk("Thread: %s\n", minios_threadname(bmk_sched_current())); + minios_printk("Thread: %s\n", bmk_sched_threadname(bmk_sched_current())); #ifdef __i386__ minios_printk("EIP: %x, EFLAGS %x.\n", regs->eip, regs->eflags); minios_printk("EBX: %08x ECX: %08x EDX: %08x\n", diff --git a/platform/xen/xen/include/mini-os/sched.h b/platform/xen/xen/include/mini-os/sched.h index 3441a63..529de20 100644 --- a/platform/xen/xen/include/mini-os/sched.h +++ b/platform/xen/xen/include/mini-os/sched.h @@ -16,6 +16,4 @@ void arch_create_thread(void *thread, struct bmk_tcb *, void (*function)(void *), void *data, void *stack_base, unsigned long stack_size); -const char * minios_threadname(struct bmk_thread *thread); - #endif /* __MINIOS_SCHED_H__ */ diff --git a/platform/xen/xen/sched.c b/platform/xen/xen/sched.c index ecd0346..5becf2a 100644 --- a/platform/xen/xen/sched.c +++ b/platform/xen/xen/sched.c @@ -492,7 +492,7 @@ bmk_sched_init_mainlwp(void *cookie) } const char * -minios_threadname(struct bmk_thread *thread) +bmk_sched_threadname(struct bmk_thread *thread) { return thread->bt_name; -- 2.39.5