From 10b3bd530b2b085894118a8bf0f6785b8b62d3ae Mon Sep 17 00:00:00 2001 From: marcel Date: Sun, 1 Jun 2003 08:29:43 +0000 Subject: Implement cpu_thread_setup(). This is mostly the same as on i386, except for the fact that trapframes have a size recorded in it that we set here too. We need this for proper thread setup. Pointed out by: mtm --- sys/ia64/ia64/vm_machdep.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sys/ia64') diff --git a/sys/ia64/ia64/vm_machdep.c b/sys/ia64/ia64/vm_machdep.c index 2822764..960cb39 100644 --- a/sys/ia64/ia64/vm_machdep.c +++ b/sys/ia64/ia64/vm_machdep.c @@ -109,6 +109,14 @@ cpu_thread_clean(struct thread *td) void cpu_thread_setup(struct thread *td) { + intptr_t sp; + + sp = td->td_kstack + KSTACK_PAGES * PAGE_SIZE; + sp -= sizeof(struct pcb); + td->td_pcb = (struct pcb *)sp; + sp -= sizeof(struct trapframe); + td->td_frame = (struct trapframe *)sp; + td->td_frame->tf_length = sizeof(struct trapframe); } void -- cgit v1.1