mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
xen/riscv: drop bug.h's duplicate instruction length helpers
asm/riscv_encoding.h already provides INSN_16BIT_MASK and INSN_LEN(), and emulate.c uses them, so the tree carried two spellings of the same thing which could drift apart. COMPRESSED_INSN_MASK never had a user. No functional change. Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com> Reviewed-by: Baptiste Le Duc <baptiste.le-duc@vates.tech> Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
1 parent
f3100b986e
commit
2822d55ea8
2 files changed
+1
-20
No files matched your search
@@ -13,25 +13,6 @@
|
||||
|
||||
#define BUG_INSTR "unimp"
|
||||
|
||||
/*
|
||||
* The base instruction set has a fixed length of 32-bit naturally aligned
|
||||
* instructions.
|
||||
*
|
||||
* There are extensions of variable length ( where each instruction can be
|
||||
* any number of 16-bit parcels in length ).
|
||||
*
|
||||
* Compressed ISA is used now where the instruction length is 16 bit and
|
||||
* 'unimp' instruction, in this case, can be either 16 or 32 bit (
|
||||
* depending on if compressed ISA is used or not )
|
||||
*/
|
||||
#define INSN_LENGTH_MASK _UL(0x3)
|
||||
#define INSN_LENGTH_32 _UL(0x3)
|
||||
|
||||
#define COMPRESSED_INSN_MASK _UL(0xffff)
|
||||
|
||||
#define GET_INSN_LENGTH(insn) \
|
||||
(((insn) & INSN_LENGTH_MASK) == INSN_LENGTH_32 ? 4 : 2) \
|
||||
|
||||
#endif /* !__ASSEMBLER__ */
|
||||
|
||||
#endif /* ASM__RISCV__BUG_H */
|
||||
@@ -214,7 +214,7 @@ void do_trap(struct cpu_user_regs *cpu_regs)
|
||||
die();
|
||||
}
|
||||
|
||||
cpu_regs->sepc += GET_INSN_LENGTH(*(uint16_t *)pc);
|
||||
cpu_regs->sepc += INSN_LEN(*(const uint16_t *)pc);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||