diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-01-17 14:41:44 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-01-17 14:41:44 +0000 |
commit | 22e39d084eaa3b058ec34964156511fe963ce4d4 (patch) | |
tree | 0566e56ab0131abd998692127a2deea8d845a17d /extras/mini-os/arch/x86/sched.c | |
parent | e2edfe6c73a287989911630a070c3e6c1137446f (diff) | |
download | xen-22e39d084eaa3b058ec34964156511fe963ce4d4.tar.gz xen-22e39d084eaa3b058ec34964156511fe963ce4d4.tar.bz2 xen-22e39d084eaa3b058ec34964156511fe963ce4d4.zip |
minios: make stack size configurable
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
Diffstat (limited to 'extras/mini-os/arch/x86/sched.c')
-rw-r--r-- | extras/mini-os/arch/x86/sched.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/extras/mini-os/arch/x86/sched.c b/extras/mini-os/arch/x86/sched.c index 204980a564..9b98b93a55 100644 --- a/extras/mini-os/arch/x86/sched.c +++ b/extras/mini-os/arch/x86/sched.c @@ -57,7 +57,7 @@ void dump_stack(struct thread *thread) { - unsigned long *bottom = (unsigned long *)(thread->stack + 2*4*1024); + unsigned long *bottom = (unsigned long *)(thread->stack + STACK_SIZE); unsigned long *pointer = (unsigned long *)thread->sp; int count; if(thread == current) @@ -98,13 +98,13 @@ struct thread* arch_create_thread(char *name, void (*function)(void *), struct thread *thread; thread = xmalloc(struct thread); - /* Allocate 2 pages for stack, stack will be 2pages aligned */ - thread->stack = (char *)alloc_pages(1); + /* We can't use lazy allocation here since the trap handler runs on the stack */ + thread->stack = (char *)alloc_pages(STACK_SIZE_PAGE_ORDER); thread->name = name; printk("Thread \"%s\": pointer: 0x%lx, stack: 0x%lx\n", name, thread, thread->stack); - thread->sp = (unsigned long)thread->stack + 4096 * 2; + thread->sp = (unsigned long)thread->stack + STACK_SIZE; /* Save pointer to the thread on the stack, used by current macro */ *((unsigned long *)thread->stack) = (unsigned long)thread; |