162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * OpenRISC Linux
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Linux architectural port borrowing liberally from similar works of
662306a36Sopenharmony_ci * others.  All original copyrights apply as per the original source
762306a36Sopenharmony_ci * declaration.
862306a36Sopenharmony_ci *
962306a36Sopenharmony_ci * OpenRISC implementation:
1062306a36Sopenharmony_ci * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com>
1162306a36Sopenharmony_ci * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
1262306a36Sopenharmony_ci * et al.
1362306a36Sopenharmony_ci */
1462306a36Sopenharmony_ci#ifndef __ASM_OPENRISC_ELF_H
1562306a36Sopenharmony_ci#define __ASM_OPENRISC_ELF_H
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci#include <linux/types.h>
1962306a36Sopenharmony_ci#include <uapi/asm/elf.h>
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci/*
2262306a36Sopenharmony_ci * This is used to ensure we don't load something for the wrong architecture.
2362306a36Sopenharmony_ci */
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_ci#define elf_check_arch(x) \
2662306a36Sopenharmony_ci	(((x)->e_machine == EM_OR32) || ((x)->e_machine == EM_OPENRISC))
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci/* This is the location that an ET_DYN program is loaded if exec'ed.  Typical
2962306a36Sopenharmony_ci   use of this is to invoke "./ld.so someprog" to test out a new version of
3062306a36Sopenharmony_ci   the loader.  We need to make sure that it is out of the way of the program
3162306a36Sopenharmony_ci   that it will "exec", and that there is sufficient room for the brk.  */
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_ci#define ELF_ET_DYN_BASE         (0x08000000)
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ci/*
3662306a36Sopenharmony_ci * Enable dump using regset.
3762306a36Sopenharmony_ci * This covers all of general/DSP/FPU regs.
3862306a36Sopenharmony_ci */
3962306a36Sopenharmony_ci#define CORE_DUMP_USE_REGSET
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci#define ELF_EXEC_PAGESIZE	8192
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ciextern void dump_elf_thread(elf_greg_t *dest, struct pt_regs *pt);
4462306a36Sopenharmony_ci#define ELF_CORE_COPY_REGS(dest, regs) dump_elf_thread(dest, regs);
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci/* This yields a mask that user programs can use to figure out what
4762306a36Sopenharmony_ci   instruction set this cpu supports.  This could be done in userspace,
4862306a36Sopenharmony_ci   but it's not easy, and we've already done it here.  */
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ci#define ELF_HWCAP	(0)
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ci/* This yields a string that ld.so will use to load implementation
5362306a36Sopenharmony_ci   specific libraries for optimization.  This is more specific in
5462306a36Sopenharmony_ci   intent than poking at uname or /proc/cpuinfo.
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_ci   For the moment, we have only optimizations for the Intel generations,
5762306a36Sopenharmony_ci   but that could change... */
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ci#define ELF_PLATFORM	(NULL)
6062306a36Sopenharmony_ci
6162306a36Sopenharmony_ci#endif
62