struct text_poke_loc {
void *addr;
- int len;
s32 rel32;
u8 opcode;
const u8 text[POKE_MAX_OPCODE_SIZE];
{
struct text_poke_loc *tp;
void *ip;
+ int len;
/*
* Having observed our INT3 instruction, we now must observe
return 0;
}
- ip += tp->len;
+ len = text_opcode_size(tp->opcode);
+ ip += len;
switch (tp->opcode) {
case INT3_INSN_OPCODE:
* Second step: update all but the first byte of the patched range.
*/
for (do_sync = 0, i = 0; i < nr_entries; i++) {
- if (tp[i].len - sizeof(int3) > 0) {
+ int len = text_opcode_size(tp[i].opcode);
+
+ if (len - sizeof(int3) > 0) {
text_poke((char *)tp[i].addr + sizeof(int3),
(const char *)tp[i].text + sizeof(int3),
- tp[i].len - sizeof(int3));
+ len - sizeof(int3));
do_sync++;
}
}
BUG_ON(len != insn.length);
tp->addr = addr;
- tp->len = len;
tp->opcode = insn.opcode.bytes[0];
switch (tp->opcode) {