Thomas Gleixner | 2874c5f | 2019-05-27 08:55:01 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Alex Smith | ebb5e78 | 2015-10-21 09:54:38 +0100 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2015 Imagination Technologies |
| 4 | * Author: Alex Smith <alex.smith@imgtec.com> |
Alex Smith | ebb5e78 | 2015-10-21 09:54:38 +0100 | [diff] [blame] | 5 | */ |
| 6 | |
Vincenzo Frascino | 24640f2 | 2019-06-21 10:52:46 +0100 | [diff] [blame] | 7 | #include <asm/vdso/vdso.h> |
Alex Smith | ebb5e78 | 2015-10-21 09:54:38 +0100 | [diff] [blame] | 8 | |
Matt Redfearn | ce6828fa | 2018-02-26 17:02:45 +0000 | [diff] [blame] | 9 | #include <asm/isa-rev.h> |
| 10 | |
Alex Smith | ebb5e78 | 2015-10-21 09:54:38 +0100 | [diff] [blame] | 11 | #include <linux/elfnote.h> |
| 12 | #include <linux/version.h> |
| 13 | |
| 14 | ELFNOTE_START(Linux, 0, "a") |
| 15 | .long LINUX_VERSION_CODE |
| 16 | ELFNOTE_END |
| 17 | |
| 18 | /* |
| 19 | * The .MIPS.abiflags section must be defined with the FP ABI flags set |
| 20 | * to 'any' to be able to link with both old and new libraries. |
| 21 | * Newer toolchains are capable of automatically generating this, but we want |
| 22 | * to work with older toolchains as well. Therefore, we define the contents of |
| 23 | * this section here (under different names), and then genvdso will patch |
| 24 | * it to have the correct name and type. |
| 25 | * |
| 26 | * We base the .MIPS.abiflags section on preprocessor definitions rather than |
| 27 | * CONFIG_* because we need to match the particular ABI we are building the |
| 28 | * VDSO for. |
| 29 | * |
| 30 | * See https://dmz-portal.mips.com/wiki/MIPS_O32_ABI_-_FR0_and_FR1_Interlinking |
| 31 | * for the .MIPS.abiflags section description. |
| 32 | */ |
| 33 | |
| 34 | .section .mips_abiflags, "a" |
| 35 | .align 3 |
| 36 | __mips_abiflags: |
| 37 | .hword 0 /* version */ |
| 38 | .byte __mips /* isa_level */ |
| 39 | |
| 40 | /* isa_rev */ |
Matt Redfearn | ce6828fa | 2018-02-26 17:02:45 +0000 | [diff] [blame] | 41 | .byte MIPS_ISA_REV |
Alex Smith | ebb5e78 | 2015-10-21 09:54:38 +0100 | [diff] [blame] | 42 | |
| 43 | /* gpr_size */ |
| 44 | #ifdef __mips64 |
| 45 | .byte 2 /* AFL_REG_64 */ |
| 46 | #else |
| 47 | .byte 1 /* AFL_REG_32 */ |
| 48 | #endif |
| 49 | |
| 50 | /* cpr1_size */ |
Matt Redfearn | ce6828fa | 2018-02-26 17:02:45 +0000 | [diff] [blame] | 51 | #if (MIPS_ISA_REV >= 6) || defined(__mips64) |
Alex Smith | ebb5e78 | 2015-10-21 09:54:38 +0100 | [diff] [blame] | 52 | .byte 2 /* AFL_REG_64 */ |
| 53 | #else |
| 54 | .byte 1 /* AFL_REG_32 */ |
| 55 | #endif |
| 56 | |
| 57 | .byte 0 /* cpr2_size (AFL_REG_NONE) */ |
| 58 | .byte 0 /* fp_abi (Val_GNU_MIPS_ABI_FP_ANY) */ |
| 59 | .word 0 /* isa_ext */ |
| 60 | .word 0 /* ases */ |
| 61 | .word 0 /* flags1 */ |
| 62 | .word 0 /* flags2 */ |