*/
static __always_inline unsigned long dwarf_read_arch_reg(unsigned int reg)
{
- unsigned long value;
+ unsigned long value = 0;
switch (reg) {
case 14:
unsigned long flags;
#define DWARF_CIE_Z_AUGMENTATION (1 << 0)
+
+ /*
+ * 'mod' will be non-NULL if this CIE came from a module's
+ * .eh_frame section.
+ */
+ struct module *mod;
};
/**
unsigned char *instructions;
unsigned char *end;
struct list_head link;
+
+ /*
+ * 'mod' will be non-NULL if this FDE came from a module's
+ * .eh_frame section.
+ */
+ struct module *mod;
};
/**
unsigned long pc;
- struct dwarf_reg *regs;
- unsigned int num_regs; /* how many regs are allocated? */
-
- unsigned int depth; /* what level are we in the callstack? */
+ struct list_head reg_list;
unsigned long cfa;
* @flags: Describes how to calculate the value of this register
*/
struct dwarf_reg {
+ struct list_head link;
+
+ unsigned int number;
+
unsigned long addr;
unsigned long flags;
#define DWARF_REG_OFFSET (1 << 0)
-};
-
-/**
- * dwarf_stack - a DWARF stack contains a collection of DWARF frames
- * @depth: the number of frames in the stack
- * @level: an array of DWARF frames, indexed by stack level
- *
- */
-struct dwarf_stack {
- unsigned int depth;
- struct dwarf_frame **level;
+#define DWARF_VAL_OFFSET (1 << 1)
+#define DWARF_UNDEFINED (1 << 2)
};
/*
#define DW_CFA_lo_user 0x1c
#define DW_CFA_hi_user 0x3f
+/* GNU extension opcodes */
+#define DW_CFA_GNU_args_size 0x2e
+#define DW_CFA_GNU_negative_offset_extended 0x2f
+
/*
* Some call frame instructions encode their operands in the opcode. We
* need some helper functions to extract both the opcode and operands
#define DW_EXT_HI 0xffffffff
#define DW_EXT_DWARF64 DW_EXT_HI
-extern void dwarf_unwinder_init(void);
-
extern struct dwarf_frame *dwarf_unwind_stack(unsigned long,
struct dwarf_frame *);
-#endif /* __ASSEMBLY__ */
+extern void dwarf_free_frame(struct dwarf_frame *);
+extern int dwarf_parse_section(char *, char *, struct module *);
+extern void dwarf_module_unload(struct module *);
+
+#endif /* !__ASSEMBLY__ */
#define CFI_STARTPROC .cfi_startproc
#define CFI_ENDPROC .cfi_endproc
#define CFI_DEF_CFA .cfi_def_cfa
#define CFI_REGISTER .cfi_register
#define CFI_REL_OFFSET .cfi_rel_offset
+#define CFI_UNDEFINED .cfi_undefined
#else
#define CFI_DEF_CFA CFI_IGNORE
#define CFI_REGISTER CFI_IGNORE
#define CFI_REL_OFFSET CFI_IGNORE
+#define CFI_UNDEFINED CFI_IGNORE
#ifndef __ASSEMBLY__
static inline void dwarf_unwinder_init(void)