]> git.ipfire.org Git - thirdparty/linux.git/commit
static_call: allow using STATIC_CALL_TRAMP_STR() from assembly
authorNaman Jain <namjain@linux.microsoft.com>
Thu, 13 Nov 2025 04:41:47 +0000 (04:41 +0000)
committerWei Liu <wei.liu@kernel.org>
Sat, 15 Nov 2025 06:18:17 +0000 (06:18 +0000)
commit796ef5a7fe86a8605f2844471ed7baa8e80bace8
tree84b7299673aa7771b5ff50bfb50afe07401493ea
parentc91fe5f162f278d4aa960d06d2dbc42f9857593a
static_call: allow using STATIC_CALL_TRAMP_STR() from assembly

STATIC_CALL_TRAMP_STR() could not be used from .S files because
static_call_types.h was not safe to include in assembly as it pulled in C
types/constructs that are unavailable under __ASSEMBLY__.
Make the header assembly-friendly by adding __ASSEMBLY__ checks and
providing only the minimal definitions needed for assembly, so that it
can be safely included by .S code. This enables emitting the static call
trampoline symbol name via STATIC_CALL_TRAMP_STR() directly in assembly
sources, to be used with 'call' instruction. Also, move a certain
definitions out of __ASSEMBLY__ checks in compiler_types.h to meet
the dependencies.

No functional change for C compilation.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
include/linux/compiler_types.h
include/linux/static_call_types.h
tools/include/linux/static_call_types.h