1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-or-later */ 2*4882a593Smuzhiyun /* 3*4882a593Smuzhiyun * OpenRISC Linux 4*4882a593Smuzhiyun * 5*4882a593Smuzhiyun * Linux architectural port borrowing liberally from similar works of 6*4882a593Smuzhiyun * others. All original copyrights apply as per the original source 7*4882a593Smuzhiyun * declaration. 8*4882a593Smuzhiyun * 9*4882a593Smuzhiyun * OpenRISC implementation: 10*4882a593Smuzhiyun * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com> 11*4882a593Smuzhiyun * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se> 12*4882a593Smuzhiyun * et al. 13*4882a593Smuzhiyun */ 14*4882a593Smuzhiyun #ifndef __ASM_OPENRISC_ELF_H 15*4882a593Smuzhiyun #define __ASM_OPENRISC_ELF_H 16*4882a593Smuzhiyun 17*4882a593Smuzhiyun 18*4882a593Smuzhiyun #include <linux/types.h> 19*4882a593Smuzhiyun #include <uapi/asm/elf.h> 20*4882a593Smuzhiyun 21*4882a593Smuzhiyun /* 22*4882a593Smuzhiyun * This is used to ensure we don't load something for the wrong architecture. 23*4882a593Smuzhiyun */ 24*4882a593Smuzhiyun 25*4882a593Smuzhiyun #define elf_check_arch(x) \ 26*4882a593Smuzhiyun (((x)->e_machine == EM_OR32) || ((x)->e_machine == EM_OPENRISC)) 27*4882a593Smuzhiyun 28*4882a593Smuzhiyun /* This is the location that an ET_DYN program is loaded if exec'ed. Typical 29*4882a593Smuzhiyun use of this is to invoke "./ld.so someprog" to test out a new version of 30*4882a593Smuzhiyun the loader. We need to make sure that it is out of the way of the program 31*4882a593Smuzhiyun that it will "exec", and that there is sufficient room for the brk. */ 32*4882a593Smuzhiyun 33*4882a593Smuzhiyun #define ELF_ET_DYN_BASE (0x08000000) 34*4882a593Smuzhiyun 35*4882a593Smuzhiyun /* 36*4882a593Smuzhiyun * Enable dump using regset. 37*4882a593Smuzhiyun * This covers all of general/DSP/FPU regs. 38*4882a593Smuzhiyun */ 39*4882a593Smuzhiyun #define CORE_DUMP_USE_REGSET 40*4882a593Smuzhiyun 41*4882a593Smuzhiyun #define ELF_EXEC_PAGESIZE 8192 42*4882a593Smuzhiyun 43*4882a593Smuzhiyun extern void dump_elf_thread(elf_greg_t *dest, struct pt_regs *pt); 44*4882a593Smuzhiyun #define ELF_CORE_COPY_REGS(dest, regs) dump_elf_thread(dest, regs); 45*4882a593Smuzhiyun 46*4882a593Smuzhiyun /* This yields a mask that user programs can use to figure out what 47*4882a593Smuzhiyun instruction set this cpu supports. This could be done in userspace, 48*4882a593Smuzhiyun but it's not easy, and we've already done it here. */ 49*4882a593Smuzhiyun 50*4882a593Smuzhiyun #define ELF_HWCAP (0) 51*4882a593Smuzhiyun 52*4882a593Smuzhiyun /* This yields a string that ld.so will use to load implementation 53*4882a593Smuzhiyun specific libraries for optimization. This is more specific in 54*4882a593Smuzhiyun intent than poking at uname or /proc/cpuinfo. 55*4882a593Smuzhiyun 56*4882a593Smuzhiyun For the moment, we have only optimizations for the Intel generations, 57*4882a593Smuzhiyun but that could change... */ 58*4882a593Smuzhiyun 59*4882a593Smuzhiyun #define ELF_PLATFORM (NULL) 60*4882a593Smuzhiyun 61*4882a593Smuzhiyun #endif 62