From 74bbb26b51aa035b8ae49797fdfaee345637fce9 Mon Sep 17 00:00:00 2001 From: David Xu Date: Fri, 25 Jul 2003 00:21:37 +0000 Subject: [PATCH] Align upcall stack top to odd times of 8. GCC accounts return address in callee function for stack alignment. --- sys/amd64/amd64/vm_machdep.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index 21dc35efc3d..9bceed72bdf 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -292,6 +292,7 @@ cpu_set_upcall_kse(struct thread *td, struct kse_upcall *ku) */ td->td_frame->tf_rsp = ((register_t)ku->ku_stack.ss_sp + ku->ku_stack.ss_size) & ~0x0f; + td->td_frame->tf_rsp -= 8; td->td_frame->tf_rip = (register_t)ku->ku_func; /*