zephyr/include/arch
Andrew Boie a23c245a9a userspace: flesh out internal syscall interface
* Instead of a common system call entry function, we instead create a
table mapping system call ids to handler skeleton functions which are
invoked directly by the architecture code which receives the system
call.

* system call handler prototype specified. All but the most trivial
system calls will implement one of these. They validate all the
arguments, including verifying kernel/device object pointers, ensuring
that the calling thread has appropriate access to any memory buffers
passed in, and performing other parameter checks that the base system
call implementation does not check, or only checks with __ASSERT().

It's only possible to install a system call implementation directly
inside this table if the implementation has a return value and requires
no validation of any of its arguments.

A sample handler implementation for k_mutex_unlock() might look like:

u32_t _syscall_k_mutex_unlock(u32_t mutex_arg, u32_t arg2, u32_t arg3,
                              u32_t arg4, u32_t arg5, void *ssf)
{
        struct k_mutex *mutex = (struct k_mutex *)mutex_arg;
        _SYSCALL_ARG1;

        _SYSCALL_IS_OBJ(mutex, K_OBJ_MUTEX, 0,  ssf);
        _SYSCALL_VERIFY(mutex->lock_count > 0, ssf);
        _SYSCALL_VERIFY(mutex->owner == _current, ssf);

        k_mutex_unlock(mutex);

        return 0;
}

* the x86 port modified to work with the system call table instead of
calling a common handler function. fixed an issue where registers being
changed could confuse the compiler has been fixed; all registers, even
ones used for parameters, must be preserved across the system call.

* a new arch API for producing a kernel oops when validating system call
arguments added. The debug information reported will be from the system
call site and not inside the handler function.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-09-15 13:44:45 -07:00
..
arc k_thread_abort(): assert if abort essential thread 2017-09-07 16:35:16 -07:00
arm arm: corex_m: add byte/half-word sized memory accessors 2017-09-12 11:24:56 -04:00
nios2 k_thread_abort(): assert if abort essential thread 2017-09-07 16:35:16 -07:00
riscv32 k_thread_abort(): assert if abort essential thread 2017-09-07 16:35:16 -07:00
x86 userspace: flesh out internal syscall interface 2017-09-15 13:44:45 -07:00
xtensa k_thread_abort(): assert if abort essential thread 2017-09-07 16:35:16 -07:00
cpu.h Xtensa port: Added support in arch/cpu.h for Xtensa cores. 2017-02-13 08:04:27 -08:00