~ubuntu-branches/ubuntu/utopic/libunwind/utopic-proposed

« back to all changes in this revision

Viewing changes to src/setjmp.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthieu Delahaye
  • Date: 2005-04-22 11:12:14 UTC
  • mto: (4.1.1 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20050422111214-0m74olipxly1ra8a
Tags: upstream-0.98.5
ImportĀ upstreamĀ versionĀ 0.98.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* libunwind - a platform-independent unwind library
2
 
   Copyright (C) 2003 Hewlett-Packard Co
 
2
   Copyright (C) 2003-2004 Hewlett-Packard Co
3
3
        Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
4
4
 
5
5
This file is part of libunwind.
26
26
#include <libunwind.h>
27
27
#include <setjmp.h>
28
28
 
 
29
#include "jmpbuf.h"
 
30
 
29
31
/* Why use K&R syntax here?  setjmp() is often a macro and that
30
32
   expands into a call to, say, __setjmp() and we need to define the
31
33
   libunwind-version of setjmp() with the name of the actual function.
39
41
{
40
42
  void **wp = (void **) env;
41
43
 
42
 
#if UNW_TARGET_IA64
43
 
  wp[0] = __builtin_dwarf_cfa () - 16;
44
 
  wp[1] = __builtin_ia64_bsp ();
45
 
#else
46
44
  /* this should work on most platforms, but may not be
47
45
     performance-optimal; check the code! */
48
 
  wp[0] = __builtin_frame_address (0);
49
 
  wp[1] = (void *) (uintptr_t) 0;
50
 
#endif
 
46
  wp[JB_SP] = __builtin_frame_address (0);
 
47
  wp[JB_RP] = (void *) __builtin_return_address (0);
51
48
  return 0;
52
49
}