kernel: abolish __syscall_inline

This used to exist because in earlier versions of the system call
interfaces, an "extern" declaration of the system call implementation
function would precede the real inline version of the implementation.
The compiler would not like this and would throw "static declaration
of ‘foo’ follows non-static declaration". So alternate macros were
needed which declare the implementation function as 'static inline'
instead of extern.

However, currently the inline version of these system call
implementations appear first, the K_SYSCALL_DECLARE() macros appear in
the header generated by gen_syscalls.py, which is always included at the
end of the header file. The compiler does not complain if a
static inline function is succeeded by an extern prototype of the
same function. This lets us simplify the generated system call
macros and just use __syscall everywhere.

The disassembly of this was checked on x86 to ensure that for
kernel-only or CONFIG_USERSPACE=n scenarios, everything is still being
inlined as expected.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
diff --git a/scripts/gen_syscall_header.py b/scripts/gen_syscall_header.py
index bff36c0..e320ac0 100755
--- a/scripts/gen_syscall_header.py
+++ b/scripts/gen_syscall_header.py
@@ -6,9 +6,9 @@
 
 import sys
 
-def gen_macro(ret, argc, inline=False):
-    sys.stdout.write("K_SYSCALL_DECLARE%d%s%s(id, name" % (argc,
-        ("" if ret else "_VOID"), ("_INLINE" if inline else "")))
+def gen_macro(ret, argc):
+    sys.stdout.write("K_SYSCALL_DECLARE%d%s(id, name" % (argc,
+        ("" if ret else "_VOID")))
     if (ret):
         sys.stdout.write(", ret")
     for i in range(argc):
@@ -53,9 +53,14 @@
 
 def gen_defines_inner(ret, argc, kernel_only=False, user_only=False):
     sys.stdout.write("#define ")
-    gen_macro(ret, argc, inline=True)
+    gen_macro(ret, argc)
     newline()
 
+    if not user_only:
+        gen_fn(ret, argc, "_impl_##name", extern=True)
+        sys.stdout.write(";")
+        newline()
+
     gen_fn(ret, argc, "name");
     newline()
     sys.stdout.write("\t{")
@@ -84,18 +89,6 @@
 
     sys.stdout.write("\t}\n\n")
 
-    sys.stdout.write("#define ")
-    gen_macro(ret, argc)
-    newline()
-
-    if not user_only:
-        gen_fn(ret, argc, "_impl_##name", extern=True)
-        sys.stdout.write(";")
-        newline()
-    sys.stdout.write("\t")
-    gen_macro(ret, argc, inline=True)
-    sys.stdout.write(";\n\n")
-
 def gen_defines(argc, kernel_only=False, user_only=False):
     gen_defines_inner(False, argc, kernel_only, user_only)
     gen_defines_inner(True, argc, kernel_only, user_only)