kernel: system call handler cleanup

Use new _SYSCALL_OBJ/_SYSCALL_OBJ_INIT macros.

Use new _SYSCALL_MEMORY_READ/_SYSCALL_MEMORY_WRITE macros.

Some non-obvious checks changed to use _SYSCALL_VERIFY_MSG.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2017-10-10 12:30:23 -07:00 committed by Andrew Boie
commit 37ff5a9bc5
12 changed files with 58 additions and 55 deletions

View file

@ -51,8 +51,9 @@ u32_t _handler_k_thread_abort(u32_t thread_p, u32_t arg2, u32_t arg3,
u32_t arg4, u32_t arg5, u32_t arg6, void *ssf)
{
struct k_thread *thread = (struct k_thread *)thread_p;
_SYSCALL_IS_OBJ(thread, K_OBJ_THREAD, 0, ssf);
_SYSCALL_VERIFY(!(thread->base.user_options & K_ESSENTIAL), ssf);
_SYSCALL_OBJ(thread, K_OBJ_THREAD, ssf);
_SYSCALL_VERIFY_MSG(!(thread->base.user_options & K_ESSENTIAL), ssf,
"aborting essential thread %p", thread);
_impl_k_thread_abort((struct k_thread *)thread);
return 0;