18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * OpenRISC Linux 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Linux architectural port borrowing liberally from similar works of 68c2ecf20Sopenharmony_ci * others. All original copyrights apply as per the original source 78c2ecf20Sopenharmony_ci * declaration. 88c2ecf20Sopenharmony_ci * 98c2ecf20Sopenharmony_ci * OpenRISC implementation: 108c2ecf20Sopenharmony_ci * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com> 118c2ecf20Sopenharmony_ci * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se> 128c2ecf20Sopenharmony_ci * et al. 138c2ecf20Sopenharmony_ci * 148c2ecf20Sopenharmony_ci * This program is free software; you can redistribute it and/or modify 158c2ecf20Sopenharmony_ci * it under the terms of the GNU General Public License as published by 168c2ecf20Sopenharmony_ci * the Free Software Foundation; either version 2 of the License, or 178c2ecf20Sopenharmony_ci * (at your option) any later version. 188c2ecf20Sopenharmony_ci */ 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci#ifndef _UAPI__ASM_OPENRISC_ELF_H 218c2ecf20Sopenharmony_ci#define _UAPI__ASM_OPENRISC_ELF_H 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ci/* 248c2ecf20Sopenharmony_ci * This files is partially exported to userspace. This allows us to keep 258c2ecf20Sopenharmony_ci * the ELF bits in one place which should assist in keeping the kernel and 268c2ecf20Sopenharmony_ci * userspace in sync. 278c2ecf20Sopenharmony_ci */ 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci/* 308c2ecf20Sopenharmony_ci * ELF register definitions.. 318c2ecf20Sopenharmony_ci */ 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci/* for struct user_regs_struct definition */ 348c2ecf20Sopenharmony_ci#include <asm/ptrace.h> 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ci/* The OR1K relocation types... not all relevant for module loader */ 378c2ecf20Sopenharmony_ci#define R_OR32_NONE 0 388c2ecf20Sopenharmony_ci#define R_OR32_32 1 398c2ecf20Sopenharmony_ci#define R_OR32_16 2 408c2ecf20Sopenharmony_ci#define R_OR32_8 3 418c2ecf20Sopenharmony_ci#define R_OR32_CONST 4 428c2ecf20Sopenharmony_ci#define R_OR32_CONSTH 5 438c2ecf20Sopenharmony_ci#define R_OR32_JUMPTARG 6 448c2ecf20Sopenharmony_ci#define R_OR32_VTINHERIT 7 458c2ecf20Sopenharmony_ci#define R_OR32_VTENTRY 8 468c2ecf20Sopenharmony_ci 478c2ecf20Sopenharmony_citypedef unsigned long elf_greg_t; 488c2ecf20Sopenharmony_ci 498c2ecf20Sopenharmony_ci/* 508c2ecf20Sopenharmony_ci * Note that NGREG is defined to ELF_NGREG in include/linux/elfcore.h, and is 518c2ecf20Sopenharmony_ci * thus exposed to user-space. 528c2ecf20Sopenharmony_ci */ 538c2ecf20Sopenharmony_ci#define ELF_NGREG (sizeof(struct user_regs_struct) / sizeof(elf_greg_t)) 548c2ecf20Sopenharmony_citypedef elf_greg_t elf_gregset_t[ELF_NGREG]; 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ci/* A placeholder; OR32 does not have fp support yes, so no fp regs for now. */ 578c2ecf20Sopenharmony_citypedef unsigned long elf_fpregset_t; 588c2ecf20Sopenharmony_ci 598c2ecf20Sopenharmony_ci/* EM_OPENRISC is defined in linux/elf-em.h */ 608c2ecf20Sopenharmony_ci#define EM_OR32 0x8472 618c2ecf20Sopenharmony_ci 628c2ecf20Sopenharmony_ci/* 638c2ecf20Sopenharmony_ci * These are used to set parameters in the core dumps. 648c2ecf20Sopenharmony_ci */ 658c2ecf20Sopenharmony_ci#define ELF_ARCH EM_OR32 668c2ecf20Sopenharmony_ci#define ELF_CLASS ELFCLASS32 678c2ecf20Sopenharmony_ci#define ELF_DATA ELFDATA2MSB 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ci#endif /* _UAPI__ASM_OPENRISC_ELF_H */ 70