1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-06-27 20:01:45 +02:00

(setcontext): Declare.

2004/12/02 00:40:45-08:00 mostang.com!davidm
Delete accessor macros which have been replaced by their DWARF
equivalent.

(Logical change 1.290)
This commit is contained in:
hp.com!davidm 2005-05-03 09:13:17 +00:00
parent 16af7ae96e
commit 7e0192f53a

View file

@ -1,6 +1,6 @@
/* libunwind - a platform-independent unwind library
Copyright (C) 2003 Hewlett-Packard Co
Contributed by ...
Copyright (C) 2004 Hewlett-Packard Co
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
This file is part of libunwind.
@ -34,119 +34,16 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include "internal.h"
#include "tdep.h"
#define HPPA_GET_LOC(l) ((l).val)
#ifdef UNW_LOCAL_ONLY
# define HPPA_LOC(r, t) ((struct hppa_loc) { .val = (r) })
# define HPPA_REG_LOC(c,r) (HPPA_LOC((unw_word_t) \
tdep_uc_addr((c)->as_arg, (r)), 0))
# define HPPA_FPREG_FLOC(c,r) (HPPA_LOC((unw_word_t) \
tdep_uc_addr((c)->as_arg, (r)), 0))
static inline int
hppa_getfp (struct cursor *c, struct hppa_loc loc, unw_fpreg_t *val)
{
if (!HPPA_GET_LOC (loc))
return -1;
*val = *(unw_fpreg_t *) HPPA_GET_LOC (loc);
return 0;
}
static inline int
hppa_putfp (struct cursor *c, struct hppa_loc loc, unw_fpreg_t *val)
{
if (!HPPA_GET_LOC (loc))
return -1;
*(unw_fpreg_t *) HPPA_GET_LOC (loc) = *val;
return 0;
}
static inline int
hppa_get (struct cursor *c, struct hppa_loc loc, unw_word_t *val)
{
if (!HPPA_GET_LOC (loc))
return -1;
*val = *(unw_word_t *) HPPA_GET_LOC (loc);
return 0;
}
static inline int
hppa_put (struct cursor *c, struct hppa_loc loc, unw_word_t val)
{
if (!HPPA_GET_LOC (loc))
return -1;
*(unw_word_t *) HPPA_GET_LOC (loc) = val;
return 0;
}
#else /* !UNW_LOCAL_ONLY */
# define HPPA_LOC_TYPE_FP (1 << 0)
# define HPPA_LOC_TYPE_REG (1 << 1)
# define HPPA_LOC(r, t) ((struct hppa_loc) { .val = (r), .type = (t) })
# define HPPA_IS_REG_LOC(l) (((l).type & HPPA_LOC_TYPE_REG) != 0)
# define HPPA_IS_FP_LOC(l) (((l).type & HPPA_LOC_TYPE_FP) != 0)
# define HPPA_REG_LOC(c,r) HPPA_LOC((r), HPPA_LOC_TYPE_REG)
# define HPPA_FPREG_LOC(c,r) HPPA_LOC((r), (HPPA_LOC_TYPE_REG \
| HPPA_LOC_TYPE_FP))
static inline int
hppa_getfp (struct cursor *c, struct hppa_loc loc, unw_fpreg_t *val)
{
abort ();
}
static inline int
hppa_putfp (struct cursor *c, struct hppa_loc loc, unw_fpreg_t val)
{
abort ();
}
static inline int
hppa_get (struct cursor *c, struct hppa_loc loc, unw_word_t *val)
{
if (HPPA_IS_FP_LOC (loc))
abort ();
if (HPPA_IS_REG_LOC (loc))
return (*c->as->acc.access_reg)(c->as, HPPA_GET_LOC (loc), val, 0,
c->as_arg);
else
return (*c->as->acc.access_mem)(c->as, HPPA_GET_LOC (loc), val, 0,
c->as_arg);
}
static inline int
hppa_put (struct cursor *c, struct hppa_loc loc, unw_word_t val)
{
if (HPPA_IS_FP_LOC (loc))
abort ();
if (HPPA_IS_REG_LOC (loc))
return (*c->as->acc.access_reg)(c->as, HPPA_GET_LOC (loc), &val, 1,
c->as_arg);
else
return (*c->as->acc.access_mem)(c->as, HPPA_GET_LOC (loc), &val, 1,
c->as_arg);
}
#endif /* !UNW_LOCAL_ONLY */
#define hppa_needs_initialization UNW_ARCH_OBJ(needs_initialization)
#define hppa_init UNW_ARCH_OBJ(init)
#define hppa_access_reg UNW_OBJ(access_reg)
#define hppa_access_fpreg UNW_OBJ(access_fpreg)
#define hppa_lock UNW_OBJ(lock)
#define hppa_local_resume UNW_OBJ(local_resume)
#define hppa_local_addr_space_init UNW_OBJ(local_addr_space_init)
#define hppa_scratch_loc UNW_OBJ(scratch_loc)
#define setcontext UNW_ARCH_OBJ (setcontext)
extern int hppa_needs_initialization;
extern void hppa_init (void);
extern int hppa_access_reg (struct cursor *c, unw_regnum_t reg,
unw_word_t *valp, int write);
extern int hppa_access_fpreg (struct cursor *c, unw_regnum_t reg,
unw_fpreg_t *valp, int write);
extern void hppa_local_addr_space_init (void);
extern int hppa_local_resume (unw_addr_space_t as, unw_cursor_t *cursor,
void *arg);
extern dwarf_loc_t hppa_scratch_loc (struct cursor *c, unw_regnum_t reg);
extern int setcontext (const ucontext_t *ucp);
#endif /* unwind_i_h */