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