diff options
author | Karel Gardas <karel.gardas@centrum.cz> | 2011-07-05 20:12:14 +0200 |
---|---|---|
committer | Manuel M T Chakravarty <chak@cse.unsw.edu.au> | 2011-08-10 22:03:41 +1000 |
commit | 226541c418258e486399a6ebe3814bdac99af461 (patch) | |
tree | 0403ac3bbc011cd7e2f8ebaf703311dc1421d743 /rts/StgCRun.c | |
parent | 330dff34ddc45eb0adc8d098a55f491cce0ea108 (diff) | |
download | haskell-226541c418258e486399a6ebe3814bdac99af461.tar.gz |
make StgReturn and cas functions Thumb friendly
Diffstat (limited to 'rts/StgCRun.c')
-rw-r--r-- | rts/StgCRun.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/rts/StgCRun.c b/rts/StgCRun.c index 9e976ef660..6182775427 100644 --- a/rts/StgCRun.c +++ b/rts/StgCRun.c @@ -1,6 +1,6 @@ /* ----------------------------------------------------------------------------- * - * (c) The GHC Team, 1998-2003 + * (c) The GHC Team, 1998-2011 * * STG-to-C glue. * @@ -982,6 +982,13 @@ StgRun(StgFunPtr f, StgRegTable *basereg) -------------------------------------------------------------------------- */ #ifdef arm_HOST_ARCH + +#if defined(__thumb__) +#define THUMB_FUNC ".thumb\n\t.thumb_func\n\t" +#else +#define THUMB_FUNC +#endif + StgRegTable * StgRun(StgFunPtr f, StgRegTable *basereg) { StgRegTable * r; @@ -1003,9 +1010,11 @@ StgRun(StgFunPtr f, StgRegTable *basereg) { /* * Jump to function argument. */ - "mov pc, %1\n\t" + "bx %1\n\t" - ".global " STG_RETURN "\n" + ".global " STG_RETURN "\n\t" + THUMB_FUNC + ".type " STG_RETURN ", %%function\n" STG_RETURN ":\n\t" /* * Free the space we allocated |