]> xenbits.xensource.com Git - rumpuser-xen.git/commitdiff
Remove #define current get_current()
authorAntti Kantee <pooka@iki.fi>
Wed, 21 Jan 2015 10:59:35 +0000 (10:59 +0000)
committerAntti Kantee <pooka@iki.fi>
Wed, 21 Jan 2015 10:59:35 +0000 (10:59 +0000)
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.

xen/arch/x86/sched.c
xen/arch/x86/traps.c
xen/include/mini-os/sched.h
xen/sched.c

index 4fc48d3f6cca6c670218297f0a14352f969eb0f9..33003e6b7ace9312d3098b3a15565e6ea5277cea 100644 (file)
@@ -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"
index 2e83adc1bb8277bb155c514f9c10f55d48af5d26..279c97bc471e0793c712772f3e18d4c759f928e8 100644 (file)
@@ -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",
index 4436cc80ebfb4b859cbe0fe2d135a348624eec5f..bb132480544464aca148594d5f353bc492b15873 100644 (file)
@@ -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);
index ce59151420ae554985071669f73d669da0418a17..c93f286349e01c9723cee1cc845930cd51f792ac 100644 (file)
@@ -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);