Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) #ifndef __GENELF_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3) #define __GENELF_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5) /* genelf.c */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6) int jit_write_elf(int fd, uint64_t code_addr, const char *sym,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7) 		  const void *code, int csize, void *debug, int nr_debug_entries,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) 		  void *unwinding, uint64_t unwinding_header_size, uint64_t unwinding_size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) #ifdef HAVE_DWARF_SUPPORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) /* genelf_debug.c */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) int jit_add_debug_info(Elf *e, uint64_t code_addr, void *debug, int nr_debug_entries);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #if   defined(__arm__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #define GEN_ELF_ARCH	EM_ARM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #define GEN_ELF_CLASS	ELFCLASS32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #elif defined(__aarch64__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #define GEN_ELF_ARCH	EM_AARCH64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #define GEN_ELF_CLASS	ELFCLASS64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #elif defined(__x86_64__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define GEN_ELF_ARCH	EM_X86_64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #define GEN_ELF_CLASS	ELFCLASS64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #elif defined(__i386__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #define GEN_ELF_ARCH	EM_386
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #define GEN_ELF_CLASS	ELFCLASS32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #elif defined(__powerpc64__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #define GEN_ELF_ARCH	EM_PPC64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #define GEN_ELF_CLASS	ELFCLASS64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #elif defined(__powerpc__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #define GEN_ELF_ARCH	EM_PPC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #define GEN_ELF_CLASS	ELFCLASS32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #elif defined(__sparc__) && defined(__arch64__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #define GEN_ELF_ARCH	EM_SPARCV9
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) #define GEN_ELF_CLASS	ELFCLASS64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) #elif defined(__sparc__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #define GEN_ELF_ARCH	EM_SPARC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) #define GEN_ELF_CLASS	ELFCLASS32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) #elif defined(__s390x__)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) #define GEN_ELF_ARCH	EM_S390
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) #define GEN_ELF_CLASS	ELFCLASS64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) #error "unsupported architecture"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) #if __BYTE_ORDER == __BIG_ENDIAN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) #define GEN_ELF_ENDIAN	ELFDATA2MSB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) #define GEN_ELF_ENDIAN	ELFDATA2LSB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) #if GEN_ELF_CLASS == ELFCLASS64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) #define elf_newehdr	elf64_newehdr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) #define elf_getshdr	elf64_getshdr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) #define Elf_Ehdr	Elf64_Ehdr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) #define Elf_Shdr	Elf64_Shdr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) #define Elf_Sym		Elf64_Sym
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #define ELF_ST_TYPE(a)	ELF64_ST_TYPE(a)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) #define ELF_ST_BIND(a)	ELF64_ST_BIND(a)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) #define ELF_ST_VIS(a)	ELF64_ST_VISIBILITY(a)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) #define elf_newehdr	elf32_newehdr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) #define elf_getshdr	elf32_getshdr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) #define Elf_Ehdr	Elf32_Ehdr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) #define Elf_Shdr	Elf32_Shdr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) #define Elf_Sym		Elf32_Sym
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) #define ELF_ST_TYPE(a)	ELF32_ST_TYPE(a)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) #define ELF_ST_BIND(a)	ELF32_ST_BIND(a)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) #define ELF_ST_VIS(a)	ELF32_ST_VISIBILITY(a)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) /* The .text section is directly after the ELF header */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) #define GEN_ELF_TEXT_OFFSET sizeof(Elf_Ehdr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) #endif