Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
syscall_handler.h File Reference
#include <zephyr/kernel.h>
#include <zephyr/arch/arch_interface.h>
#include <zephyr/sys/math_extras.h>
#include <stdbool.h>
#include <zephyr/logging/log.h>
#include <zephyr/driver-validation.h>

Go to the source code of this file.

Macros

#define K_OOPS(expr)
 Induce a kernel oops.
 
#define K_SYSCALL_VERIFY_MSG(expr, fmt, ...)
 Runtime expression check for system call arguments.
 
#define K_SYSCALL_VERIFY(expr)
 Runtime expression check for system call arguments.
 
#define K_SYSCALL_MEMORY_SIZE_CHECK(ptr, size)
 Macro to check if size is negative.
 
#define K_SYSCALL_MEMORY(ptr, size, write)
 Runtime check that a user thread has read and/or write permission to a memory area.
 
#define K_SYSCALL_MEMORY_READ(ptr, size)
 Runtime check that a user thread has read permission to a memory area.
 
#define K_SYSCALL_MEMORY_WRITE(ptr, size)
 Runtime check that a user thread has write permission to a memory area.
 
#define K_SYSCALL_MEMORY_ARRAY(ptr, nmemb, size, write)
 
#define K_SYSCALL_MEMORY_ARRAY_READ(ptr, nmemb, size)
 Validate user thread has read permission for sized array.
 
#define K_SYSCALL_MEMORY_ARRAY_WRITE(ptr, nmemb, size)
 Validate user thread has read/write permission for sized array.
 
#define K_SYSCALL_IS_OBJ(ptr, type, init)
 
#define K_SYSCALL_DRIVER_OP(ptr, api_name, op)
 Runtime check driver object pointer for presence of operation.
 
#define K_SYSCALL_SPECIFIC_DRIVER(_device, _dtype, _api)
 Runtime check that device object is of a specific driver type.
 
#define K_SYSCALL_OBJ(ptr, type)
 Runtime check kernel object pointer for non-init functions.
 
#define K_SYSCALL_OBJ_INIT(ptr, type)
 Runtime check kernel object pointer for non-init functions.
 
#define K_SYSCALL_OBJ_NEVER_INIT(ptr, type)
 Runtime check kernel object pointer for non-init functions.
 

Functions

static bool k_is_in_user_syscall (void)
 Return true if we are currently handling a system call from user mode.
 
int k_object_validate (struct k_object *ko, enum k_objects otype, enum _obj_init_check init)
 Ensure a system object is a valid object of the expected type.
 
void k_object_dump_error (int retval, const void *obj, struct k_object *ko, enum k_objects otype)
 Dump out error information on failed k_object_validate() call.
 
struct k_objectk_object_find (const void *obj)
 Kernel object validation function.
 
void k_object_wordlist_foreach (_wordlist_cb_func_t func, void *context)
 Iterate over all the kernel object metadata in the system.
 
void k_thread_perms_inherit (struct k_thread *parent, struct k_thread *child)
 Copy all kernel object permissions from the parent to the child.
 
void k_thread_perms_set (struct k_object *ko, struct k_thread *thread)
 Grant a thread permission to a kernel object.
 
void k_thread_perms_clear (struct k_object *ko, struct k_thread *thread)
 Revoke a thread's permission to a kernel object.
 
void k_thread_perms_all_clear (struct k_thread *thread)
 Revoke access to all objects for the provided thread.
 
void k_object_uninit (const void *obj)
 Clear initialization state of a kernel object.
 
void k_object_recycle (const void *obj)
 Initialize and reset permissions to only access by the caller.
 
static size_t k_usermode_string_nlen (const char *src, size_t maxlen, int *err)
 Obtain the size of a C string passed from user mode.
 
void * k_usermode_alloc_from_copy (const void *src, size_t size)
 Copy data from userspace into a resource pool allocation.
 
int k_usermode_from_copy (void *dst, const void *src, size_t size)
 Copy data from user mode.
 
int k_usermode_to_copy (void *dst, const void *src, size_t size)
 Copy data to user mode.
 
char * k_usermode_string_alloc_copy (const char *src, size_t maxlen)
 Copy a C string from userspace into a resource pool allocation.
 
int k_usermode_string_copy (char *dst, const char *src, size_t maxlen)
 Copy a C string from userspace into a provided buffer.
 
static int k_object_validation_check (struct k_object *ko, const void *obj, enum k_objects otype, enum _obj_init_check init)