summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-03-16 14:59:49 -0700
committerH.J. Lu <hjl.tools@gmail.com>2012-05-27 07:30:57 -0700
commit0659b797a0b9fde858f5ca529cbe0c3ef895bcd0 (patch)
tree4b2f58f5d58024d6f025932fb860a6835b8c9d72
parentf3a7e42fbdb04518f0544f21e517ead3ae24bdea (diff)
downloadglibc-0659b797a0b9fde858f5ca529cbe0c3ef895bcd0.tar.gz
Use greg_t instead of long long int in __makecontext
2012-03-16 H.J. Lu <hongjiu.lu@intel.com> * sysdeps/unix/sysv/linux/x86_64/makecontext.c (__makecontext): Use greg_t instead of unsigned long long int and long long int.
-rw-r--r--ChangeLog.x325
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/makecontext.c32
2 files changed, 21 insertions, 16 deletions
diff --git a/ChangeLog.x32 b/ChangeLog.x32
index be2d55008c..e165d43f24 100644
--- a/ChangeLog.x32
+++ b/ChangeLog.x32
@@ -1,5 +1,10 @@
2012-03-16 H.J. Lu <hongjiu.lu@intel.com>
+ * sysdeps/unix/sysv/linux/x86_64/makecontext.c (__makecontext):
+ Use greg_t instead of unsigned long long int and long long int.
+
+2012-03-16 H.J. Lu <hongjiu.lu@intel.com>
+
* sysdeps/unix/sysv/linux/x86_64/sysdep.h
(VSYSCALL_ADDR_vgettimeofday): Removed.
(VSYSCALL_ADDR_vtime): Likewise.
diff --git a/sysdeps/unix/sysv/linux/x86_64/makecontext.c b/sysdeps/unix/sysv/linux/x86_64/makecontext.c
index 477d22efa4..9ae9528a80 100644
--- a/sysdeps/unix/sysv/linux/x86_64/makecontext.c
+++ b/sysdeps/unix/sysv/linux/x86_64/makecontext.c
@@ -53,30 +53,30 @@ void
__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
{
extern void __start_context (void);
- unsigned long long int *sp;
+ greg_t *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 long int *) ((uintptr_t) ucp->uc_stack.ss_sp
- + ucp->uc_stack.ss_size);
+ sp = (greg_t *) ((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 long int *) ((((uintptr_t) sp) & -16L) - 8);
+ sp = (greg_t *) ((((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] = (unsigned long int) func;
+ ucp->uc_mcontext.gregs[REG_RIP] = (uintptr_t) func;
/* Setup rbx.*/
- ucp->uc_mcontext.gregs[REG_RBX] = (unsigned long int) &sp[idx_uc_link];
- ucp->uc_mcontext.gregs[REG_RSP] = (unsigned long int) sp;
+ ucp->uc_mcontext.gregs[REG_RBX] = (uintptr_t) &sp[idx_uc_link];
+ ucp->uc_mcontext.gregs[REG_RSP] = (uintptr_t) sp;
/* Setup stack. */
- sp[0] = (unsigned long int) &__start_context;
- sp[idx_uc_link] = (unsigned long int) ucp->uc_link;
+ sp[0] = (uintptr_t) &__start_context;
+ sp[idx_uc_link] = (uintptr_t) ucp->uc_link;
va_start (ap, argc);
/* Handle arguments.
@@ -92,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 long int);
+ ucp->uc_mcontext.gregs[REG_RDI] = va_arg (ap, greg_t);
break;
case 1:
- ucp->uc_mcontext.gregs[REG_RSI] = va_arg (ap, long long int);
+ ucp->uc_mcontext.gregs[REG_RSI] = va_arg (ap, greg_t);
break;
case 2:
- ucp->uc_mcontext.gregs[REG_RDX] = va_arg (ap, long long int);
+ ucp->uc_mcontext.gregs[REG_RDX] = va_arg (ap, greg_t);
break;
case 3:
- ucp->uc_mcontext.gregs[REG_RCX] = va_arg (ap, long long int);
+ ucp->uc_mcontext.gregs[REG_RCX] = va_arg (ap, greg_t);
break;
case 4:
- ucp->uc_mcontext.gregs[REG_R8] = va_arg (ap, long long int);
+ ucp->uc_mcontext.gregs[REG_R8] = va_arg (ap, greg_t);
break;
case 5:
- ucp->uc_mcontext.gregs[REG_R9] = va_arg (ap, long long int);
+ ucp->uc_mcontext.gregs[REG_R9] = va_arg (ap, greg_t);
break;
default:
/* Put value on stack. */
- sp[i - 5] = va_arg (ap, unsigned long long int);
+ sp[i - 5] = va_arg (ap, greg_t);
break;
}
va_end (ap);