From: Antti Kantee Date: Wed, 21 Jan 2015 10:59:35 +0000 (+0000) Subject: Remove #define current get_current() X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=27272886138e8875cdb3a42067f0ea895eaad883;p=rumpuser-xen.git Remove #define current get_current() The name "current" is used in other contexts in the tree, and is just a timebomb waiting for someone to include sched.h in the wrong place. --- diff --git a/xen/arch/x86/sched.c b/xen/arch/x86/sched.c index 4fc48d3..33003e6 100644 --- a/xen/arch/x86/sched.c +++ b/xen/arch/x86/sched.c @@ -50,7 +50,7 @@ void dump_stack(struct thread *thread) unsigned long *bottom = (unsigned long *)(thread->stack + STACK_SIZE); unsigned long *pointer = (unsigned long *)thread->thr_sp; int count; - if(thread == current) + if(thread == get_current()) { #ifdef __i386__ asm("movl %%esp,%0" diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 2e83adc..279c97b 100644 --- a/xen/arch/x86/traps.c +++ b/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", current->name); + minios_printk("Thread: %s\n", get_current()->name); #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/xen/include/mini-os/sched.h b/xen/include/mini-os/sched.h index 4436cc8..bb13248 100644 --- a/xen/include/mini-os/sched.h +++ b/xen/include/mini-os/sched.h @@ -48,8 +48,6 @@ void minios_set_sched_hook(void (*hook)(void *, void *)); struct thread *minios_init_mainlwp(void *cookie); void minios_schedule(void); -#define current get_current() - void minios_wake(struct thread *thread); void minios_block(struct thread *thread); int minios_msleep(uint64_t millisecs); diff --git a/xen/sched.c b/xen/sched.c index ce59151..c93f286 100644 --- a/xen/sched.c +++ b/xen/sched.c @@ -81,7 +81,7 @@ void minios_schedule(void) struct thread *prev, *next, *thread, *tmp; unsigned long flags; - prev = current; + prev = get_current(); local_irq_save(flags); if (_minios_in_hypervisor_callback) { @@ -210,7 +210,7 @@ static TAILQ_HEAD(, join_waiter) joinwq = TAILQ_HEAD_INITIALIZER(joinwq); void minios_exit_thread(void) { unsigned long flags; - struct thread *thread = current; + struct thread *thread = get_current(); struct join_waiter *jw_iter; /* if joinable, gate until we are allowed to exit */ @@ -331,7 +331,7 @@ void idle_thread_fn(void *unused) { threads_started = 1; while (1) { - minios_block(current); + minios_block(get_current()); minios_schedule(); } } @@ -351,6 +351,7 @@ void minios_set_sched_hook(void (*f)(void *, void *)) struct thread *minios_init_mainlwp(void *cookie) { + struct thread *current = get_current(); current->cookie = cookie; allocothertls(current);