[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181109231021.11658-23-linux@rasmusvillemoes.dk>
Date: Sat, 10 Nov 2018 00:10:20 +0100
From: Rasmus Villemoes <linux@...musvillemoes.dk>
To: Andrew Morton <akpm@...ux-foundation.org>,
Jason Baron <jbaron@...mai.com>
Cc: linux-kernel@...r.kernel.org,
Rasmus Villemoes <linux@...musvillemoes.dk>, x86@...nel.org,
Ingo Molnar <mingo@...nel.org>
Subject: [PATCH v3 22/23] x86: jump_label: introduce asm macros STATIC_KEY_INIT{,_TRUE,_FALSE}
These will be useful when defining the contents of (a struct containing)
a static key in assembly.
Cc: x86@...nel.org
Cc: Ingo Molnar <mingo@...nel.org>
Cc: Jason Baron <jbaron@...mai.com>
Signed-off-by: Rasmus Villemoes <linux@...musvillemoes.dk>
---
arch/x86/include/asm/jump_label.h | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/arch/x86/include/asm/jump_label.h b/arch/x86/include/asm/jump_label.h
index a5fb34fe56a4..f8b5c77ec96d 100644
--- a/arch/x86/include/asm/jump_label.h
+++ b/arch/x86/include/asm/jump_label.h
@@ -12,6 +12,7 @@
#include <asm/asm.h>
#include <asm/nops.h>
+#include <asm-generic/jump_label.h>
#ifndef __ASSEMBLY__
@@ -64,6 +65,22 @@ static __always_inline bool arch_static_branch_jump(struct static_key *key, bool
.popsection
.endm
+.macro STATIC_KEY_INIT enabled:req type:req
+ .long \enabled # .enabled
+#ifdef CONFIG_X86_64
+ .long 0 # <padding>
+#endif
+ _ASM_PTR \type # .type
+.endm
+
+.macro STATIC_KEY_INIT_TRUE
+ STATIC_KEY_INIT 1 JUMP_TYPE_TRUE
+.endm
+
+.macro STATIC_KEY_INIT_FALSE
+ STATIC_KEY_INIT 0 JUMP_TYPE_FALSE
+.endm
+
#endif /* __ASSEMBLY__ */
#endif
--
2.19.1.6.gbde171bbf5
Powered by blists - more mailing lists