From 3acf7c2c759a40dc0bc88f9c5ae5ed208b77e2a4 Mon Sep 17 00:00:00 2001 From: hunt Date: Wed, 15 Jun 2005 23:55:55 +0000 Subject: [PATCH] 2005-06-15 Martin Hunt * current.c (_stp_ret_addr): Fix computation for i386. --- runtime/ChangeLog | 4 ++++ runtime/current.c | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/runtime/ChangeLog b/runtime/ChangeLog index e00e43f0d..b40ae6669 100644 --- a/runtime/ChangeLog +++ b/runtime/ChangeLog @@ -1,3 +1,7 @@ +2005-06-15 Martin Hunt + + * current.c (_stp_ret_addr): Fix computation for i386. + 2005-06-14 Martin Hunt * README: Removed old docs and replaced with simple build diff --git a/runtime/current.c b/runtime/current.c index 4485ef2c5..82ab400eb 100644 --- a/runtime/current.c +++ b/runtime/current.c @@ -21,12 +21,17 @@ unsigned long _stp_ret_addr (struct pt_regs *regs) { - unsigned long *ra = (unsigned long *)REG_SP(regs); - +#ifdef __x86_64__ + unsigned long *ra = (unsigned long *)regs->rsp; if (ra) return *ra; else return 0; +#elif defined (__i386__) + return regs->esp; +#else + #error Unimplemented architecture +#endif } #ifdef __x86_64__ -- 2.43.5