kernel: syscall: pin generated inline functions
Although they are marked as an inline functions, the compiler may decide not to inline them which would result in them being outside the pinned text section. Since these functions are required for userspace to work correctly, pin them in physical memory. This also applies to k_is_user_context(). Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
2117a2a44b
commit
7ad00b9e47
2 changed files with 6 additions and 0 deletions
|
@ -80,6 +80,8 @@ syscall_template = """
|
|||
#include <syscall_list.h>
|
||||
#include <syscall.h>
|
||||
|
||||
#include <linker/sections.h>
|
||||
|
||||
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
|
||||
#pragma GCC diagnostic push
|
||||
#endif
|
||||
|
@ -174,6 +176,8 @@ def wrapper_defs(func_name, func_type, args):
|
|||
decl_arglist = ", ".join([" ".join(argrec) for argrec in args]) or "void"
|
||||
|
||||
wrap = "extern %s z_impl_%s(%s);\n" % (func_type, func_name, decl_arglist)
|
||||
wrap += "\n"
|
||||
wrap += "__pinned_func\n"
|
||||
wrap += "static inline %s %s(%s)\n" % (func_type, func_name, decl_arglist)
|
||||
wrap += "{\n"
|
||||
wrap += "#ifdef CONFIG_USERSPACE\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue