diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2011-11-21 13:42:00 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2011-11-23 09:19:26 -0800 |
commit | 033aebd8e5b6db8aeaec9cf797dd13b534ec02b3 (patch) | |
tree | 3e1dd8cbfa554f896f7d4abca142b7e76f64dad5 /sysdeps | |
parent | a6b7e16187260cc1176c500866e5192feefbfce3 (diff) | |
download | glibc-033aebd8e5b6db8aeaec9cf797dd13b534ec02b3.tar.gz glibc-033aebd8e5b6db8aeaec9cf797dd13b534ec02b3.tar.xz glibc-033aebd8e5b6db8aeaec9cf797dd13b534ec02b3.zip |
Use "unsigned long long int" in __makecontext.
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/unix/sysv/linux/x86_64/makecontext.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/sysdeps/unix/sysv/linux/x86_64/makecontext.c b/sysdeps/unix/sysv/linux/x86_64/makecontext.c index 615dede522..477d22efa4 100644 --- a/sysdeps/unix/sysv/linux/x86_64/makecontext.c +++ b/sysdeps/unix/sysv/linux/x86_64/makecontext.c @@ -53,25 +53,26 @@ void __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...) { extern void __start_context (void); - unsigned long int *sp, idx_uc_link; + unsigned long long int *sp; + unsigned int idx_uc_link; va_list ap; int i; /* Generate room on stack for parameter if needed and uc_link. */ - sp = (unsigned long int *) ((uintptr_t) ucp->uc_stack.ss_sp - + ucp->uc_stack.ss_size); + sp = (unsigned long long int *) ((uintptr_t) ucp->uc_stack.ss_sp + + ucp->uc_stack.ss_size); sp -= (argc > 6 ? argc - 6 : 0) + 1; /* Align stack and make space for trampoline address. */ - sp = (unsigned long int *) ((((uintptr_t) sp) & -16L) - 8); + sp = (unsigned long long int *) ((((uintptr_t) sp) & -16L) - 8); idx_uc_link = (argc > 6 ? argc - 6 : 0) + 1; /* Setup context ucp. */ /* Address to jump to. */ - ucp->uc_mcontext.gregs[REG_RIP] = (long int) func; + ucp->uc_mcontext.gregs[REG_RIP] = (unsigned long int) func; /* Setup rbx.*/ - ucp->uc_mcontext.gregs[REG_RBX] = (long int) &sp[idx_uc_link]; - ucp->uc_mcontext.gregs[REG_RSP] = (long int) sp; + ucp->uc_mcontext.gregs[REG_RBX] = (unsigned long int) &sp[idx_uc_link]; + ucp->uc_mcontext.gregs[REG_RSP] = (unsigned long int) sp; /* Setup stack. */ sp[0] = (unsigned long int) &__start_context; @@ -91,26 +92,26 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...) switch (i) { case 0: - ucp->uc_mcontext.gregs[REG_RDI] = va_arg (ap, long int); + ucp->uc_mcontext.gregs[REG_RDI] = va_arg (ap, long long int); break; case 1: - ucp->uc_mcontext.gregs[REG_RSI] = va_arg (ap, long int); + ucp->uc_mcontext.gregs[REG_RSI] = va_arg (ap, long long int); break; case 2: - ucp->uc_mcontext.gregs[REG_RDX] = va_arg (ap, long int); + ucp->uc_mcontext.gregs[REG_RDX] = va_arg (ap, long long int); break; case 3: - ucp->uc_mcontext.gregs[REG_RCX] = va_arg (ap, long int); + ucp->uc_mcontext.gregs[REG_RCX] = va_arg (ap, long long int); break; case 4: - ucp->uc_mcontext.gregs[REG_R8] = va_arg (ap, long int); + ucp->uc_mcontext.gregs[REG_R8] = va_arg (ap, long long int); break; case 5: - ucp->uc_mcontext.gregs[REG_R9] = va_arg (ap, long int); + ucp->uc_mcontext.gregs[REG_R9] = va_arg (ap, long long int); break; default: /* Put value on stack. */ - sp[i - 5] = va_arg (ap, unsigned long int); + sp[i - 5] = va_arg (ap, unsigned long long int); break; } va_end (ap); |