cfi.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright (C) 2015-2017 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 _OBJTOOL_CFI_H
  18. #define _OBJTOOL_CFI_H
  19. #define CFI_UNDEFINED -1
  20. #define CFI_CFA -2
  21. #define CFI_SP_INDIRECT -3
  22. #define CFI_BP_INDIRECT -4
  23. #define CFI_AX 0
  24. #define CFI_DX 1
  25. #define CFI_CX 2
  26. #define CFI_BX 3
  27. #define CFI_SI 4
  28. #define CFI_DI 5
  29. #define CFI_BP 6
  30. #define CFI_SP 7
  31. #define CFI_R8 8
  32. #define CFI_R9 9
  33. #define CFI_R10 10
  34. #define CFI_R11 11
  35. #define CFI_R12 12
  36. #define CFI_R13 13
  37. #define CFI_R14 14
  38. #define CFI_R15 15
  39. #define CFI_RA 16
  40. #define CFI_NUM_REGS 17
  41. struct cfi_reg {
  42. int base;
  43. int offset;
  44. };
  45. struct cfi_state {
  46. struct cfi_reg cfa;
  47. struct cfi_reg regs[CFI_NUM_REGS];
  48. };
  49. #endif /* _OBJTOOL_CFI_H */