summaryrefslogtreecommitdiff
path: root/tools/objtool/orc_gen.c
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@kernel.org>2023-03-01 07:13:10 -0800
committerPeter Zijlstra <peterz@infradead.org>2023-03-23 23:18:57 +0100
commitf902cfdd46aedd2afb3e8033223312dbf5fbb675 (patch)
treee2670bfb2354a145170392537ae3bf8632eaf345 /tools/objtool/orc_gen.c
parentd88ebba45dfe67114a6ac8c6514f2c65b6ed64c7 (diff)
x86,objtool: Introduce ORC_TYPE_*
Unwind hints and ORC entry types are two distinct things. Separate them out more explicitly. Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/cc879d38fff8a43f8f7beb2fd56e35a5a384d7cd.1677683419.git.jpoimboe@kernel.org
Diffstat (limited to 'tools/objtool/orc_gen.c')
-rw-r--r--tools/objtool/orc_gen.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/tools/objtool/orc_gen.c b/tools/objtool/orc_gen.c
index f49630a21e0f..e85bbb996f6c 100644
--- a/tools/objtool/orc_gen.c
+++ b/tools/objtool/orc_gen.c
@@ -26,6 +26,22 @@ static int init_orc_entry(struct orc_entry *orc, struct cfi_state *cfi,
return 0;
}
+ switch (cfi->type) {
+ case UNWIND_HINT_TYPE_CALL:
+ orc->type = ORC_TYPE_CALL;
+ break;
+ case UNWIND_HINT_TYPE_REGS:
+ orc->type = ORC_TYPE_REGS;
+ break;
+ case UNWIND_HINT_TYPE_REGS_PARTIAL:
+ orc->type = ORC_TYPE_REGS_PARTIAL;
+ break;
+ default:
+ WARN_FUNC("unknown unwind hint type %d",
+ insn->sec, insn->offset, cfi->type);
+ return -1;
+ }
+
orc->end = cfi->end;
orc->signal = cfi->signal;
@@ -83,7 +99,6 @@ static int init_orc_entry(struct orc_entry *orc, struct cfi_state *cfi,
orc->sp_offset = cfi->cfa.offset;
orc->bp_offset = bp->offset;
- orc->type = cfi->type;
return 0;
}
@@ -151,7 +166,7 @@ int orc_create(struct objtool_file *file)
struct orc_entry null = {
.sp_reg = ORC_REG_UNDEFINED,
.bp_reg = ORC_REG_UNDEFINED,
- .type = UNWIND_HINT_TYPE_CALL,
+ .type = ORC_TYPE_CALL,
};
/* Build a deduplicated list of ORC entries: */