summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libc/amd64/gen/makecontext.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libc/amd64/gen/makecontext.c b/lib/libc/amd64/gen/makecontext.c
index 87cf7bf..74eb68a 100644
--- a/lib/libc/amd64/gen/makecontext.c
+++ b/lib/libc/amd64/gen/makecontext.c
@@ -70,8 +70,12 @@ __makecontext(ucontext_t *ucp, void (*start)(void), int argc, ...)
/* Allocate space for a maximum of 6 arguments on the stack. */
args = sp - 6;
- /* Account for arguments on stack and align to 16 bytes. */
- sp -= 8;
+ /*
+ * Account for arguments on stack and do the funky C entry alignment.
+ * This means that we need an 8-byte-odd alignment since the ABI expects
+ * the return address to be pushed, thus breaking the 16 byte alignment.
+ */
+ sp -= 7;
/* Add the arguments: */
va_start(ap, argc);
OpenPOWER on IntegriCloud