| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com> |
|---|
| 3 | 4 | * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se> |
|---|
| 4 | 5 | * Copyright (C) 2012 Regents of the University of California |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 8 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 9 | | - * (at your option) any later version. |
|---|
| 10 | 6 | */ |
|---|
| 11 | 7 | |
|---|
| 12 | 8 | #ifndef _ASM_RISCV_ELF_H |
|---|
| .. | .. |
|---|
| 15 | 11 | #include <uapi/asm/elf.h> |
|---|
| 16 | 12 | #include <asm/auxvec.h> |
|---|
| 17 | 13 | #include <asm/byteorder.h> |
|---|
| 18 | | - |
|---|
| 19 | | -/* TODO: Move definition into include/uapi/linux/elf-em.h */ |
|---|
| 20 | | -#define EM_RISCV 0xF3 |
|---|
| 14 | +#include <asm/cacheinfo.h> |
|---|
| 21 | 15 | |
|---|
| 22 | 16 | /* |
|---|
| 23 | 17 | * These are used to set parameters in the core dumps. |
|---|
| .. | .. |
|---|
| 30 | 24 | #define ELF_CLASS ELFCLASS32 |
|---|
| 31 | 25 | #endif |
|---|
| 32 | 26 | |
|---|
| 33 | | -#if defined(__LITTLE_ENDIAN) |
|---|
| 34 | 27 | #define ELF_DATA ELFDATA2LSB |
|---|
| 35 | | -#elif defined(__BIG_ENDIAN) |
|---|
| 36 | | -#define ELF_DATA ELFDATA2MSB |
|---|
| 37 | | -#else |
|---|
| 38 | | -#error "Unknown endianness" |
|---|
| 39 | | -#endif |
|---|
| 40 | 28 | |
|---|
| 41 | 29 | /* |
|---|
| 42 | 30 | * This is used to ensure we don't load something for the wrong architecture. |
|---|
| .. | .. |
|---|
| 69 | 57 | */ |
|---|
| 70 | 58 | #define ELF_PLATFORM (NULL) |
|---|
| 71 | 59 | |
|---|
| 60 | +#ifdef CONFIG_MMU |
|---|
| 72 | 61 | #define ARCH_DLINFO \ |
|---|
| 73 | 62 | do { \ |
|---|
| 74 | 63 | NEW_AUX_ENT(AT_SYSINFO_EHDR, \ |
|---|
| 75 | 64 | (elf_addr_t)current->mm->context.vdso); \ |
|---|
| 65 | + NEW_AUX_ENT(AT_L1I_CACHESIZE, \ |
|---|
| 66 | + get_cache_size(1, CACHE_TYPE_INST)); \ |
|---|
| 67 | + NEW_AUX_ENT(AT_L1I_CACHEGEOMETRY, \ |
|---|
| 68 | + get_cache_geometry(1, CACHE_TYPE_INST)); \ |
|---|
| 69 | + NEW_AUX_ENT(AT_L1D_CACHESIZE, \ |
|---|
| 70 | + get_cache_size(1, CACHE_TYPE_DATA)); \ |
|---|
| 71 | + NEW_AUX_ENT(AT_L1D_CACHEGEOMETRY, \ |
|---|
| 72 | + get_cache_geometry(1, CACHE_TYPE_DATA)); \ |
|---|
| 73 | + NEW_AUX_ENT(AT_L2_CACHESIZE, \ |
|---|
| 74 | + get_cache_size(2, CACHE_TYPE_UNIFIED)); \ |
|---|
| 75 | + NEW_AUX_ENT(AT_L2_CACHEGEOMETRY, \ |
|---|
| 76 | + get_cache_geometry(2, CACHE_TYPE_UNIFIED)); \ |
|---|
| 76 | 77 | } while (0) |
|---|
| 77 | | - |
|---|
| 78 | | - |
|---|
| 79 | 78 | #define ARCH_HAS_SETUP_ADDITIONAL_PAGES |
|---|
| 80 | 79 | struct linux_binprm; |
|---|
| 81 | 80 | extern int arch_setup_additional_pages(struct linux_binprm *bprm, |
|---|
| 82 | 81 | int uses_interp); |
|---|
| 82 | +#endif /* CONFIG_MMU */ |
|---|
| 83 | 83 | |
|---|
| 84 | 84 | #endif /* _ASM_RISCV_ELF_H */ |
|---|