elf.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
  2. /*
  3. * OpenRISC Linux
  4. *
  5. * Linux architectural port borrowing liberally from similar works of
  6. * others. All original copyrights apply as per the original source
  7. * declaration.
  8. *
  9. * OpenRISC implementation:
  10. * Copyright (C) 2003 Matjaz Breskvar <[email protected]>
  11. * Copyright (C) 2010-2011 Jonas Bonn <[email protected]>
  12. * et al.
  13. *
  14. * This program is free software; you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License as published by
  16. * the Free Software Foundation; either version 2 of the License, or
  17. * (at your option) any later version.
  18. */
  19. #ifndef _UAPI__ASM_OPENRISC_ELF_H
  20. #define _UAPI__ASM_OPENRISC_ELF_H
  21. /*
  22. * This files is partially exported to userspace. This allows us to keep
  23. * the ELF bits in one place which should assist in keeping the kernel and
  24. * userspace in sync.
  25. */
  26. /*
  27. * ELF register definitions..
  28. */
  29. /* for struct user_regs_struct definition */
  30. #include <asm/ptrace.h>
  31. /* The OR1K relocation types... not all relevant for module loader */
  32. #define R_OR32_NONE 0
  33. #define R_OR32_32 1
  34. #define R_OR32_16 2
  35. #define R_OR32_8 3
  36. #define R_OR32_CONST 4
  37. #define R_OR32_CONSTH 5
  38. #define R_OR32_JUMPTARG 6
  39. #define R_OR32_VTINHERIT 7
  40. #define R_OR32_VTENTRY 8
  41. typedef unsigned long elf_greg_t;
  42. /*
  43. * Note that NGREG is defined to ELF_NGREG in include/linux/elfcore.h, and is
  44. * thus exposed to user-space.
  45. */
  46. #define ELF_NGREG (sizeof(struct user_regs_struct) / sizeof(elf_greg_t))
  47. typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  48. /* A placeholder; OR32 does not have fp support yes, so no fp regs for now. */
  49. typedef unsigned long elf_fpregset_t;
  50. /* EM_OPENRISC is defined in linux/elf-em.h */
  51. #define EM_OR32 0x8472
  52. /*
  53. * These are used to set parameters in the core dumps.
  54. */
  55. #define ELF_ARCH EM_OR32
  56. #define ELF_CLASS ELFCLASS32
  57. #define ELF_DATA ELFDATA2MSB
  58. #endif /* _UAPI__ASM_OPENRISC_ELF_H */