elf.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * linux/arch/unicore32/include/asm/elf.h
  3. *
  4. * Code specific to PKUnity SoC and UniCore ISA
  5. *
  6. * Copyright (C) 2001-2010 GUAN Xue-tao
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #ifndef __UNICORE_ELF_H__
  13. #define __UNICORE_ELF_H__
  14. #include <asm/hwcap.h>
  15. /*
  16. * ELF register definitions..
  17. */
  18. #include <asm/ptrace.h>
  19. typedef unsigned long elf_greg_t;
  20. typedef unsigned long elf_freg_t[3];
  21. #define ELF_NGREG (sizeof(struct pt_regs) / sizeof(elf_greg_t))
  22. typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  23. typedef struct fp_state elf_fpregset_t;
  24. #define EM_UNICORE 110
  25. #define R_UNICORE_NONE 0
  26. #define R_UNICORE_PC24 1
  27. #define R_UNICORE_ABS32 2
  28. #define R_UNICORE_CALL 28
  29. #define R_UNICORE_JUMP24 29
  30. /*
  31. * These are used to set parameters in the core dumps.
  32. */
  33. #define ELF_CLASS ELFCLASS32
  34. #define ELF_DATA ELFDATA2LSB
  35. #define ELF_ARCH EM_UNICORE
  36. /*
  37. * This yields a string that ld.so will use to load implementation
  38. * specific libraries for optimization. This is more specific in
  39. * intent than poking at uname or /proc/cpuinfo.
  40. *
  41. */
  42. #define ELF_PLATFORM_SIZE 8
  43. #define ELF_PLATFORM (elf_platform)
  44. extern char elf_platform[];
  45. struct elf32_hdr;
  46. /*
  47. * This is used to ensure we don't load something for the wrong architecture.
  48. */
  49. extern int elf_check_arch(const struct elf32_hdr *);
  50. #define elf_check_arch elf_check_arch
  51. struct task_struct;
  52. int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs);
  53. #define ELF_CORE_COPY_TASK_REGS dump_task_regs
  54. #define ELF_EXEC_PAGESIZE 4096
  55. /* This is the location that an ET_DYN program is loaded if exec'ed. Typical
  56. use of this is to invoke "./ld.so someprog" to test out a new version of
  57. the loader. We need to make sure that it is out of the way of the program
  58. that it will "exec", and that there is sufficient room for the brk. */
  59. #define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
  60. /* When the program starts, a1 contains a pointer to a function to be
  61. registered with atexit, as per the SVR4 ABI. A value of 0 means we
  62. have no such handler. */
  63. #define ELF_PLAT_INIT(_r, load_addr) {(_r)->UCreg_00 = 0; }
  64. extern void elf_set_personality(const struct elf32_hdr *);
  65. #define SET_PERSONALITY(ex) elf_set_personality(&(ex))
  66. struct mm_struct;
  67. extern unsigned long arch_randomize_brk(struct mm_struct *mm);
  68. #define arch_randomize_brk arch_randomize_brk
  69. extern int vectors_user_mapping(void);
  70. #define arch_setup_additional_pages(bprm, uses_interp) vectors_user_mapping()
  71. #define ARCH_HAS_SETUP_ADDITIONAL_PAGES
  72. #endif