-#define unwind_lock() mono_mutex_lock (&unwind_mutex)
-#define unwind_unlock() mono_mutex_unlock (&unwind_mutex)
+#define unwind_lock() mono_os_mutex_lock (&unwind_mutex)
+#define unwind_unlock() mono_os_mutex_unlock (&unwind_mutex)
#ifdef TARGET_AMD64
static int map_hw_reg_to_dwarf_reg [] = { 0, 2, 1, 3, 7, 6, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
#ifdef TARGET_AMD64
static int map_hw_reg_to_dwarf_reg [] = { 0, 2, 1, 3, 7, 6, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
#define DWARF_PC_REG (mono_hw_reg_to_dwarf_reg (AMD64_RIP))
#elif defined(TARGET_ARM)
// http://infocenter.arm.com/help/topic/com.arm.doc.ihi0040a/IHI0040A_aadwarf.pdf
#define DWARF_PC_REG (mono_hw_reg_to_dwarf_reg (AMD64_RIP))
#elif defined(TARGET_ARM)
// http://infocenter.arm.com/help/topic/com.arm.doc.ihi0040a/IHI0040A_aadwarf.pdf
static int map_hw_reg_to_dwarf_reg [] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 264, 265, 266, 267, 268, 269, 270, 271 };
#define NUM_REGS 272
#define DWARF_DATA_ALIGN (-4)
#define DWARF_PC_REG (mono_hw_reg_to_dwarf_reg (ARMREG_LR))
static int map_hw_reg_to_dwarf_reg [] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 264, 265, 266, 267, 268, 269, 270, 271 };
#define NUM_REGS 272
#define DWARF_DATA_ALIGN (-4)
#define DWARF_PC_REG (mono_hw_reg_to_dwarf_reg (ARMREG_LR))
*
* Encode the unwind ops in UNWIND_OPS into the compact DWARF encoding.
* Return a pointer to malloc'ed memory.
*
* Encode the unwind ops in UNWIND_OPS into the compact DWARF encoding.
* Return a pointer to malloc'ed memory.
/* Convert the register from the hw encoding to the dwarf encoding */
reg = mono_hw_reg_to_dwarf_reg (op->reg);
/* Convert the register from the hw encoding to the dwarf encoding */
reg = mono_hw_reg_to_dwarf_reg (op->reg);
void
mono_unwind_frame (guint8 *unwind_info, guint32 unwind_info_len,
guint8 *start_ip, guint8 *end_ip, guint8 *ip, guint8 **mark_locations,
void
mono_unwind_frame (guint8 *unwind_info, guint32 unwind_info_len,
guint8 *start_ip, guint8 *end_ip, guint8 *ip, guint8 **mark_locations,
if (reg_saved [i] && locations [i].loc_type == LOC_OFFSET) {
int hreg = mono_dwarf_reg_to_hw_reg (i);
g_assert (hreg < nregs);
if (reg_saved [i] && locations [i].loc_type == LOC_OFFSET) {
int hreg = mono_dwarf_reg_to_hw_reg (i);
g_assert (hreg < nregs);
if (save_locations && hreg < save_locations_len)
save_locations [hreg] = (mgreg_t*)(cfa_val + locations [i].offset);
}
if (save_locations && hreg < save_locations_len)
save_locations [hreg] = (mgreg_t*)(cfa_val + locations [i].offset);
}
mono_counters_register ("Unwind info size", MONO_COUNTER_JIT | MONO_COUNTER_INT, &unwind_info_size);
}
mono_counters_register ("Unwind info size", MONO_COUNTER_JIT | MONO_COUNTER_INT, &unwind_info_size);
}
info->len = unwind_info_len;
memcpy (&info->info, unwind_info, unwind_info_len);
info->len = unwind_info_len;
memcpy (&info->info, unwind_info, unwind_info_len);
for (i = 0; i < ncall_sites; ++i) {
int block_start_offset, block_size, landing_pad;
for (i = 0; i < ncall_sites; ++i) {
int block_start_offset, block_size, landing_pad;
g_assert (return_reg == DWARF_PC_REG);
buf_len = (cie + cie_len + 4 - cie_cfi) + (fde + fde_len + 4 - fde_cfi);
g_assert (return_reg == DWARF_PC_REG);
buf_len = (cie + cie_len + 4 - cie_cfi) + (fde + fde_len + 4 - fde_cfi);
memcpy (buf, cie_cfi, cie_cfi_len);
memcpy (buf + cie_cfi_len, fde_cfi, fde_cfi_len);
memcpy (buf, cie_cfi, cie_cfi_len);
memcpy (buf + cie_cfi_len, fde_cfi, fde_cfi_len);