| 730 | #define GET_SUBTARGETINFO_ENUM |
| 731 | #include "XCoreGenInstrInfo.inc" |
| 732 | bool XCore_getInstruction(csh ud, const uint8_t *code, size_t code_len, MCInst *MI, |
| 733 | uint16_t *size, uint64_t address, void *info) |
| 734 | { |
| 735 | uint16_t insn16; |
| 736 | uint32_t insn32; |
| 737 | DecodeStatus Result; |
| 738 | |
| 739 | if (!readInstruction16(code, code_len, &insn16)) { |
| 740 | return false; |
| 741 | } |
| 742 | |
| 743 | if (MI->flat_insn->detail) { |
| 744 | memset(MI->flat_insn->detail, 0, offsetof(cs_detail, xcore)+sizeof(cs_xcore)); |
| 745 | } |
| 746 | |
| 747 | // Calling the auto-generated decoder function. |
| 748 | Result = decodeInstruction_2(DecoderTable16, MI, insn16, address, info, 0); |
| 749 | if (Result != MCDisassembler_Fail) { |
| 750 | *size = 2; |
| 751 | return true; |
| 752 | } |
| 753 | |
| 754 | if (!readInstruction32(code, code_len, &insn32)) { |
| 755 | return false; |
| 756 | } |
| 757 | |
| 758 | // Calling the auto-generated decoder function. |
| 759 | Result = decodeInstruction_4(DecoderTable32, MI, insn32, address, info, 0); |
| 760 | if (Result != MCDisassembler_Fail) { |
| 761 | *size = 4; |
| 762 | return true; |
| 763 | } |
| 764 | |
| 765 | return false; |
| 766 | } |
| 767 | |
| 768 | void XCore_init(MCRegisterInfo *MRI) |
| 769 | { |
nothing calls this directly
no test coverage detected
searching dependent graphs…