0

I am looking for a userspace equivalent to the SYM_FUNC_START macro from the linux kernel (include <linux/linkage.h>). I want to declare a function in an .S assembly file like so:

SYM_FUNC_START(assembly_func)
 push %rbx
 mov %rdi, %r8 // %rdi should contain the first argument 
 pob %rbx
 ret 
SYM_FUNC_END(assembly_func)

And then be able to define it in a .h file like so:

void assembly_func(int64_t first_arg);

And call it from normal .c code. Is this also possible from userspace?

0 Answers0