arch.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (C) 2015 Josh Poimboeuf <jpoimboe@redhat.com>
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version 2
  7. * of the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #ifndef _ARCH_H
  18. #define _ARCH_H
  19. #include <stdbool.h>
  20. #include "elf.h"
  21. #define INSN_FP_SAVE 1
  22. #define INSN_FP_SETUP 2
  23. #define INSN_FP_RESTORE 3
  24. #define INSN_JUMP_CONDITIONAL 4
  25. #define INSN_JUMP_UNCONDITIONAL 5
  26. #define INSN_JUMP_DYNAMIC 6
  27. #define INSN_CALL 7
  28. #define INSN_CALL_DYNAMIC 8
  29. #define INSN_RETURN 9
  30. #define INSN_CONTEXT_SWITCH 10
  31. #define INSN_BUG 11
  32. #define INSN_NOP 12
  33. #define INSN_OTHER 13
  34. #define INSN_LAST INSN_OTHER
  35. int arch_decode_instruction(struct elf *elf, struct section *sec,
  36. unsigned long offset, unsigned int maxlen,
  37. unsigned int *len, unsigned char *type,
  38. unsigned long *displacement);
  39. #endif /* _ARCH_H */