162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Copyright (C) 2015 Imagination Technologies 462306a36Sopenharmony_ci * Author: Alex Smith <alex.smith@imgtec.com> 562306a36Sopenharmony_ci */ 662306a36Sopenharmony_ci 762306a36Sopenharmony_ci#include <asm/vdso/vdso.h> 862306a36Sopenharmony_ci 962306a36Sopenharmony_ci#include <asm/isa-rev.h> 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_ci#include <linux/elfnote.h> 1262306a36Sopenharmony_ci#include <linux/version.h> 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_ciELFNOTE_START(Linux, 0, "a") 1562306a36Sopenharmony_ci .long LINUX_VERSION_CODE 1662306a36Sopenharmony_ciELFNOTE_END 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_ci/* 1962306a36Sopenharmony_ci * The .MIPS.abiflags section must be defined with the FP ABI flags set 2062306a36Sopenharmony_ci * to 'any' to be able to link with both old and new libraries. 2162306a36Sopenharmony_ci * Newer toolchains are capable of automatically generating this, but we want 2262306a36Sopenharmony_ci * to work with older toolchains as well. Therefore, we define the contents of 2362306a36Sopenharmony_ci * this section here (under different names), and then genvdso will patch 2462306a36Sopenharmony_ci * it to have the correct name and type. 2562306a36Sopenharmony_ci * 2662306a36Sopenharmony_ci * We base the .MIPS.abiflags section on preprocessor definitions rather than 2762306a36Sopenharmony_ci * CONFIG_* because we need to match the particular ABI we are building the 2862306a36Sopenharmony_ci * VDSO for. 2962306a36Sopenharmony_ci * 3062306a36Sopenharmony_ci * See https://dmz-portal.mips.com/wiki/MIPS_O32_ABI_-_FR0_and_FR1_Interlinking 3162306a36Sopenharmony_ci * for the .MIPS.abiflags section description. 3262306a36Sopenharmony_ci */ 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ci .section .mips_abiflags, "a" 3562306a36Sopenharmony_ci .align 3 3662306a36Sopenharmony_ci__mips_abiflags: 3762306a36Sopenharmony_ci .hword 0 /* version */ 3862306a36Sopenharmony_ci .byte __mips /* isa_level */ 3962306a36Sopenharmony_ci 4062306a36Sopenharmony_ci /* isa_rev */ 4162306a36Sopenharmony_ci .byte MIPS_ISA_REV 4262306a36Sopenharmony_ci 4362306a36Sopenharmony_ci /* gpr_size */ 4462306a36Sopenharmony_ci#ifdef __mips64 4562306a36Sopenharmony_ci .byte 2 /* AFL_REG_64 */ 4662306a36Sopenharmony_ci#else 4762306a36Sopenharmony_ci .byte 1 /* AFL_REG_32 */ 4862306a36Sopenharmony_ci#endif 4962306a36Sopenharmony_ci 5062306a36Sopenharmony_ci /* cpr1_size */ 5162306a36Sopenharmony_ci#if (MIPS_ISA_REV >= 6) || defined(__mips64) 5262306a36Sopenharmony_ci .byte 2 /* AFL_REG_64 */ 5362306a36Sopenharmony_ci#else 5462306a36Sopenharmony_ci .byte 1 /* AFL_REG_32 */ 5562306a36Sopenharmony_ci#endif 5662306a36Sopenharmony_ci 5762306a36Sopenharmony_ci .byte 0 /* cpr2_size (AFL_REG_NONE) */ 5862306a36Sopenharmony_ci .byte 0 /* fp_abi (Val_GNU_MIPS_ABI_FP_ANY) */ 5962306a36Sopenharmony_ci .word 0 /* isa_ext */ 6062306a36Sopenharmony_ci .word 0 /* ases */ 6162306a36Sopenharmony_ci .word 0 /* flags1 */ 6262306a36Sopenharmony_ci .word 0 /* flags2 */ 63