From: Antti Kantee Date: Mon, 20 Apr 2015 20:50:29 +0000 (+0000) Subject: use core for cpu-specific bits of thread creation X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=6093d278c0556b4a74f55682366085f482786644;p=people%2Fliuw%2Frumprun.git use core for cpu-specific bits of thread creation --- diff --git a/platform/xen/xen/arch/x86/sched.c b/platform/xen/xen/arch/x86/sched.c index e1a1afc..c9c6724 100644 --- a/platform/xen/xen/arch/x86/sched.c +++ b/platform/xen/xen/arch/x86/sched.c @@ -78,28 +78,6 @@ void dump_stack(struct thread *thread_md) defined in x86_[32/64].S */ extern void _minios_entry_thread_starter(void); -/* Pushes the specified value onto the stack of the specified thread */ -static void stack_push(struct bmk_tcb *tcb, unsigned long value) -{ - tcb->btcb_sp -= sizeof(unsigned long); - *((unsigned long *)tcb->btcb_sp) = value; -} - -/* Architecture specific setup of thread creation */ -void arch_create_thread(void *thread, struct bmk_tcb *tcb, - void (*function)(void *), void *data, - void *stack, unsigned long stack_size) -{ - - tcb->btcb_sp = (unsigned long)stack + stack_size; - /* Save pointer to the thread on the stack, used by current macro */ - *((unsigned long *)stack) = (unsigned long)thread; - - stack_push(tcb, (unsigned long) function); - stack_push(tcb, (unsigned long) data); - tcb->btcb_ip = (unsigned long) bmk_cpu_sched_bouncer; -} - void run_idle_thread(void) { /* Switch stacks and run the thread */ diff --git a/platform/xen/xen/include/mini-os/sched.h b/platform/xen/xen/include/mini-os/sched.h index 529de20..773b258 100644 --- a/platform/xen/xen/include/mini-os/sched.h +++ b/platform/xen/xen/include/mini-os/sched.h @@ -12,8 +12,4 @@ void idle_thread_fn(void *unused); void run_idle_thread(void); -void arch_create_thread(void *thread, struct bmk_tcb *, - void (*function)(void *), void *data, - void *stack_base, unsigned long stack_size); - #endif /* __MINIOS_SCHED_H__ */ diff --git a/platform/xen/xen/sched.c b/platform/xen/xen/sched.c index e19e0cf..007a116 100644 --- a/platform/xen/xen/sched.c +++ b/platform/xen/xen/sched.c @@ -317,7 +317,7 @@ bmk_sched_create(const char *name, void *cookie, int joinable, if (joinable) thread->bt_flags |= THREAD_MUSTJOIN; - arch_create_thread(thread, &thread->bt_tcb, f, data, + bmk_cpu_sched_create(thread, &thread->bt_tcb, f, data, stack_base, stack_size); thread->bt_cookie = cookie;