x86: Add insn_decode_kernel()
This was done by commit 52fa82c21f64e900a72437269a5cc9e0034b424e upstream, but this backport avoids changing all callers of the old decoder API. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
d9cd219114
commit
9a6471666b
@@ -105,6 +105,8 @@ enum insn_mode {
|
|||||||
|
|
||||||
extern int insn_decode(struct insn *insn, const void *kaddr, int buf_len, enum insn_mode m);
|
extern int insn_decode(struct insn *insn, const void *kaddr, int buf_len, enum insn_mode m);
|
||||||
|
|
||||||
|
#define insn_decode_kernel(_insn, _ptr) insn_decode((_insn), (_ptr), MAX_INSN_SIZE, INSN_MODE_KERN)
|
||||||
|
|
||||||
/* Attribute will be determined after getting ModRM (for opcode groups) */
|
/* Attribute will be determined after getting ModRM (for opcode groups) */
|
||||||
static inline void insn_get_attribute(struct insn *insn)
|
static inline void insn_get_attribute(struct insn *insn)
|
||||||
{
|
{
|
||||||
|
@@ -1290,7 +1290,7 @@ static void text_poke_loc_init(struct text_poke_loc *tp, void *addr,
|
|||||||
if (!emulate)
|
if (!emulate)
|
||||||
emulate = opcode;
|
emulate = opcode;
|
||||||
|
|
||||||
ret = insn_decode(&insn, emulate, MAX_INSN_SIZE, INSN_MODE_KERN);
|
ret = insn_decode_kernel(&insn, emulate);
|
||||||
|
|
||||||
BUG_ON(ret < 0);
|
BUG_ON(ret < 0);
|
||||||
BUG_ON(len != insn.length);
|
BUG_ON(len != insn.length);
|
||||||
|
@@ -105,6 +105,8 @@ enum insn_mode {
|
|||||||
|
|
||||||
extern int insn_decode(struct insn *insn, const void *kaddr, int buf_len, enum insn_mode m);
|
extern int insn_decode(struct insn *insn, const void *kaddr, int buf_len, enum insn_mode m);
|
||||||
|
|
||||||
|
#define insn_decode_kernel(_insn, _ptr) insn_decode((_insn), (_ptr), MAX_INSN_SIZE, INSN_MODE_KERN)
|
||||||
|
|
||||||
/* Attribute will be determined after getting ModRM (for opcode groups) */
|
/* Attribute will be determined after getting ModRM (for opcode groups) */
|
||||||
static inline void insn_get_attribute(struct insn *insn)
|
static inline void insn_get_attribute(struct insn *insn)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user