| From | Rasmus Villemoes <> | Subject | [PATCH v3 22/23] x86: jump_label: introduce asm macros STATIC_KEY_INIT{,_TRUE,_FALSE} | Date | Sat, 10 Nov 2018 00:10:20 +0100 |
| |
These will be useful when defining the contents of (a struct containing) a static key in assembly.
Cc: x86@kernel.org Cc: Ingo Molnar <mingo@kernel.org> Cc: Jason Baron <jbaron@akamai.com> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.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
|