blob: a25cb147f1caaf20e3f6a388d5f4498d421b883e [file] [log] [blame]
Thomas Gleixner2874c5f2019-05-27 08:55:01 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Alex Smithebb5e782015-10-21 09:54:38 +01002/*
3 * Copyright (C) 2015 Imagination Technologies
4 * Author: Alex Smith <alex.smith@imgtec.com>
Alex Smithebb5e782015-10-21 09:54:38 +01005 */
6
Vincenzo Frascino24640f22019-06-21 10:52:46 +01007#include <asm/vdso/vdso.h>
Alex Smithebb5e782015-10-21 09:54:38 +01008
Matt Redfearnce6828fa2018-02-26 17:02:45 +00009#include <asm/isa-rev.h>
10
Alex Smithebb5e782015-10-21 09:54:38 +010011#include <linux/elfnote.h>
12#include <linux/version.h>
13
14ELFNOTE_START(Linux, 0, "a")
15 .long LINUX_VERSION_CODE
16ELFNOTE_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 Redfearnce6828fa2018-02-26 17:02:45 +000041 .byte MIPS_ISA_REV
Alex Smithebb5e782015-10-21 09:54:38 +010042
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 Redfearnce6828fa2018-02-26 17:02:45 +000051#if (MIPS_ISA_REV >= 6) || defined(__mips64)
Alex Smithebb5e782015-10-21 09:54:38 +010052 .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 */