mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-06-13 06:00:13 -04:00
While the GCC and Clang compilers already define __ASSEMBLER__ automatically when compiling assembly code, __ASSEMBLY__ is a macro that only gets defined by the Makefiles in the kernel. This can be very confusing when switching between userspace and kernelspace coding, or when dealing with uapi headers that rather should use __ASSEMBLER__ instead. So let's standardize on the __ASSEMBLER__ macro that is provided by the compilers now. This originally was a completely mechanical patch (done with a simple "sed -i" statement), with some manual fixups during rebasing of the patch later. Cc: Paul Walmsley <paul.walmsley@sifive.com> Cc: Palmer Dabbelt <palmer@dabbelt.com> Cc: Albert Ou <aou@eecs.berkeley.edu> Cc: Alexandre Ghiti <alex@ghiti.fr> Cc: linux-riscv@lists.infradead.org Signed-off-by: Thomas Huth <thuth@redhat.com> Link: https://lore.kernel.org/r/20250606070952.498274-3-thuth@redhat.com Signed-off-by: Paul Walmsley <pjw@kernel.org>
42 lines
967 B
C
42 lines
967 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (C) 2012 ARM Limited
|
|
* Copyright (C) 2014 Regents of the University of California
|
|
* Copyright (C) 2017 SiFive
|
|
*/
|
|
|
|
#ifndef _ASM_RISCV_VDSO_H
|
|
#define _ASM_RISCV_VDSO_H
|
|
|
|
/*
|
|
* All systems with an MMU have a VDSO, but systems without an MMU don't
|
|
* support shared libraries and therefore don't have one.
|
|
*/
|
|
#ifdef CONFIG_MMU
|
|
|
|
#define __VDSO_PAGES 4
|
|
|
|
#ifndef __ASSEMBLER__
|
|
#include <generated/vdso-offsets.h>
|
|
|
|
#define VDSO_SYMBOL(base, name) \
|
|
(void __user *)((unsigned long)(base) + __vdso_##name##_offset)
|
|
|
|
#ifdef CONFIG_COMPAT
|
|
#include <generated/compat_vdso-offsets.h>
|
|
|
|
#define COMPAT_VDSO_SYMBOL(base, name) \
|
|
(void __user *)((unsigned long)(base) + compat__vdso_##name##_offset)
|
|
|
|
extern char compat_vdso_start[], compat_vdso_end[];
|
|
|
|
#endif /* CONFIG_COMPAT */
|
|
|
|
extern char vdso_start[], vdso_end[];
|
|
|
|
#endif /* !__ASSEMBLER__ */
|
|
|
|
#endif /* CONFIG_MMU */
|
|
|
|
#endif /* _ASM_RISCV_VDSO_H */
|