Browse Source

kernel: syscalls: Change handlers namespace

According C99 the first 31 characters of an identifier must be unique.
Shortening the namespace of the generated objects to achieve it.

C99 - 5.2.4.1
MISRA-C rule 5.1

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
pull/10275/head
Flavio Ceolin 7 years ago committed by Anas Nashif
parent
commit
6fc84feaf2
  1. 14
      kernel/include/syscall_handler.h
  2. 2
      scripts/gen_syscall_header.py
  3. 2
      scripts/gen_syscalls.py

14
kernel/include/syscall_handler.h

@ -496,7 +496,7 @@ static inline int _obj_validation_check(struct _k_object *ko, @@ -496,7 +496,7 @@ static inline int _obj_validation_check(struct _k_object *ko,
*/
#define __SYSCALL_HANDLER0(name_) \
u32_t _handler_ ## name_(u32_t arg1 __unused, \
u32_t hdlr_ ## name_(u32_t arg1 __unused, \
u32_t arg2 __unused, \
u32_t arg3 __unused, \
u32_t arg4 __unused, \
@ -505,7 +505,7 @@ static inline int _obj_validation_check(struct _k_object *ko, @@ -505,7 +505,7 @@ static inline int _obj_validation_check(struct _k_object *ko,
void *ssf)
#define __SYSCALL_HANDLER1(name_, arg1_) \
u32_t _handler_ ## name_(u32_t arg1_, \
u32_t hdlr_ ## name_(u32_t arg1_, \
u32_t arg2 __unused, \
u32_t arg3 __unused, \
u32_t arg4 __unused, \
@ -514,7 +514,7 @@ static inline int _obj_validation_check(struct _k_object *ko, @@ -514,7 +514,7 @@ static inline int _obj_validation_check(struct _k_object *ko,
void *ssf)
#define __SYSCALL_HANDLER2(name_, arg1_, arg2_) \
u32_t _handler_ ## name_(u32_t arg1_, \
u32_t hdlr_ ## name_(u32_t arg1_, \
u32_t arg2_, \
u32_t arg3 __unused, \
u32_t arg4 __unused, \
@ -523,7 +523,7 @@ static inline int _obj_validation_check(struct _k_object *ko, @@ -523,7 +523,7 @@ static inline int _obj_validation_check(struct _k_object *ko,
void *ssf)
#define __SYSCALL_HANDLER3(name_, arg1_, arg2_, arg3_) \
u32_t _handler_ ## name_(u32_t arg1_, \
u32_t hdlr_ ## name_(u32_t arg1_, \
u32_t arg2_, \
u32_t arg3_, \
u32_t arg4 __unused, \
@ -532,7 +532,7 @@ static inline int _obj_validation_check(struct _k_object *ko, @@ -532,7 +532,7 @@ static inline int _obj_validation_check(struct _k_object *ko,
void *ssf)
#define __SYSCALL_HANDLER4(name_, arg1_, arg2_, arg3_, arg4_) \
u32_t _handler_ ## name_(u32_t arg1_, \
u32_t hdlr_ ## name_(u32_t arg1_, \
u32_t arg2_, \
u32_t arg3_, \
u32_t arg4_, \
@ -541,7 +541,7 @@ static inline int _obj_validation_check(struct _k_object *ko, @@ -541,7 +541,7 @@ static inline int _obj_validation_check(struct _k_object *ko,
void *ssf)
#define __SYSCALL_HANDLER5(name_, arg1_, arg2_, arg3_, arg4_, arg5_) \
u32_t _handler_ ## name_(u32_t arg1_, \
u32_t hdlr_ ## name_(u32_t arg1_, \
u32_t arg2_, \
u32_t arg3_, \
u32_t arg4_, \
@ -550,7 +550,7 @@ static inline int _obj_validation_check(struct _k_object *ko, @@ -550,7 +550,7 @@ static inline int _obj_validation_check(struct _k_object *ko,
void *ssf)
#define __SYSCALL_HANDLER6(name_, arg1_, arg2_, arg3_, arg4_, arg5_, arg6_) \
u32_t _handler_ ## name_(u32_t arg1_, \
u32_t hdlr_ ## name_(u32_t arg1_, \
u32_t arg2_, \
u32_t arg3_, \
u32_t arg4_, \

2
scripts/gen_syscall_header.py

@ -70,7 +70,7 @@ def gen_make_syscall(ret, argc, tabcount): @@ -70,7 +70,7 @@ def gen_make_syscall(ret, argc, tabcount):
# from gc-sections; these references will not consume space.
sys.stdout.write(
"static _GENERIC_SECTION(hndlr_ref) __used void *href = (void *)&_handler_##name; \\\n")
"static _GENERIC_SECTION(hndlr_ref) __used void *href = (void *)&hdlr_##name; \\\n")
tabs(tabcount)
if (ret != Retval.VOID):
sys.stdout.write("return (ret)")

2
scripts/gen_syscalls.py

@ -149,7 +149,7 @@ def analyze_fn(match_group): @@ -149,7 +149,7 @@ def analyze_fn(match_group):
invocation = "%s(%s)" % (macro, argslist)
handler = "_handler_" + func_name
handler = "hdlr_" + func_name
# Entry in _k_syscall_table
table_entry = "[%s] = %s" % (sys_id, handler)

Loading…
Cancel
Save