summaryrefslogtreecommitdiffstats
path: root/arch/riscv/include/asm/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/riscv/include/asm/common.h')
-rw-r--r--arch/riscv/include/asm/common.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/riscv/include/asm/common.h b/arch/riscv/include/asm/common.h
index bc8a17e30b..a0982c548f 100644
--- a/arch/riscv/include/asm/common.h
+++ b/arch/riscv/include/asm/common.h
@@ -1,6 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/* SPDX-FileCopyrightText: Copyright (c) 2021 Ahmad Fatoum, Pengutronix */
#ifndef ASM_RISCV_COMMON_H
#define ASM_RISCV_COMMON_H
-/* nothing special yet */
+#include <linux/compiler.h>
+
+static __always_inline unsigned long get_pc(void)
+{
+label:
+ return (unsigned long)&&label;
+}
#endif /* ASM_RISCV_COMMON_H */