#include <pthread.h>
#include <signal.h>
#include <stdlib.h>
#include <stdatomic.h>
#include "libunwind_i.h"
#include "compiler.h"
unw_addr_space_t UNW_OBJ(local_addr_space);
unw_accessors_t *
unw_get_accessors (unw_addr_space_t as)
{
if (!atomic_load(&tdep_init_done))
tdep_init ();
return &as->acc;
}
unw_accessors_t *
unw_get_accessors_int (unw_addr_space_t as)
{
return unw_get_accessors(as);
}
#if defined(TARGET_AMD64) && !defined(HOST_AMD64)
#define X86_64_SCF_NONE 0
#endif
#if defined(TARGET_ARM64) && !defined(HOST_ARM64)
#define AARCH64_SCF_NONE 0
#endif
int
unw_is_signal_frame (unw_cursor_t *cursor)
{
struct cursor *c = (struct cursor *) cursor;
#ifdef TARGET_AMD64
return c->sigcontext_format != X86_64_SCF_NONE;
#elif defined(TARGET_ARM64)
return c->sigcontext_format != AARCH64_SCF_NONE;
#else
#error Unexpected target
#endif
}
int
UNW_OBJ(handle_signal_frame) (unw_cursor_t *cursor)
{
return -UNW_EBADFRAME;
}
int
UNW_OBJ(os_step) (struct cursor *c)
{
return 0;
}