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#ifndef __ASM_VDSO_H
862306a36Sopenharmony_ci#define __ASM_VDSO_H
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci#include <linux/mm_types.h>
1162306a36Sopenharmony_ci#include <vdso/datapage.h>
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ci#include <asm/barrier.h>
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci/**
1662306a36Sopenharmony_ci * struct mips_vdso_image - Details of a VDSO image.
1762306a36Sopenharmony_ci * @data: Pointer to VDSO image data (page-aligned).
1862306a36Sopenharmony_ci * @size: Size of the VDSO image data (page-aligned).
1962306a36Sopenharmony_ci * @off_sigreturn: Offset of the sigreturn() trampoline.
2062306a36Sopenharmony_ci * @off_rt_sigreturn: Offset of the rt_sigreturn() trampoline.
2162306a36Sopenharmony_ci * @mapping: Special mapping structure.
2262306a36Sopenharmony_ci *
2362306a36Sopenharmony_ci * This structure contains details of a VDSO image, including the image data
2462306a36Sopenharmony_ci * and offsets of certain symbols required by the kernel. It is generated as
2562306a36Sopenharmony_ci * part of the VDSO build process, aside from the mapping page array, which is
2662306a36Sopenharmony_ci * populated at runtime.
2762306a36Sopenharmony_ci */
2862306a36Sopenharmony_cistruct mips_vdso_image {
2962306a36Sopenharmony_ci	void *data;
3062306a36Sopenharmony_ci	unsigned long size;
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ci	unsigned long off_sigreturn;
3362306a36Sopenharmony_ci	unsigned long off_rt_sigreturn;
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ci	struct vm_special_mapping mapping;
3662306a36Sopenharmony_ci};
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_ci/*
3962306a36Sopenharmony_ci * The following structures are auto-generated as part of the build for each
4062306a36Sopenharmony_ci * ABI by genvdso, see arch/mips/vdso/Makefile.
4162306a36Sopenharmony_ci */
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ciextern struct mips_vdso_image vdso_image;
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ci#ifdef CONFIG_MIPS32_O32
4662306a36Sopenharmony_ciextern struct mips_vdso_image vdso_image_o32;
4762306a36Sopenharmony_ci#endif
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ci#ifdef CONFIG_MIPS32_N32
5062306a36Sopenharmony_ciextern struct mips_vdso_image vdso_image_n32;
5162306a36Sopenharmony_ci#endif
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ciunion mips_vdso_data {
5462306a36Sopenharmony_ci	struct vdso_data data[CS_BASES];
5562306a36Sopenharmony_ci	u8 page[PAGE_SIZE];
5662306a36Sopenharmony_ci};
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_ci#endif /* __ASM_VDSO_H */
59