syscall: rename Z_SYSCALL_ to K_SYSCALL_
Rename internal API to not use z_/Z_. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
9c1aeb5fd3
commit
9c4d881183
|
@ -239,7 +239,7 @@ implementation of both the subsystem API and the specific APIs:
|
||||||
|
|
||||||
int z_vrfy_specific_from_user(const struct device *dev, int bar)
|
int z_vrfy_specific_from_user(const struct device *dev, int bar)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_SPECIFIC_DRIVER(dev, K_OBJ_DRIVER_GENERIC, &api));
|
Z_OOPS(K_SYSCALL_SPECIFIC_DRIVER(dev, K_OBJ_DRIVER_GENERIC, &api));
|
||||||
return z_impl_specific_do_that(dev, bar)
|
return z_impl_specific_do_that(dev, bar)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -279,24 +279,24 @@ Argument Validation
|
||||||
|
|
||||||
Several macros exist to validate arguments:
|
Several macros exist to validate arguments:
|
||||||
|
|
||||||
* :c:macro:`Z_SYSCALL_OBJ()` Checks a memory address to assert that it is
|
* :c:macro:`K_SYSCALL_OBJ()` Checks a memory address to assert that it is
|
||||||
a valid kernel object of the expected type, that the calling thread
|
a valid kernel object of the expected type, that the calling thread
|
||||||
has permissions on it, and that the object is initialized.
|
has permissions on it, and that the object is initialized.
|
||||||
|
|
||||||
* :c:macro:`Z_SYSCALL_OBJ_INIT()` is the same as
|
* :c:macro:`K_SYSCALL_OBJ_INIT()` is the same as
|
||||||
:c:macro:`Z_SYSCALL_OBJ()`, except that the provided object may be
|
:c:macro:`K_SYSCALL_OBJ()`, except that the provided object may be
|
||||||
uninitialized. This is useful for verifiers of object init functions.
|
uninitialized. This is useful for verifiers of object init functions.
|
||||||
|
|
||||||
* :c:macro:`Z_SYSCALL_OBJ_NEVER_INIT()` is the same as
|
* :c:macro:`K_SYSCALL_OBJ_NEVER_INIT()` is the same as
|
||||||
:c:macro:`Z_SYSCALL_OBJ()`, except that the provided object must be
|
:c:macro:`K_SYSCALL_OBJ()`, except that the provided object must be
|
||||||
uninitialized. This is not used very often, currently only for
|
uninitialized. This is not used very often, currently only for
|
||||||
:c:func:`k_thread_create()`.
|
:c:func:`k_thread_create()`.
|
||||||
|
|
||||||
* :c:macro:`Z_SYSCALL_MEMORY_READ()` validates a memory buffer of a particular
|
* :c:macro:`K_SYSCALL_MEMORY_READ()` validates a memory buffer of a particular
|
||||||
size. The calling thread must have read permissions on the entire buffer.
|
size. The calling thread must have read permissions on the entire buffer.
|
||||||
|
|
||||||
* :c:macro:`Z_SYSCALL_MEMORY_WRITE()` is the same as
|
* :c:macro:`K_SYSCALL_MEMORY_WRITE()` is the same as
|
||||||
:c:macro:`Z_SYSCALL_MEMORY_READ()` but the calling thread must additionally
|
:c:macro:`K_SYSCALL_MEMORY_READ()` but the calling thread must additionally
|
||||||
have write permissions.
|
have write permissions.
|
||||||
|
|
||||||
* :c:macro:`K_SYSCALL_MEMORY_ARRAY_READ()` validates an array whose total size
|
* :c:macro:`K_SYSCALL_MEMORY_ARRAY_READ()` validates an array whose total size
|
||||||
|
@ -315,14 +315,14 @@ Several macros exist to validate arguments:
|
||||||
a message parameter, instead printing the expression tested if it
|
a message parameter, instead printing the expression tested if it
|
||||||
fails. The latter should only be used for the most obvious of tests.
|
fails. The latter should only be used for the most obvious of tests.
|
||||||
|
|
||||||
* :c:macro:`Z_SYSCALL_DRIVER_OP()` checks at runtime if a driver
|
* :c:macro:`K_SYSCALL_DRIVER_OP()` checks at runtime if a driver
|
||||||
instance is capable of performing a particular operation. While this
|
instance is capable of performing a particular operation. While this
|
||||||
macro can be used by itself, it's mostly a building block for macros
|
macro can be used by itself, it's mostly a building block for macros
|
||||||
that are automatically generated for every driver subsystem. For
|
that are automatically generated for every driver subsystem. For
|
||||||
instance, to validate the GPIO driver, one could use the
|
instance, to validate the GPIO driver, one could use the
|
||||||
:c:macro:`Z_SYSCALL_DRIVER_GPIO()` macro.
|
:c:macro:`Z_SYSCALL_DRIVER_GPIO()` macro.
|
||||||
|
|
||||||
* :c:macro:`Z_SYSCALL_SPECIFIC_DRIVER()` is a runtime check to verify that
|
* :c:macro:`K_SYSCALL_SPECIFIC_DRIVER()` is a runtime check to verify that
|
||||||
a provided pointer is a valid instance of a specific device driver, that
|
a provided pointer is a valid instance of a specific device driver, that
|
||||||
the calling thread has permissions on it, and that the driver has been
|
the calling thread has permissions on it, and that the driver has been
|
||||||
initialized. It does this by checking the API structure pointer that
|
initialized. It does this by checking the API structure pointer that
|
||||||
|
@ -357,7 +357,7 @@ For example:
|
||||||
|
|
||||||
static int z_vrfy_k_sem_take(struct k_sem *sem, int32_t timeout)
|
static int z_vrfy_k_sem_take(struct k_sem *sem, int32_t timeout)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(sem, K_OBJ_SEM));
|
Z_OOPS(K_SYSCALL_OBJ(sem, K_OBJ_SEM));
|
||||||
return z_impl_k_sem_take(sem, timeout);
|
return z_impl_k_sem_take(sem, timeout);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_sem_take_mrsh.c>
|
#include <syscalls/k_sem_take_mrsh.c>
|
||||||
|
@ -411,7 +411,7 @@ It might be tempting to do something more concise:
|
||||||
|
|
||||||
int z_vrfy_some_syscall(int *out_param)
|
int z_vrfy_some_syscall(int *out_param)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(out_param, sizeof(*out_param)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(out_param, sizeof(*out_param)));
|
||||||
return z_impl_some_syscall(out_param);
|
return z_impl_some_syscall(out_param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -528,7 +528,7 @@ should never be used to verify if resource allocation has been successful.
|
||||||
Finally, we must consider large data buffers. These represent areas of user
|
Finally, we must consider large data buffers. These represent areas of user
|
||||||
memory which either have data copied out of, or copied into. It is permitted
|
memory which either have data copied out of, or copied into. It is permitted
|
||||||
to pass these pointers to the implementation function directly. The caller's
|
to pass these pointers to the implementation function directly. The caller's
|
||||||
access to the buffer still must be validated with ``Z_SYSCALL_MEMORY`` APIs.
|
access to the buffer still must be validated with ``K_SYSCALL_MEMORY`` APIs.
|
||||||
The following constraints need to be met:
|
The following constraints need to be met:
|
||||||
|
|
||||||
* If the buffer is used by the implementation function to write data, such
|
* If the buffer is used by the implementation function to write data, such
|
||||||
|
@ -549,7 +549,7 @@ The following constraints need to be met:
|
||||||
|
|
||||||
int z_vrfy_get_data_from_kernel(void *buf, size_t size)
|
int z_vrfy_get_data_from_kernel(void *buf, size_t size)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(buf, size));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(buf, size));
|
||||||
return z_impl_get_data_from_kernel(buf, size);
|
return z_impl_get_data_from_kernel(buf, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -565,14 +565,14 @@ conventions are as follows:
|
||||||
missing system calls are routed to :c:func:`handler_no_syscall()` which
|
missing system calls are routed to :c:func:`handler_no_syscall()` which
|
||||||
invokes :c:macro:`Z_OOPS()`.
|
invokes :c:macro:`Z_OOPS()`.
|
||||||
|
|
||||||
#. Any invalid access to memory found by the set of ``Z_SYSCALL_MEMORY`` APIs,
|
#. Any invalid access to memory found by the set of ``K_SYSCALL_MEMORY`` APIs,
|
||||||
:c:func:`k_usermode_from_copy()`, :c:func:`k_usermode_to_copy()`
|
:c:func:`k_usermode_from_copy()`, :c:func:`k_usermode_to_copy()`
|
||||||
should trigger a :c:macro:`Z_OOPS`. This happens when the caller doesn't have
|
should trigger a :c:macro:`Z_OOPS`. This happens when the caller doesn't have
|
||||||
appropriate permissions on the memory buffer or some size calculation
|
appropriate permissions on the memory buffer or some size calculation
|
||||||
overflowed.
|
overflowed.
|
||||||
|
|
||||||
#. Most system calls take kernel object pointers as an argument, checked either
|
#. Most system calls take kernel object pointers as an argument, checked either
|
||||||
with one of the ``Z_SYSCALL_OBJ`` functions, ``Z_SYSCALL_DRIVER_nnnnn``, or
|
with one of the ``K_SYSCALL_OBJ`` functions, ``Z_SYSCALL_DRIVER_nnnnn``, or
|
||||||
manually using :c:func:`k_object_validate()`. These can fail for a variety
|
manually using :c:func:`k_object_validate()`. These can fail for a variety
|
||||||
of reasons: missing driver API, bad kernel object pointer, wrong kernel
|
of reasons: missing driver API, bad kernel object pointer, wrong kernel
|
||||||
object type, or improper initialization state. These issues should always
|
object type, or improper initialization state. These issues should always
|
||||||
|
@ -632,12 +632,12 @@ APIs
|
||||||
Helper macros for creating system call verification functions are provided in
|
Helper macros for creating system call verification functions are provided in
|
||||||
:zephyr_file:`include/zephyr/internal/syscall_handler.h`:
|
:zephyr_file:`include/zephyr/internal/syscall_handler.h`:
|
||||||
|
|
||||||
* :c:macro:`Z_SYSCALL_OBJ()`
|
* :c:macro:`K_SYSCALL_OBJ()`
|
||||||
* :c:macro:`Z_SYSCALL_OBJ_INIT()`
|
* :c:macro:`K_SYSCALL_OBJ_INIT()`
|
||||||
* :c:macro:`Z_SYSCALL_OBJ_NEVER_INIT()`
|
* :c:macro:`K_SYSCALL_OBJ_NEVER_INIT()`
|
||||||
* :c:macro:`Z_OOPS()`
|
* :c:macro:`Z_OOPS()`
|
||||||
* :c:macro:`Z_SYSCALL_MEMORY_READ()`
|
* :c:macro:`K_SYSCALL_MEMORY_READ()`
|
||||||
* :c:macro:`Z_SYSCALL_MEMORY_WRITE()`
|
* :c:macro:`K_SYSCALL_MEMORY_WRITE()`
|
||||||
* :c:macro:`K_SYSCALL_MEMORY_ARRAY_READ()`
|
* :c:macro:`K_SYSCALL_MEMORY_ARRAY_READ()`
|
||||||
* :c:macro:`K_SYSCALL_MEMORY_ARRAY_WRITE()`
|
* :c:macro:`K_SYSCALL_MEMORY_ARRAY_WRITE()`
|
||||||
* :c:macro:`K_SYSCALL_VERIFY_MSG()`
|
* :c:macro:`K_SYSCALL_VERIFY_MSG()`
|
||||||
|
|
|
@ -41,7 +41,7 @@ static bool copy_sequence(struct adc_sequence *dst,
|
||||||
dst->options = options;
|
dst->options = options;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Z_SYSCALL_MEMORY_WRITE(dst->buffer, dst->buffer_size) != 0) {
|
if (K_SYSCALL_MEMORY_WRITE(dst->buffer, dst->buffer_size) != 0) {
|
||||||
printk("no access to buffer memory\n");
|
printk("no access to buffer memory\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ static inline int z_vrfy_adc_read_async(const struct device *dev,
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(sequence.options->callback == NULL,
|
Z_OOPS(K_SYSCALL_VERIFY_MSG(sequence.options->callback == NULL,
|
||||||
"ADC sequence callbacks forbidden from user mode"));
|
"ADC sequence callbacks forbidden from user mode"));
|
||||||
}
|
}
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(async, K_OBJ_POLL_SIGNAL));
|
Z_OOPS(K_SYSCALL_OBJ(async, K_OBJ_POLL_SIGNAL));
|
||||||
|
|
||||||
return z_impl_adc_read_async((const struct device *)dev, &sequence,
|
return z_impl_adc_read_async((const struct device *)dev, &sequence,
|
||||||
(struct k_poll_signal *)async);
|
(struct k_poll_signal *)async);
|
||||||
|
|
|
@ -9,21 +9,21 @@
|
||||||
|
|
||||||
static inline int z_vrfy_auxdisplay_display_on(const struct device *dev)
|
static inline int z_vrfy_auxdisplay_display_on(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
||||||
return z_impl_auxdisplay_display_on(dev);
|
return z_impl_auxdisplay_display_on(dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/auxdisplay_display_on_mrsh.c>
|
#include <syscalls/auxdisplay_display_on_mrsh.c>
|
||||||
|
|
||||||
static inline int z_vrfy_auxdisplay_display_off(const struct device *dev)
|
static inline int z_vrfy_auxdisplay_display_off(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
||||||
return z_impl_auxdisplay_display_off(dev);
|
return z_impl_auxdisplay_display_off(dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/auxdisplay_display_off_mrsh.c>
|
#include <syscalls/auxdisplay_display_off_mrsh.c>
|
||||||
|
|
||||||
static inline int z_vrfy_auxdisplay_cursor_set_enabled(const struct device *dev, bool enabled)
|
static inline int z_vrfy_auxdisplay_cursor_set_enabled(const struct device *dev, bool enabled)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
||||||
return z_impl_auxdisplay_cursor_set_enabled(dev, enabled);
|
return z_impl_auxdisplay_cursor_set_enabled(dev, enabled);
|
||||||
}
|
}
|
||||||
#include <syscalls/auxdisplay_cursor_set_enabled_mrsh.c>
|
#include <syscalls/auxdisplay_cursor_set_enabled_mrsh.c>
|
||||||
|
@ -31,7 +31,7 @@ static inline int z_vrfy_auxdisplay_cursor_set_enabled(const struct device *dev,
|
||||||
static inline int z_vrfy_auxdisplay_position_blinking_set_enabled(const struct device *dev,
|
static inline int z_vrfy_auxdisplay_position_blinking_set_enabled(const struct device *dev,
|
||||||
bool enabled)
|
bool enabled)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
||||||
return z_impl_auxdisplay_position_blinking_set_enabled(dev, enabled);
|
return z_impl_auxdisplay_position_blinking_set_enabled(dev, enabled);
|
||||||
}
|
}
|
||||||
#include <syscalls/auxdisplay_position_blinking_set_enabled_mrsh.c>
|
#include <syscalls/auxdisplay_position_blinking_set_enabled_mrsh.c>
|
||||||
|
@ -39,7 +39,7 @@ static inline int z_vrfy_auxdisplay_position_blinking_set_enabled(const struct d
|
||||||
static inline int z_vrfy_auxdisplay_cursor_shift_set(const struct device *dev, uint8_t direction,
|
static inline int z_vrfy_auxdisplay_cursor_shift_set(const struct device *dev, uint8_t direction,
|
||||||
bool display_shift)
|
bool display_shift)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
||||||
return z_impl_auxdisplay_cursor_shift_set(dev, direction, display_shift);
|
return z_impl_auxdisplay_cursor_shift_set(dev, direction, display_shift);
|
||||||
}
|
}
|
||||||
#include <syscalls/auxdisplay_cursor_shift_set_mrsh.c>
|
#include <syscalls/auxdisplay_cursor_shift_set_mrsh.c>
|
||||||
|
@ -48,7 +48,7 @@ static inline int z_vrfy_auxdisplay_cursor_position_set(const struct device *dev
|
||||||
enum auxdisplay_position type,
|
enum auxdisplay_position type,
|
||||||
int16_t x, int16_t y)
|
int16_t x, int16_t y)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
||||||
return z_impl_auxdisplay_cursor_position_set(dev, type, x, y);
|
return z_impl_auxdisplay_cursor_position_set(dev, type, x, y);
|
||||||
}
|
}
|
||||||
#include <syscalls/auxdisplay_cursor_position_set_mrsh.c>
|
#include <syscalls/auxdisplay_cursor_position_set_mrsh.c>
|
||||||
|
@ -56,7 +56,7 @@ static inline int z_vrfy_auxdisplay_cursor_position_set(const struct device *dev
|
||||||
static inline int z_vrfy_auxdisplay_cursor_position_get(const struct device *dev, int16_t *x,
|
static inline int z_vrfy_auxdisplay_cursor_position_get(const struct device *dev, int16_t *x,
|
||||||
int16_t *y)
|
int16_t *y)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
||||||
return z_impl_auxdisplay_cursor_position_get(dev, x, y);
|
return z_impl_auxdisplay_cursor_position_get(dev, x, y);
|
||||||
}
|
}
|
||||||
#include <syscalls/auxdisplay_cursor_position_get_mrsh.c>
|
#include <syscalls/auxdisplay_cursor_position_get_mrsh.c>
|
||||||
|
@ -65,7 +65,7 @@ static inline int z_vrfy_auxdisplay_display_position_set(const struct device *de
|
||||||
enum auxdisplay_position type,
|
enum auxdisplay_position type,
|
||||||
int16_t x, int16_t y)
|
int16_t x, int16_t y)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
||||||
return z_impl_auxdisplay_display_position_set(dev, type, x, y);
|
return z_impl_auxdisplay_display_position_set(dev, type, x, y);
|
||||||
}
|
}
|
||||||
#include <syscalls/auxdisplay_display_position_set_mrsh.c>
|
#include <syscalls/auxdisplay_display_position_set_mrsh.c>
|
||||||
|
@ -73,7 +73,7 @@ static inline int z_vrfy_auxdisplay_display_position_set(const struct device *de
|
||||||
static inline int z_vrfy_auxdisplay_display_position_get(const struct device *dev, int16_t *x,
|
static inline int z_vrfy_auxdisplay_display_position_get(const struct device *dev, int16_t *x,
|
||||||
int16_t *y)
|
int16_t *y)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
||||||
return z_impl_auxdisplay_display_position_get(dev, x, y);
|
return z_impl_auxdisplay_display_position_get(dev, x, y);
|
||||||
}
|
}
|
||||||
#include <syscalls/auxdisplay_display_position_get_mrsh.c>
|
#include <syscalls/auxdisplay_display_position_get_mrsh.c>
|
||||||
|
@ -81,14 +81,14 @@ static inline int z_vrfy_auxdisplay_display_position_get(const struct device *de
|
||||||
static inline int z_vrfy_auxdisplay_capabilities_get(const struct device *dev,
|
static inline int z_vrfy_auxdisplay_capabilities_get(const struct device *dev,
|
||||||
struct auxdisplay_capabilities *capabilities)
|
struct auxdisplay_capabilities *capabilities)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
||||||
return z_impl_auxdisplay_capabilities_get(dev, capabilities);
|
return z_impl_auxdisplay_capabilities_get(dev, capabilities);
|
||||||
}
|
}
|
||||||
#include <syscalls/auxdisplay_capabilities_get_mrsh.c>
|
#include <syscalls/auxdisplay_capabilities_get_mrsh.c>
|
||||||
|
|
||||||
static inline int z_vrfy_auxdisplay_clear(const struct device *dev)
|
static inline int z_vrfy_auxdisplay_clear(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
||||||
return z_impl_auxdisplay_clear(dev);
|
return z_impl_auxdisplay_clear(dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/auxdisplay_clear_mrsh.c>
|
#include <syscalls/auxdisplay_clear_mrsh.c>
|
||||||
|
@ -96,7 +96,7 @@ static inline int z_vrfy_auxdisplay_clear(const struct device *dev)
|
||||||
static inline int z_vrfy_auxdisplay_brightness_get(const struct device *dev,
|
static inline int z_vrfy_auxdisplay_brightness_get(const struct device *dev,
|
||||||
uint8_t *brightness)
|
uint8_t *brightness)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
||||||
return z_impl_auxdisplay_brightness_get(dev, brightness);
|
return z_impl_auxdisplay_brightness_get(dev, brightness);
|
||||||
}
|
}
|
||||||
#include <syscalls/auxdisplay_brightness_get_mrsh.c>
|
#include <syscalls/auxdisplay_brightness_get_mrsh.c>
|
||||||
|
@ -104,7 +104,7 @@ static inline int z_vrfy_auxdisplay_brightness_get(const struct device *dev,
|
||||||
static inline int z_vrfy_auxdisplay_brightness_set(const struct device *dev,
|
static inline int z_vrfy_auxdisplay_brightness_set(const struct device *dev,
|
||||||
uint8_t brightness)
|
uint8_t brightness)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
||||||
return z_impl_auxdisplay_brightness_set(dev, brightness);
|
return z_impl_auxdisplay_brightness_set(dev, brightness);
|
||||||
}
|
}
|
||||||
#include <syscalls/auxdisplay_brightness_set_mrsh.c>
|
#include <syscalls/auxdisplay_brightness_set_mrsh.c>
|
||||||
|
@ -112,7 +112,7 @@ static inline int z_vrfy_auxdisplay_brightness_set(const struct device *dev,
|
||||||
static inline int z_vrfy_auxdisplay_backlight_get(const struct device *dev,
|
static inline int z_vrfy_auxdisplay_backlight_get(const struct device *dev,
|
||||||
uint8_t *backlight)
|
uint8_t *backlight)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
||||||
return z_impl_auxdisplay_backlight_get(dev, backlight);
|
return z_impl_auxdisplay_backlight_get(dev, backlight);
|
||||||
}
|
}
|
||||||
#include <syscalls/auxdisplay_backlight_get_mrsh.c>
|
#include <syscalls/auxdisplay_backlight_get_mrsh.c>
|
||||||
|
@ -120,14 +120,14 @@ static inline int z_vrfy_auxdisplay_backlight_get(const struct device *dev,
|
||||||
static inline int z_vrfy_auxdisplay_backlight_set(const struct device *dev,
|
static inline int z_vrfy_auxdisplay_backlight_set(const struct device *dev,
|
||||||
uint8_t backlight)
|
uint8_t backlight)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
||||||
return z_impl_auxdisplay_backlight_set(dev, backlight);
|
return z_impl_auxdisplay_backlight_set(dev, backlight);
|
||||||
}
|
}
|
||||||
#include <syscalls/auxdisplay_backlight_set_mrsh.c>
|
#include <syscalls/auxdisplay_backlight_set_mrsh.c>
|
||||||
|
|
||||||
static inline int z_vrfy_auxdisplay_is_busy(const struct device *dev)
|
static inline int z_vrfy_auxdisplay_is_busy(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
||||||
return z_impl_auxdisplay_is_busy(dev);
|
return z_impl_auxdisplay_is_busy(dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/auxdisplay_is_busy_mrsh.c>
|
#include <syscalls/auxdisplay_is_busy_mrsh.c>
|
||||||
|
@ -135,7 +135,7 @@ static inline int z_vrfy_auxdisplay_is_busy(const struct device *dev)
|
||||||
static inline int z_vrfy_auxdisplay_custom_character_set(const struct device *dev,
|
static inline int z_vrfy_auxdisplay_custom_character_set(const struct device *dev,
|
||||||
struct auxdisplay_character *character)
|
struct auxdisplay_character *character)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
||||||
return z_impl_auxdisplay_custom_character_set(dev, character);
|
return z_impl_auxdisplay_custom_character_set(dev, character);
|
||||||
}
|
}
|
||||||
#include <syscalls/auxdisplay_custom_character_set_mrsh.c>
|
#include <syscalls/auxdisplay_custom_character_set_mrsh.c>
|
||||||
|
@ -143,7 +143,7 @@ static inline int z_vrfy_auxdisplay_custom_character_set(const struct device *de
|
||||||
static inline int z_vrfy_auxdisplay_write(const struct device *dev, const uint8_t *data,
|
static inline int z_vrfy_auxdisplay_write(const struct device *dev, const uint8_t *data,
|
||||||
uint16_t len)
|
uint16_t len)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
||||||
return z_impl_auxdisplay_write(dev, data, len);
|
return z_impl_auxdisplay_write(dev, data, len);
|
||||||
}
|
}
|
||||||
#include <syscalls/auxdisplay_write_mrsh.c>
|
#include <syscalls/auxdisplay_write_mrsh.c>
|
||||||
|
@ -151,7 +151,7 @@ static inline int z_vrfy_auxdisplay_write(const struct device *dev, const uint8_
|
||||||
static inline int z_vrfy_auxdisplay_custom_command(const struct device *dev,
|
static inline int z_vrfy_auxdisplay_custom_command(const struct device *dev,
|
||||||
struct auxdisplay_custom_data *data)
|
struct auxdisplay_custom_data *data)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
||||||
return z_impl_auxdisplay_custom_command(dev, data);
|
return z_impl_auxdisplay_custom_command(dev, data);
|
||||||
}
|
}
|
||||||
#include <syscalls/auxdisplay_custom_command_mrsh.c>
|
#include <syscalls/auxdisplay_custom_command_mrsh.c>
|
||||||
|
|
|
@ -9,29 +9,29 @@
|
||||||
|
|
||||||
static inline int z_vrfy_bbram_check_invalid(const struct device *dev)
|
static inline int z_vrfy_bbram_check_invalid(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
||||||
return z_impl_bbram_check_invalid(dev);
|
return z_impl_bbram_check_invalid(dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/bbram_check_invalid_mrsh.c>
|
#include <syscalls/bbram_check_invalid_mrsh.c>
|
||||||
|
|
||||||
static inline int z_vrfy_bbram_check_standby_power(const struct device *dev)
|
static inline int z_vrfy_bbram_check_standby_power(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
||||||
return z_impl_bbram_check_standby_power(dev);
|
return z_impl_bbram_check_standby_power(dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/bbram_check_standby_power_mrsh.c>
|
#include <syscalls/bbram_check_standby_power_mrsh.c>
|
||||||
|
|
||||||
static inline int z_vrfy_bbram_check_power(const struct device *dev)
|
static inline int z_vrfy_bbram_check_power(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
||||||
return z_impl_bbram_check_power(dev);
|
return z_impl_bbram_check_power(dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/bbram_check_power_mrsh.c>
|
#include <syscalls/bbram_check_power_mrsh.c>
|
||||||
|
|
||||||
static inline int z_vrfy_bbram_get_size(const struct device *dev, size_t *size)
|
static inline int z_vrfy_bbram_get_size(const struct device *dev, size_t *size)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(size, sizeof(size_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(size, sizeof(size_t)));
|
||||||
return z_impl_bbram_get_size(dev, size);
|
return z_impl_bbram_get_size(dev, size);
|
||||||
}
|
}
|
||||||
#include <syscalls/bbram_get_size_mrsh.c>
|
#include <syscalls/bbram_get_size_mrsh.c>
|
||||||
|
@ -39,8 +39,8 @@ static inline int z_vrfy_bbram_get_size(const struct device *dev, size_t *size)
|
||||||
static inline int z_vrfy_bbram_read(const struct device *dev, size_t offset,
|
static inline int z_vrfy_bbram_read(const struct device *dev, size_t offset,
|
||||||
size_t size, uint8_t *data)
|
size_t size, uint8_t *data)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(data, size));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(data, size));
|
||||||
return z_impl_bbram_read(dev, offset, size, data);
|
return z_impl_bbram_read(dev, offset, size, data);
|
||||||
}
|
}
|
||||||
#include <syscalls/bbram_read_mrsh.c>
|
#include <syscalls/bbram_read_mrsh.c>
|
||||||
|
@ -48,8 +48,8 @@ static inline int z_vrfy_bbram_read(const struct device *dev, size_t offset,
|
||||||
static inline int z_vrfy_bbram_write(const struct device *dev, size_t offset,
|
static inline int z_vrfy_bbram_write(const struct device *dev, size_t offset,
|
||||||
size_t size, const uint8_t *data)
|
size_t size, const uint8_t *data)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(data, size));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(data, size));
|
||||||
return z_impl_bbram_write(dev, offset, size, data);
|
return z_impl_bbram_write(dev, offset, size, data);
|
||||||
}
|
}
|
||||||
#include <syscalls/bbram_write_mrsh.c>
|
#include <syscalls/bbram_write_mrsh.c>
|
||||||
|
|
6
drivers/cache/cache_handlers.c
vendored
6
drivers/cache/cache_handlers.c
vendored
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
static inline int z_vrfy_sys_cache_data_flush_range(void *addr, size_t size)
|
static inline int z_vrfy_sys_cache_data_flush_range(void *addr, size_t size)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(addr, size));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(addr, size));
|
||||||
|
|
||||||
return z_impl_sys_cache_data_flush_range(addr, size);
|
return z_impl_sys_cache_data_flush_range(addr, size);
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ static inline int z_vrfy_sys_cache_data_flush_range(void *addr, size_t size)
|
||||||
|
|
||||||
static inline int z_vrfy_sys_cache_data_invd_range(void *addr, size_t size)
|
static inline int z_vrfy_sys_cache_data_invd_range(void *addr, size_t size)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(addr, size));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(addr, size));
|
||||||
|
|
||||||
return z_impl_sys_cache_data_invd_range(addr, size);
|
return z_impl_sys_cache_data_invd_range(addr, size);
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ static inline int z_vrfy_sys_cache_data_invd_range(void *addr, size_t size)
|
||||||
|
|
||||||
static inline int z_vrfy_sys_cache_data_flush_and_invd_range(void *addr, size_t size)
|
static inline int z_vrfy_sys_cache_data_flush_and_invd_range(void *addr, size_t size)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(addr, size));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(addr, size));
|
||||||
|
|
||||||
return z_impl_sys_cache_data_flush_and_invd_range(addr, size);
|
return z_impl_sys_cache_data_flush_and_invd_range(addr, size);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ static inline int z_vrfy_can_get_core_clock(const struct device *dev,
|
||||||
uint32_t *rate)
|
uint32_t *rate)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_CAN(dev, get_core_clock));
|
Z_OOPS(Z_SYSCALL_DRIVER_CAN(dev, get_core_clock));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(rate, sizeof(*rate)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(rate, sizeof(*rate)));
|
||||||
|
|
||||||
return z_impl_can_get_core_clock(dev, rate);
|
return z_impl_can_get_core_clock(dev, rate);
|
||||||
}
|
}
|
||||||
|
@ -49,8 +49,8 @@ static inline int z_vrfy_can_get_max_bitrate(const struct device *dev,
|
||||||
uint32_t *max_bitrate)
|
uint32_t *max_bitrate)
|
||||||
{
|
{
|
||||||
/* Optional API function */
|
/* Optional API function */
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_CAN));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_CAN));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(max_bitrate, sizeof(*max_bitrate)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(max_bitrate, sizeof(*max_bitrate)));
|
||||||
|
|
||||||
return z_impl_can_get_max_bitrate(dev, max_bitrate);
|
return z_impl_can_get_max_bitrate(dev, max_bitrate);
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ static inline int z_vrfy_can_get_max_bitrate(const struct device *dev,
|
||||||
|
|
||||||
static inline const struct can_timing *z_vrfy_can_get_timing_min(const struct device *dev)
|
static inline const struct can_timing *z_vrfy_can_get_timing_min(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_CAN));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_CAN));
|
||||||
|
|
||||||
return z_impl_can_get_timing_min(dev);
|
return z_impl_can_get_timing_min(dev);
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ static inline const struct can_timing *z_vrfy_can_get_timing_min(const struct de
|
||||||
|
|
||||||
static inline const struct can_timing *z_vrfy_can_get_timing_max(const struct device *dev)
|
static inline const struct can_timing *z_vrfy_can_get_timing_max(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_CAN));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_CAN));
|
||||||
|
|
||||||
return z_impl_can_get_timing_max(dev);
|
return z_impl_can_get_timing_max(dev);
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ static int z_vrfy_can_calc_timing_data(const struct device *dev, struct can_timi
|
||||||
|
|
||||||
static inline const struct can_timing *z_vrfy_can_get_timing_data_min(const struct device *dev)
|
static inline const struct can_timing *z_vrfy_can_get_timing_data_min(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_CAN));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_CAN));
|
||||||
|
|
||||||
return z_impl_can_get_timing_data_min(dev);
|
return z_impl_can_get_timing_data_min(dev);
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ static inline const struct can_timing *z_vrfy_can_get_timing_data_min(const stru
|
||||||
|
|
||||||
static inline const struct can_timing *z_vrfy_can_get_timing_data_max(const struct device *dev)
|
static inline const struct can_timing *z_vrfy_can_get_timing_data_max(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_CAN));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_CAN));
|
||||||
|
|
||||||
return z_impl_can_get_timing_data_max(dev);
|
return z_impl_can_get_timing_data_max(dev);
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ static inline int z_vrfy_can_set_bitrate_data(const struct device *dev,
|
||||||
static inline int z_vrfy_can_get_max_filters(const struct device *dev, bool ide)
|
static inline int z_vrfy_can_get_max_filters(const struct device *dev, bool ide)
|
||||||
{
|
{
|
||||||
/* Optional API function */
|
/* Optional API function */
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_CAN));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_CAN));
|
||||||
|
|
||||||
return z_impl_can_get_max_filters(dev, ide);
|
return z_impl_can_get_max_filters(dev, ide);
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ static inline int z_vrfy_can_get_max_filters(const struct device *dev, bool ide)
|
||||||
static inline int z_vrfy_can_get_capabilities(const struct device *dev, can_mode_t *cap)
|
static inline int z_vrfy_can_get_capabilities(const struct device *dev, can_mode_t *cap)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_CAN(dev, get_capabilities));
|
Z_OOPS(Z_SYSCALL_DRIVER_CAN(dev, get_capabilities));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(cap, sizeof(*cap)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(cap, sizeof(*cap)));
|
||||||
|
|
||||||
return z_impl_can_get_capabilities(dev, cap);
|
return z_impl_can_get_capabilities(dev, cap);
|
||||||
}
|
}
|
||||||
|
@ -202,7 +202,7 @@ static inline int z_vrfy_can_add_rx_filter_msgq(const struct device *dev,
|
||||||
struct can_filter filter_copy;
|
struct can_filter filter_copy;
|
||||||
|
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_CAN(dev, add_rx_filter));
|
Z_OOPS(Z_SYSCALL_DRIVER_CAN(dev, add_rx_filter));
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
Z_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
||||||
Z_OOPS(k_usermode_from_copy(&filter_copy, filter, sizeof(filter_copy)));
|
Z_OOPS(k_usermode_from_copy(&filter_copy, filter, sizeof(filter_copy)));
|
||||||
|
|
||||||
return z_impl_can_add_rx_filter_msgq(dev, msgq, &filter_copy);
|
return z_impl_can_add_rx_filter_msgq(dev, msgq, &filter_copy);
|
||||||
|
@ -223,11 +223,11 @@ static inline int z_vrfy_can_get_state(const struct device *dev, enum can_state
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_CAN(dev, get_state));
|
Z_OOPS(Z_SYSCALL_DRIVER_CAN(dev, get_state));
|
||||||
|
|
||||||
if (state != NULL) {
|
if (state != NULL) {
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(state, sizeof(*state)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(state, sizeof(*state)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err_cnt != NULL) {
|
if (err_cnt != NULL) {
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(err_cnt, sizeof(*err_cnt)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(err_cnt, sizeof(*err_cnt)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return z_impl_can_get_state(dev, state, err_cnt);
|
return z_impl_can_get_state(dev, state, err_cnt);
|
||||||
|
|
|
@ -27,21 +27,21 @@ COUNTER_HANDLER(start)
|
||||||
|
|
||||||
static inline bool z_vrfy_counter_is_counting_up(const struct device *dev)
|
static inline bool z_vrfy_counter_is_counting_up(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_COUNTER));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_COUNTER));
|
||||||
return z_impl_counter_is_counting_up((const struct device *)dev);
|
return z_impl_counter_is_counting_up((const struct device *)dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/counter_is_counting_up_mrsh.c>
|
#include <syscalls/counter_is_counting_up_mrsh.c>
|
||||||
|
|
||||||
static inline uint8_t z_vrfy_counter_get_num_of_channels(const struct device *dev)
|
static inline uint8_t z_vrfy_counter_get_num_of_channels(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_COUNTER));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_COUNTER));
|
||||||
return z_impl_counter_get_num_of_channels((const struct device *)dev);
|
return z_impl_counter_get_num_of_channels((const struct device *)dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/counter_get_num_of_channels_mrsh.c>
|
#include <syscalls/counter_get_num_of_channels_mrsh.c>
|
||||||
|
|
||||||
static inline uint32_t z_vrfy_counter_get_frequency(const struct device *dev)
|
static inline uint32_t z_vrfy_counter_get_frequency(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_COUNTER));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_COUNTER));
|
||||||
return z_impl_counter_get_frequency((const struct device *)dev);
|
return z_impl_counter_get_frequency((const struct device *)dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/counter_get_frequency_mrsh.c>
|
#include <syscalls/counter_get_frequency_mrsh.c>
|
||||||
|
@ -49,7 +49,7 @@ static inline uint32_t z_vrfy_counter_get_frequency(const struct device *dev)
|
||||||
static inline uint32_t z_vrfy_counter_us_to_ticks(const struct device *dev,
|
static inline uint32_t z_vrfy_counter_us_to_ticks(const struct device *dev,
|
||||||
uint64_t us)
|
uint64_t us)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_COUNTER));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_COUNTER));
|
||||||
return z_impl_counter_us_to_ticks((const struct device *)dev,
|
return z_impl_counter_us_to_ticks((const struct device *)dev,
|
||||||
(uint64_t)us);
|
(uint64_t)us);
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ static inline uint32_t z_vrfy_counter_us_to_ticks(const struct device *dev,
|
||||||
static inline uint64_t z_vrfy_counter_ticks_to_us(const struct device *dev,
|
static inline uint64_t z_vrfy_counter_ticks_to_us(const struct device *dev,
|
||||||
uint32_t ticks)
|
uint32_t ticks)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_COUNTER));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_COUNTER));
|
||||||
return z_impl_counter_ticks_to_us((const struct device *)dev,
|
return z_impl_counter_ticks_to_us((const struct device *)dev,
|
||||||
(uint32_t)ticks);
|
(uint32_t)ticks);
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ static inline int z_vrfy_counter_get_value(const struct device *dev,
|
||||||
uint32_t *ticks)
|
uint32_t *ticks)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_COUNTER(dev, get_value));
|
Z_OOPS(Z_SYSCALL_DRIVER_COUNTER(dev, get_value));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(ticks, sizeof(*ticks)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(ticks, sizeof(*ticks)));
|
||||||
return z_impl_counter_get_value((const struct device *)dev, ticks);
|
return z_impl_counter_get_value((const struct device *)dev, ticks);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ static inline int z_vrfy_counter_get_value_64(const struct device *dev,
|
||||||
uint64_t *ticks)
|
uint64_t *ticks)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_COUNTER(dev, get_value_64));
|
Z_OOPS(Z_SYSCALL_DRIVER_COUNTER(dev, get_value_64));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(ticks, sizeof(*ticks)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(ticks, sizeof(*ticks)));
|
||||||
return z_impl_counter_get_value_64((const struct device *)dev, ticks);
|
return z_impl_counter_get_value_64((const struct device *)dev, ticks);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ static inline uint32_t z_vrfy_counter_get_top_value(const struct device *dev)
|
||||||
|
|
||||||
static inline uint32_t z_vrfy_counter_get_max_top_value(const struct device *dev)
|
static inline uint32_t z_vrfy_counter_get_max_top_value(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_COUNTER));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_COUNTER));
|
||||||
return z_impl_counter_get_max_top_value((const struct device *)dev);
|
return z_impl_counter_get_max_top_value((const struct device *)dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/counter_get_max_top_value_mrsh.c>
|
#include <syscalls/counter_get_max_top_value_mrsh.c>
|
||||||
|
@ -141,7 +141,7 @@ static inline uint32_t z_vrfy_counter_get_max_top_value(const struct device *dev
|
||||||
static inline uint32_t z_vrfy_counter_get_guard_period(const struct device *dev,
|
static inline uint32_t z_vrfy_counter_get_guard_period(const struct device *dev,
|
||||||
uint32_t flags)
|
uint32_t flags)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_COUNTER));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_COUNTER));
|
||||||
return z_impl_counter_get_guard_period((const struct device *)dev,
|
return z_impl_counter_get_guard_period((const struct device *)dev,
|
||||||
flags);
|
flags);
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ static inline uint32_t z_vrfy_counter_get_guard_period(const struct device *dev,
|
||||||
static inline int z_vrfy_counter_set_guard_period(const struct device *dev,
|
static inline int z_vrfy_counter_set_guard_period(const struct device *dev,
|
||||||
uint32_t ticks, uint32_t flags)
|
uint32_t ticks, uint32_t flags)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_COUNTER));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_COUNTER));
|
||||||
return z_impl_counter_set_guard_period((const struct device *)dev,
|
return z_impl_counter_set_guard_period((const struct device *)dev,
|
||||||
ticks,
|
ticks,
|
||||||
flags);
|
flags);
|
||||||
|
|
|
@ -1308,8 +1308,8 @@ int z_vrfy_maxim_ds3231_get_syncpoint(const struct device *dev,
|
||||||
struct maxim_ds3231_syncpoint value;
|
struct maxim_ds3231_syncpoint value;
|
||||||
int rv;
|
int rv;
|
||||||
|
|
||||||
Z_OOPS(Z_SYSCALL_SPECIFIC_DRIVER(dev, K_OBJ_DRIVER_COUNTER, &ds3231_api));
|
Z_OOPS(K_SYSCALL_SPECIFIC_DRIVER(dev, K_OBJ_DRIVER_COUNTER, &ds3231_api));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(syncpoint, sizeof(*syncpoint)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(syncpoint, sizeof(*syncpoint)));
|
||||||
|
|
||||||
rv = z_impl_maxim_ds3231_get_syncpoint(dev, &value);
|
rv = z_impl_maxim_ds3231_get_syncpoint(dev, &value);
|
||||||
|
|
||||||
|
@ -1325,9 +1325,9 @@ int z_vrfy_maxim_ds3231_get_syncpoint(const struct device *dev,
|
||||||
int z_vrfy_maxim_ds3231_req_syncpoint(const struct device *dev,
|
int z_vrfy_maxim_ds3231_req_syncpoint(const struct device *dev,
|
||||||
struct k_poll_signal *sig)
|
struct k_poll_signal *sig)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_SPECIFIC_DRIVER(dev, K_OBJ_DRIVER_COUNTER, &ds3231_api));
|
Z_OOPS(K_SYSCALL_SPECIFIC_DRIVER(dev, K_OBJ_DRIVER_COUNTER, &ds3231_api));
|
||||||
if (sig != NULL) {
|
if (sig != NULL) {
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(sig, K_OBJ_POLL_SIGNAL));
|
Z_OOPS(K_SYSCALL_OBJ(sig, K_OBJ_POLL_SIGNAL));
|
||||||
}
|
}
|
||||||
|
|
||||||
return z_impl_maxim_ds3231_req_syncpoint(dev, sig);
|
return z_impl_maxim_ds3231_req_syncpoint(dev, sig);
|
||||||
|
|
|
@ -11,7 +11,7 @@ static inline int z_vrfy_eeprom_read(const struct device *dev, off_t offset,
|
||||||
void *data, size_t len)
|
void *data, size_t len)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_EEPROM(dev, read));
|
Z_OOPS(Z_SYSCALL_DRIVER_EEPROM(dev, read));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(data, len));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(data, len));
|
||||||
return z_impl_eeprom_read((const struct device *)dev, offset,
|
return z_impl_eeprom_read((const struct device *)dev, offset,
|
||||||
(void *)data,
|
(void *)data,
|
||||||
len);
|
len);
|
||||||
|
@ -22,7 +22,7 @@ static inline int z_vrfy_eeprom_write(const struct device *dev, off_t offset,
|
||||||
const void *data, size_t len)
|
const void *data, size_t len)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_EEPROM(dev, write));
|
Z_OOPS(Z_SYSCALL_DRIVER_EEPROM(dev, write));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(data, len));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(data, len));
|
||||||
return z_impl_eeprom_write((const struct device *)dev, offset,
|
return z_impl_eeprom_write((const struct device *)dev, offset,
|
||||||
(const void *)data, len);
|
(const void *)data, len);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ static inline int z_vrfy_entropy_get_entropy(const struct device *dev,
|
||||||
uint16_t len)
|
uint16_t len)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_ENTROPY(dev, get_entropy));
|
Z_OOPS(Z_SYSCALL_DRIVER_ENTROPY(dev, get_entropy));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(buffer, len));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(buffer, len));
|
||||||
return z_impl_entropy_get_entropy((const struct device *)dev,
|
return z_impl_entropy_get_entropy((const struct device *)dev,
|
||||||
(uint8_t *)buffer,
|
(uint8_t *)buffer,
|
||||||
len);
|
len);
|
||||||
|
|
|
@ -94,7 +94,7 @@ static inline int z_vrfy_espi_read_request(const struct device *dev,
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_ESPI(dev, read_request));
|
Z_OOPS(Z_SYSCALL_DRIVER_ESPI(dev, read_request));
|
||||||
Z_OOPS(k_usermode_from_copy(&req_copy, req,
|
Z_OOPS(k_usermode_from_copy(&req_copy, req,
|
||||||
sizeof(struct espi_request_packet)));
|
sizeof(struct espi_request_packet)));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(req_copy.data, req_copy.len));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(req_copy.data, req_copy.len));
|
||||||
|
|
||||||
ret = z_impl_espi_read_request(dev, &req_copy);
|
ret = z_impl_espi_read_request(dev, &req_copy);
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ static inline int z_vrfy_espi_write_request(const struct device *dev,
|
||||||
struct espi_request_packet req_copy;
|
struct espi_request_packet req_copy;
|
||||||
|
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_ESPI(dev, write_request));
|
Z_OOPS(Z_SYSCALL_DRIVER_ESPI(dev, write_request));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(req->data, req->len));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(req->data, req->len));
|
||||||
Z_OOPS(k_usermode_from_copy(&req_copy, req,
|
Z_OOPS(k_usermode_from_copy(&req_copy, req,
|
||||||
sizeof(struct espi_request_packet)));
|
sizeof(struct espi_request_packet)));
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ static inline int z_vrfy_espi_send_oob(const struct device *dev,
|
||||||
struct espi_oob_packet pckt_copy;
|
struct espi_oob_packet pckt_copy;
|
||||||
|
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_ESPI(dev, send_oob));
|
Z_OOPS(Z_SYSCALL_DRIVER_ESPI(dev, send_oob));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(pckt->buf, pckt->len));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(pckt->buf, pckt->len));
|
||||||
Z_OOPS(k_usermode_from_copy(&pckt_copy, pckt,
|
Z_OOPS(k_usermode_from_copy(&pckt_copy, pckt,
|
||||||
sizeof(struct espi_oob_packet)));
|
sizeof(struct espi_oob_packet)));
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ static inline int z_vrfy_espi_receive_oob(const struct device *dev,
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_ESPI(dev, receive_oob));
|
Z_OOPS(Z_SYSCALL_DRIVER_ESPI(dev, receive_oob));
|
||||||
Z_OOPS(k_usermode_from_copy(&pckt_copy, pckt,
|
Z_OOPS(k_usermode_from_copy(&pckt_copy, pckt,
|
||||||
sizeof(struct espi_oob_packet)));
|
sizeof(struct espi_oob_packet)));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(pckt->buf, pckt->len));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(pckt->buf, pckt->len));
|
||||||
|
|
||||||
ret = z_impl_espi_receive_oob(dev, &pckt_copy);
|
ret = z_impl_espi_receive_oob(dev, &pckt_copy);
|
||||||
Z_OOPS(k_usermode_to_copy(pckt, &pckt_copy,
|
Z_OOPS(k_usermode_to_copy(pckt, &pckt_copy,
|
||||||
|
@ -167,7 +167,7 @@ static inline int z_vrfy_espi_read_flash(const struct device *dev,
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_ESPI(dev, flash_read));
|
Z_OOPS(Z_SYSCALL_DRIVER_ESPI(dev, flash_read));
|
||||||
Z_OOPS(k_usermode_from_copy(&pckt_copy, pckt,
|
Z_OOPS(k_usermode_from_copy(&pckt_copy, pckt,
|
||||||
sizeof(struct espi_flash_packet)));
|
sizeof(struct espi_flash_packet)));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(pckt->buf, pckt->len));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(pckt->buf, pckt->len));
|
||||||
|
|
||||||
ret = z_impl_espi_read_flash(dev, pckt);
|
ret = z_impl_espi_read_flash(dev, pckt);
|
||||||
Z_OOPS(k_usermode_to_copy(pckt, &pckt_copy,
|
Z_OOPS(k_usermode_to_copy(pckt, &pckt_copy,
|
||||||
|
@ -186,7 +186,7 @@ static inline int z_vrfy_espi_write_flash(const struct device *dev,
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_ESPI(dev, flash_write));
|
Z_OOPS(Z_SYSCALL_DRIVER_ESPI(dev, flash_write));
|
||||||
Z_OOPS(k_usermode_from_copy(&pckt_copy, pckt,
|
Z_OOPS(k_usermode_from_copy(&pckt_copy, pckt,
|
||||||
sizeof(struct espi_flash_packet)));
|
sizeof(struct espi_flash_packet)));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(pckt->buf, pckt->len));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(pckt->buf, pckt->len));
|
||||||
|
|
||||||
ret = z_impl_espi_write_flash(dev, &pckt_copy);
|
ret = z_impl_espi_write_flash(dev, &pckt_copy);
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ static inline int z_vrfy_espi_flash_erase(const struct device *dev,
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_ESPI(dev, flash_write));
|
Z_OOPS(Z_SYSCALL_DRIVER_ESPI(dev, flash_write));
|
||||||
Z_OOPS(k_usermode_from_copy(&pckt_copy, pckt,
|
Z_OOPS(k_usermode_from_copy(&pckt_copy, pckt,
|
||||||
sizeof(struct espi_flash_packet)));
|
sizeof(struct espi_flash_packet)));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(pckt->buf, pckt->len));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(pckt->buf, pckt->len));
|
||||||
|
|
||||||
ret = z_impl_espi_flash_erase(dev, &pckt_copy);
|
ret = z_impl_espi_flash_erase(dev, &pckt_copy);
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ static inline int z_vrfy_flash_read(const struct device *dev, off_t offset,
|
||||||
void *data, size_t len)
|
void *data, size_t len)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_FLASH(dev, read));
|
Z_OOPS(Z_SYSCALL_DRIVER_FLASH(dev, read));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(data, len));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(data, len));
|
||||||
return z_impl_flash_read((const struct device *)dev, offset,
|
return z_impl_flash_read((const struct device *)dev, offset,
|
||||||
(void *)data,
|
(void *)data,
|
||||||
len);
|
len);
|
||||||
|
@ -22,7 +22,7 @@ static inline int z_vrfy_flash_write(const struct device *dev, off_t offset,
|
||||||
const void *data, size_t len)
|
const void *data, size_t len)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_FLASH(dev, write));
|
Z_OOPS(Z_SYSCALL_DRIVER_FLASH(dev, write));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(data, len));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(data, len));
|
||||||
return z_impl_flash_write((const struct device *)dev, offset,
|
return z_impl_flash_write((const struct device *)dev, offset,
|
||||||
(const void *)data, len);
|
(const void *)data, len);
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ static inline int z_vrfy_flash_erase(const struct device *dev, off_t offset,
|
||||||
|
|
||||||
static inline size_t z_vrfy_flash_get_write_block_size(const struct device *dev)
|
static inline size_t z_vrfy_flash_get_write_block_size(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_FLASH));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_FLASH));
|
||||||
return z_impl_flash_get_write_block_size(dev);
|
return z_impl_flash_get_write_block_size(dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/flash_get_write_block_size_mrsh.c>
|
#include <syscalls/flash_get_write_block_size_mrsh.c>
|
||||||
|
@ -56,7 +56,7 @@ static inline int z_vrfy_flash_get_page_info_by_offs(const struct device *dev,
|
||||||
struct flash_pages_info *info)
|
struct flash_pages_info *info)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_FLASH(dev, page_layout));
|
Z_OOPS(Z_SYSCALL_DRIVER_FLASH(dev, page_layout));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(info, sizeof(struct flash_pages_info)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(info, sizeof(struct flash_pages_info)));
|
||||||
return z_impl_flash_get_page_info_by_offs((const struct device *)dev,
|
return z_impl_flash_get_page_info_by_offs((const struct device *)dev,
|
||||||
offs,
|
offs,
|
||||||
(struct flash_pages_info *)info);
|
(struct flash_pages_info *)info);
|
||||||
|
@ -68,7 +68,7 @@ static inline int z_vrfy_flash_get_page_info_by_idx(const struct device *dev,
|
||||||
struct flash_pages_info *info)
|
struct flash_pages_info *info)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_FLASH(dev, page_layout));
|
Z_OOPS(Z_SYSCALL_DRIVER_FLASH(dev, page_layout));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(info, sizeof(struct flash_pages_info)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(info, sizeof(struct flash_pages_info)));
|
||||||
return z_impl_flash_get_page_info_by_idx((const struct device *)dev,
|
return z_impl_flash_get_page_info_by_idx((const struct device *)dev,
|
||||||
idx,
|
idx,
|
||||||
(struct flash_pages_info *)info);
|
(struct flash_pages_info *)info);
|
||||||
|
@ -91,7 +91,7 @@ static inline int z_vrfy_flash_sfdp_read(const struct device *dev,
|
||||||
void *data, size_t len)
|
void *data, size_t len)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_FLASH(dev, sfdp_read));
|
Z_OOPS(Z_SYSCALL_DRIVER_FLASH(dev, sfdp_read));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(data, len));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(data, len));
|
||||||
return z_impl_flash_sfdp_read(dev, offset, data, len);
|
return z_impl_flash_sfdp_read(dev, offset, data, len);
|
||||||
}
|
}
|
||||||
#include <syscalls/flash_sfdp_read.c>
|
#include <syscalls/flash_sfdp_read.c>
|
||||||
|
@ -100,7 +100,7 @@ static inline int z_vrfy_flash_read_jedec_id(const struct device *dev,
|
||||||
uint8_t *id)
|
uint8_t *id)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_FLASH(dev, read_jedec_id));
|
Z_OOPS(Z_SYSCALL_DRIVER_FLASH(dev, read_jedec_id));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(id, 3));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(id, 3));
|
||||||
return z_impl_flash_read_jedec_id(dev, id);
|
return z_impl_flash_read_jedec_id(dev, id);
|
||||||
}
|
}
|
||||||
#include <syscalls/flash_sfdp_jedec_id.c>
|
#include <syscalls/flash_sfdp_jedec_id.c>
|
||||||
|
|
|
@ -486,7 +486,7 @@ void *z_impl_flash_simulator_get_memory(const struct device *dev,
|
||||||
void *z_vrfy_flash_simulator_get_memory(const struct device *dev,
|
void *z_vrfy_flash_simulator_get_memory(const struct device *dev,
|
||||||
size_t *mock_size)
|
size_t *mock_size)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_SPECIFIC_DRIVER(dev, K_OBJ_DRIVER_FLASH, &flash_sim_api));
|
Z_OOPS(K_SYSCALL_SPECIFIC_DRIVER(dev, K_OBJ_DRIVER_FLASH, &flash_sim_api));
|
||||||
|
|
||||||
return z_impl_flash_simulator_get_memory(dev, mock_size);
|
return z_impl_flash_simulator_get_memory(dev, mock_size);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1468,7 +1468,7 @@ void z_impl_nrf_qspi_nor_xip_enable(const struct device *dev, bool enable)
|
||||||
|
|
||||||
void z_vrfy_nrf_qspi_nor_xip_enable(const struct device *dev, bool enable)
|
void z_vrfy_nrf_qspi_nor_xip_enable(const struct device *dev, bool enable)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_SPECIFIC_DRIVER(dev, K_OBJ_DRIVER_FLASH,
|
Z_OOPS(K_SYSCALL_SPECIFIC_DRIVER(dev, K_OBJ_DRIVER_FLASH,
|
||||||
&qspi_nor_api));
|
&qspi_nor_api));
|
||||||
|
|
||||||
z_impl_nrf_qspi_nor_xip_enable(dev, enable);
|
z_impl_nrf_qspi_nor_xip_enable(dev, enable);
|
||||||
|
|
|
@ -85,7 +85,7 @@ static inline int z_vrfy_fuel_gauge_get_buffer_prop(const struct device *dev,
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_FUEL_GAUGE(dev, get_buffer_property));
|
Z_OOPS(Z_SYSCALL_DRIVER_FUEL_GAUGE(dev, get_buffer_property));
|
||||||
|
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(dst, dst_len));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(dst, dst_len));
|
||||||
|
|
||||||
int ret = z_impl_fuel_gauge_get_buffer_prop(dev, prop, dst, dst_len);
|
int ret = z_impl_fuel_gauge_get_buffer_prop(dev, prop, dst, dst_len);
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ static inline int z_vrfy_gpio_pin_get_config(const struct device *port,
|
||||||
gpio_flags_t *flags)
|
gpio_flags_t *flags)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_GPIO(port, pin_get_config));
|
Z_OOPS(Z_SYSCALL_DRIVER_GPIO(port, pin_get_config));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(flags, sizeof(gpio_flags_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(flags, sizeof(gpio_flags_t)));
|
||||||
|
|
||||||
return z_impl_gpio_pin_get_config(port, pin, flags);
|
return z_impl_gpio_pin_get_config(port, pin, flags);
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ static inline int z_vrfy_gpio_port_get_raw(const struct device *port,
|
||||||
gpio_port_value_t *value)
|
gpio_port_value_t *value)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_GPIO(port, port_get_raw));
|
Z_OOPS(Z_SYSCALL_DRIVER_GPIO(port, port_get_raw));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(value, sizeof(gpio_port_value_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(value, sizeof(gpio_port_value_t)));
|
||||||
return z_impl_gpio_port_get_raw((const struct device *)port,
|
return z_impl_gpio_port_get_raw((const struct device *)port,
|
||||||
(gpio_port_value_t *)value);
|
(gpio_port_value_t *)value);
|
||||||
}
|
}
|
||||||
|
@ -105,11 +105,11 @@ static inline int z_vrfy_gpio_port_get_direction(const struct device *dev, gpio_
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_GPIO(dev, port_get_direction));
|
Z_OOPS(Z_SYSCALL_DRIVER_GPIO(dev, port_get_direction));
|
||||||
|
|
||||||
if (inputs != NULL) {
|
if (inputs != NULL) {
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(inputs, sizeof(gpio_port_pins_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(inputs, sizeof(gpio_port_pins_t)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (outputs != NULL) {
|
if (outputs != NULL) {
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(outputs, sizeof(gpio_port_pins_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(outputs, sizeof(gpio_port_pins_t)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return z_impl_gpio_port_get_direction(dev, map, inputs, outputs);
|
return z_impl_gpio_port_get_direction(dev, map, inputs, outputs);
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
ssize_t z_vrfy_hwinfo_get_device_id(uint8_t *buffer, size_t length)
|
ssize_t z_vrfy_hwinfo_get_device_id(uint8_t *buffer, size_t length)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(buffer, length));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(buffer, length));
|
||||||
|
|
||||||
return z_impl_hwinfo_get_device_id((uint8_t *)buffer, (size_t)length);
|
return z_impl_hwinfo_get_device_id((uint8_t *)buffer, (size_t)length);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ static inline int z_vrfy_i2c_get_config(const struct device *dev,
|
||||||
uint32_t *dev_config)
|
uint32_t *dev_config)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_I2C(dev, get_config));
|
Z_OOPS(Z_SYSCALL_DRIVER_I2C(dev, get_config));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(dev_config, sizeof(uint32_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(dev_config, sizeof(uint32_t)));
|
||||||
|
|
||||||
return z_impl_i2c_get_config(dev, dev_config);
|
return z_impl_i2c_get_config(dev, dev_config);
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ static uint32_t copy_msgs_and_transfer(const struct device *dev,
|
||||||
* that the target buffer be writable
|
* that the target buffer be writable
|
||||||
*/
|
*/
|
||||||
for (i = 0U; i < num_msgs; i++) {
|
for (i = 0U; i < num_msgs; i++) {
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY(copy[i].buf, copy[i].len,
|
Z_OOPS(K_SYSCALL_MEMORY(copy[i].buf, copy[i].len,
|
||||||
copy[i].flags & I2C_MSG_READ));
|
copy[i].flags & I2C_MSG_READ));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ static inline int z_vrfy_i2c_transfer(const struct device *dev,
|
||||||
struct i2c_msg *msgs, uint8_t num_msgs,
|
struct i2c_msg *msgs, uint8_t num_msgs,
|
||||||
uint16_t addr)
|
uint16_t addr)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_I2C));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_I2C));
|
||||||
|
|
||||||
/* copy_msgs_and_transfer() will allocate a copy on the stack using
|
/* copy_msgs_and_transfer() will allocate a copy on the stack using
|
||||||
* VLA, so ensure this won't blow the stack. Most functions defined
|
* VLA, so ensure this won't blow the stack. Most functions defined
|
||||||
|
@ -73,21 +73,21 @@ static inline int z_vrfy_i2c_transfer(const struct device *dev,
|
||||||
|
|
||||||
static inline int z_vrfy_i2c_target_driver_register(const struct device *dev)
|
static inline int z_vrfy_i2c_target_driver_register(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_I2C));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_I2C));
|
||||||
return z_impl_i2c_target_driver_register(dev);
|
return z_impl_i2c_target_driver_register(dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/i2c_target_driver_register_mrsh.c>
|
#include <syscalls/i2c_target_driver_register_mrsh.c>
|
||||||
|
|
||||||
static inline int z_vrfy_i2c_target_driver_unregister(const struct device *dev)
|
static inline int z_vrfy_i2c_target_driver_unregister(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_I2C));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_I2C));
|
||||||
return z_impl_i2c_target_driver_unregister(dev);
|
return z_impl_i2c_target_driver_unregister(dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/i2c_target_driver_unregister_mrsh.c>
|
#include <syscalls/i2c_target_driver_unregister_mrsh.c>
|
||||||
|
|
||||||
static inline int z_vrfy_i2c_recover_bus(const struct device *dev)
|
static inline int z_vrfy_i2c_recover_bus(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_I2C));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_I2C));
|
||||||
return z_impl_i2c_recover_bus(dev);
|
return z_impl_i2c_recover_bus(dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/i2c_recover_bus_mrsh.c>
|
#include <syscalls/i2c_recover_bus_mrsh.c>
|
||||||
|
|
|
@ -26,7 +26,7 @@ static inline int z_vrfy_i2s_configure(const struct device *dev,
|
||||||
/* Check that the k_mem_slab provided is a valid pointer and that
|
/* Check that the k_mem_slab provided is a valid pointer and that
|
||||||
* the caller has permission on it
|
* the caller has permission on it
|
||||||
*/
|
*/
|
||||||
if (Z_SYSCALL_OBJ(config.mem_slab, K_OBJ_MEM_SLAB)) {
|
if (K_SYSCALL_OBJ(config.mem_slab, K_OBJ_MEM_SLAB)) {
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,8 @@ static inline int z_vrfy_i3c_do_ccc(const struct device *dev,
|
||||||
struct i3c_ccc_payload *payload)
|
struct i3c_ccc_payload *payload)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_I3C(dev, do_ccc));
|
Z_OOPS(Z_SYSCALL_DRIVER_I3C(dev, do_ccc));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(payload, sizeof(*payload)));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(payload, sizeof(*payload)));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(payload, sizeof(*payload)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(payload, sizeof(*payload)));
|
||||||
|
|
||||||
if (payload->ccc.data != NULL) {
|
if (payload->ccc.data != NULL) {
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(payload->ccc.data,
|
Z_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(payload->ccc.data,
|
||||||
|
@ -51,7 +51,7 @@ static uint32_t copy_i3c_msgs_and_transfer(struct i3c_device_desc *target,
|
||||||
* that the target buffer be writable
|
* that the target buffer be writable
|
||||||
*/
|
*/
|
||||||
for (i = 0U; i < num_msgs; i++) {
|
for (i = 0U; i < num_msgs; i++) {
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY(copy[i].buf, copy[i].len,
|
Z_OOPS(K_SYSCALL_MEMORY(copy[i].buf, copy[i].len,
|
||||||
copy[i].flags & I3C_MSG_READ));
|
copy[i].flags & I3C_MSG_READ));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,8 +61,8 @@ static uint32_t copy_i3c_msgs_and_transfer(struct i3c_device_desc *target,
|
||||||
static inline int z_vrfy_i3c_transfer(struct i3c_device_desc *target,
|
static inline int z_vrfy_i3c_transfer(struct i3c_device_desc *target,
|
||||||
struct i3c_msg *msgs, uint8_t num_msgs)
|
struct i3c_msg *msgs, uint8_t num_msgs)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(target, sizeof(*target)));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(target, sizeof(*target)));
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(target->bus, K_OBJ_DRIVER_I3C));
|
Z_OOPS(K_SYSCALL_OBJ(target->bus, K_OBJ_DRIVER_I3C));
|
||||||
|
|
||||||
/* copy_msgs_and_transfer() will allocate a copy on the stack using
|
/* copy_msgs_and_transfer() will allocate a copy on the stack using
|
||||||
* VLA, so ensure this won't blow the stack. Most functions defined
|
* VLA, so ensure this won't blow the stack. Most functions defined
|
||||||
|
|
|
@ -12,7 +12,7 @@ static inline int z_vrfy_ipm_send(const struct device *dev, int wait,
|
||||||
const void *data, int size)
|
const void *data, int size)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_IPM(dev, send));
|
Z_OOPS(Z_SYSCALL_DRIVER_IPM(dev, send));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(data, size));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(data, size));
|
||||||
return z_impl_ipm_send((const struct device *)dev, wait, id,
|
return z_impl_ipm_send((const struct device *)dev, wait, id,
|
||||||
(const void *)data, size);
|
(const void *)data, size);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,8 +19,8 @@ static inline int z_vrfy_led_blink(const struct device *dev, uint32_t led,
|
||||||
static inline int z_vrfy_led_get_info(const struct device *dev, uint32_t led,
|
static inline int z_vrfy_led_get_info(const struct device *dev, uint32_t led,
|
||||||
const struct led_info **info)
|
const struct led_info **info)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_LED));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_LED));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(info, sizeof(*info)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(info, sizeof(*info)));
|
||||||
return z_impl_led_get_info(dev, led, info);
|
return z_impl_led_get_info(dev, led, info);
|
||||||
}
|
}
|
||||||
#include <syscalls/led_get_info_mrsh.c>
|
#include <syscalls/led_get_info_mrsh.c>
|
||||||
|
@ -39,8 +39,8 @@ static inline int
|
||||||
z_vrfy_led_write_channels(const struct device *dev, uint32_t start_channel,
|
z_vrfy_led_write_channels(const struct device *dev, uint32_t start_channel,
|
||||||
uint32_t num_channels, const uint8_t *buf)
|
uint32_t num_channels, const uint8_t *buf)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_LED));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_LED));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(buf, num_channels));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(buf, num_channels));
|
||||||
return z_impl_led_write_channels(dev, start_channel, num_channels, buf);
|
return z_impl_led_write_channels(dev, start_channel, num_channels, buf);
|
||||||
}
|
}
|
||||||
#include <syscalls/led_write_channels_mrsh.c>
|
#include <syscalls/led_write_channels_mrsh.c>
|
||||||
|
@ -48,7 +48,7 @@ z_vrfy_led_write_channels(const struct device *dev, uint32_t start_channel,
|
||||||
static inline int z_vrfy_led_set_channel(const struct device *dev,
|
static inline int z_vrfy_led_set_channel(const struct device *dev,
|
||||||
uint32_t channel, uint8_t value)
|
uint32_t channel, uint8_t value)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_LED));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_LED));
|
||||||
return z_impl_led_set_channel(dev, channel, value);
|
return z_impl_led_set_channel(dev, channel, value);
|
||||||
}
|
}
|
||||||
#include <syscalls/led_set_channel_mrsh.c>
|
#include <syscalls/led_set_channel_mrsh.c>
|
||||||
|
@ -56,8 +56,8 @@ static inline int z_vrfy_led_set_channel(const struct device *dev,
|
||||||
static inline int z_vrfy_led_set_color(const struct device *dev, uint32_t led,
|
static inline int z_vrfy_led_set_color(const struct device *dev, uint32_t led,
|
||||||
uint8_t num_colors, const uint8_t *color)
|
uint8_t num_colors, const uint8_t *color)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_LED));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_LED));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(color, num_colors));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(color, num_colors));
|
||||||
return z_impl_led_set_color(dev, led, num_colors, color);
|
return z_impl_led_set_color(dev, led, num_colors, color);
|
||||||
}
|
}
|
||||||
#include <syscalls/led_set_color_mrsh.c>
|
#include <syscalls/led_set_color_mrsh.c>
|
||||||
|
|
|
@ -10,10 +10,10 @@
|
||||||
static inline int z_vrfy_mbox_send(const struct mbox_channel *channel,
|
static inline int z_vrfy_mbox_send(const struct mbox_channel *channel,
|
||||||
const struct mbox_msg *msg)
|
const struct mbox_msg *msg)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(channel, sizeof(struct mbox_channel)));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(channel, sizeof(struct mbox_channel)));
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_MBOX(channel->dev, send));
|
Z_OOPS(Z_SYSCALL_DRIVER_MBOX(channel->dev, send));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(msg, sizeof(struct mbox_msg)));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(msg, sizeof(struct mbox_msg)));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(msg->data, msg->size));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(msg->data, msg->size));
|
||||||
|
|
||||||
return z_impl_mbox_send(channel, msg);
|
return z_impl_mbox_send(channel, msg);
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ static inline uint32_t z_vrfy_mbox_max_channels_get(const struct device *dev)
|
||||||
|
|
||||||
static inline int z_vrfy_mbox_set_enabled(const struct mbox_channel *channel, bool enable)
|
static inline int z_vrfy_mbox_set_enabled(const struct mbox_channel *channel, bool enable)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(channel, sizeof(struct mbox_channel)));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(channel, sizeof(struct mbox_channel)));
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_MBOX(channel->dev, set_enabled));
|
Z_OOPS(Z_SYSCALL_DRIVER_MBOX(channel->dev, set_enabled));
|
||||||
|
|
||||||
return z_impl_mbox_set_enabled(channel, enable);
|
return z_impl_mbox_set_enabled(channel, enable);
|
||||||
|
|
|
@ -27,7 +27,7 @@ static inline int z_vrfy_ps2_write(const struct device *dev, uint8_t value)
|
||||||
static inline int z_vrfy_ps2_read(const struct device *dev, uint8_t *value)
|
static inline int z_vrfy_ps2_read(const struct device *dev, uint8_t *value)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_PS2(dev, read));
|
Z_OOPS(Z_SYSCALL_DRIVER_PS2(dev, read));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(value, sizeof(uint8_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(value, sizeof(uint8_t)));
|
||||||
return z_impl_ps2_read(dev, value);
|
return z_impl_ps2_read(dev, value);
|
||||||
}
|
}
|
||||||
#include <syscalls/ps2_read_mrsh.c>
|
#include <syscalls/ps2_read_mrsh.c>
|
||||||
|
|
|
@ -15,7 +15,7 @@ int z_vrfy_ptp_clock_get(const struct device *dev,
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_PTP_CLOCK(dev, get));
|
Z_OOPS(Z_SYSCALL_DRIVER_PTP_CLOCK(dev, get));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(tm, sizeof(struct net_ptp_time)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(tm, sizeof(struct net_ptp_time)));
|
||||||
|
|
||||||
ret = z_impl_ptp_clock_get((const struct device *)dev, &ptp_time);
|
ret = z_impl_ptp_clock_get((const struct device *)dev, &ptp_time);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
|
|
|
@ -23,7 +23,7 @@ static inline int z_vrfy_pwm_get_cycles_per_sec(const struct device *dev,
|
||||||
uint64_t *cycles)
|
uint64_t *cycles)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_PWM(dev, get_cycles_per_sec));
|
Z_OOPS(Z_SYSCALL_DRIVER_PWM(dev, get_cycles_per_sec));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(cycles, sizeof(uint64_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(cycles, sizeof(uint64_t)));
|
||||||
return z_impl_pwm_get_cycles_per_sec((const struct device *)dev,
|
return z_impl_pwm_get_cycles_per_sec((const struct device *)dev,
|
||||||
channel, (uint64_t *)cycles);
|
channel, (uint64_t *)cycles);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
static inline ssize_t z_vrfy_retained_mem_size(const struct device *dev)
|
static inline ssize_t z_vrfy_retained_mem_size(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RETAINED_MEM));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RETAINED_MEM));
|
||||||
return z_impl_retained_mem_size(dev);
|
return z_impl_retained_mem_size(dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/retained_mem_size_mrsh.c>
|
#include <syscalls/retained_mem_size_mrsh.c>
|
||||||
|
@ -17,8 +17,8 @@ static inline ssize_t z_vrfy_retained_mem_size(const struct device *dev)
|
||||||
static inline int z_vrfy_retained_mem_read(const struct device *dev, off_t offset,
|
static inline int z_vrfy_retained_mem_read(const struct device *dev, off_t offset,
|
||||||
uint8_t *buffer, size_t size)
|
uint8_t *buffer, size_t size)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RETAINED_MEM));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RETAINED_MEM));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(buffer, size));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(buffer, size));
|
||||||
return z_impl_retained_mem_read(dev, offset, buffer, size);
|
return z_impl_retained_mem_read(dev, offset, buffer, size);
|
||||||
}
|
}
|
||||||
#include <syscalls/retained_mem_read_mrsh.c>
|
#include <syscalls/retained_mem_read_mrsh.c>
|
||||||
|
@ -26,15 +26,15 @@ static inline int z_vrfy_retained_mem_read(const struct device *dev, off_t offse
|
||||||
static inline int z_vrfy_retained_mem_write(const struct device *dev, off_t offset,
|
static inline int z_vrfy_retained_mem_write(const struct device *dev, off_t offset,
|
||||||
const uint8_t *buffer, size_t size)
|
const uint8_t *buffer, size_t size)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RETAINED_MEM));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RETAINED_MEM));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(buffer, size));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(buffer, size));
|
||||||
return z_impl_retained_mem_write(dev, offset, buffer, size);
|
return z_impl_retained_mem_write(dev, offset, buffer, size);
|
||||||
}
|
}
|
||||||
#include <syscalls/retained_mem_write_mrsh.c>
|
#include <syscalls/retained_mem_write_mrsh.c>
|
||||||
|
|
||||||
static inline int z_vrfy_retained_mem_clear(const struct device *dev)
|
static inline int z_vrfy_retained_mem_clear(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RETAINED_MEM));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RETAINED_MEM));
|
||||||
return z_impl_retained_mem_clear(dev);
|
return z_impl_retained_mem_clear(dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/retained_mem_clear_mrsh.c>
|
#include <syscalls/retained_mem_clear_mrsh.c>
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
static inline int z_vrfy_rtc_set_time(const struct device *dev, const struct rtc_time *timeptr)
|
static inline int z_vrfy_rtc_set_time(const struct device *dev, const struct rtc_time *timeptr)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, set_time));
|
Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, set_time));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(timeptr, sizeof(struct rtc_time)));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(timeptr, sizeof(struct rtc_time)));
|
||||||
return z_impl_rtc_set_time(dev, timeptr);
|
return z_impl_rtc_set_time(dev, timeptr);
|
||||||
}
|
}
|
||||||
#include <syscalls/rtc_set_time_mrsh.c>
|
#include <syscalls/rtc_set_time_mrsh.c>
|
||||||
|
@ -18,7 +18,7 @@ static inline int z_vrfy_rtc_set_time(const struct device *dev, const struct rtc
|
||||||
static inline int z_vrfy_rtc_get_time(const struct device *dev, struct rtc_time *timeptr)
|
static inline int z_vrfy_rtc_get_time(const struct device *dev, struct rtc_time *timeptr)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, get_time));
|
Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, get_time));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(timeptr, sizeof(struct rtc_time)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(timeptr, sizeof(struct rtc_time)));
|
||||||
return z_impl_rtc_get_time(dev, timeptr);
|
return z_impl_rtc_get_time(dev, timeptr);
|
||||||
}
|
}
|
||||||
#include <syscalls/rtc_get_time_mrsh.c>
|
#include <syscalls/rtc_get_time_mrsh.c>
|
||||||
|
@ -28,7 +28,7 @@ static inline int z_vrfy_rtc_alarm_get_supported_fields(const struct device *dev
|
||||||
uint16_t *mask)
|
uint16_t *mask)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, alarm_get_supported_fields));
|
Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, alarm_get_supported_fields));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(mask, sizeof(uint16_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(mask, sizeof(uint16_t)));
|
||||||
return z_impl_rtc_alarm_get_supported_fields(dev, id, mask);
|
return z_impl_rtc_alarm_get_supported_fields(dev, id, mask);
|
||||||
}
|
}
|
||||||
#include <syscalls/rtc_alarm_get_supported_fields_mrsh.c>
|
#include <syscalls/rtc_alarm_get_supported_fields_mrsh.c>
|
||||||
|
@ -37,7 +37,7 @@ static inline int z_vrfy_rtc_alarm_set_time(const struct device *dev, uint16_t i
|
||||||
const struct rtc_time *timeptr)
|
const struct rtc_time *timeptr)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, alarm_set_time));
|
Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, alarm_set_time));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(timeptr, sizeof(struct rtc_time)));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(timeptr, sizeof(struct rtc_time)));
|
||||||
return z_impl_rtc_alarm_set_time(dev, id, mask, timeptr);
|
return z_impl_rtc_alarm_set_time(dev, id, mask, timeptr);
|
||||||
}
|
}
|
||||||
#include <syscalls/rtc_alarm_set_time_mrsh.c>
|
#include <syscalls/rtc_alarm_set_time_mrsh.c>
|
||||||
|
@ -46,8 +46,8 @@ static inline int z_vrfy_rtc_alarm_get_time(const struct device *dev, uint16_t i
|
||||||
struct rtc_time *timeptr)
|
struct rtc_time *timeptr)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, alarm_get_time));
|
Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, alarm_get_time));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(mask, sizeof(uint16_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(mask, sizeof(uint16_t)));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(timeptr, sizeof(struct rtc_time)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(timeptr, sizeof(struct rtc_time)));
|
||||||
return z_impl_rtc_alarm_get_time(dev, id, mask, timeptr);
|
return z_impl_rtc_alarm_get_time(dev, id, mask, timeptr);
|
||||||
}
|
}
|
||||||
#include <syscalls/rtc_alarm_get_time_mrsh.c>
|
#include <syscalls/rtc_alarm_get_time_mrsh.c>
|
||||||
|
@ -72,7 +72,7 @@ static inline int z_vrfy_rtc_set_calibration(const struct device *dev, int32_t c
|
||||||
static inline int z_vrfy_rtc_get_calibration(const struct device *dev, int32_t *calibration)
|
static inline int z_vrfy_rtc_get_calibration(const struct device *dev, int32_t *calibration)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, get_calibration));
|
Z_OOPS(Z_SYSCALL_DRIVER_RTC(dev, get_calibration));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(calibration, sizeof(int32_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(calibration, sizeof(int32_t)));
|
||||||
return z_impl_rtc_get_calibration(dev, calibration);
|
return z_impl_rtc_get_calibration(dev, calibration);
|
||||||
}
|
}
|
||||||
#include <syscalls/rtc_get_calibration_mrsh.c>
|
#include <syscalls/rtc_get_calibration_mrsh.c>
|
||||||
|
|
|
@ -13,7 +13,7 @@ static inline int z_vrfy_sensor_attr_set(const struct device *dev,
|
||||||
const struct sensor_value *val)
|
const struct sensor_value *val)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_SENSOR(dev, attr_set));
|
Z_OOPS(Z_SYSCALL_DRIVER_SENSOR(dev, attr_set));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(val, sizeof(struct sensor_value)));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(val, sizeof(struct sensor_value)));
|
||||||
return z_impl_sensor_attr_set((const struct device *)dev, chan, attr,
|
return z_impl_sensor_attr_set((const struct device *)dev, chan, attr,
|
||||||
(const struct sensor_value *)val);
|
(const struct sensor_value *)val);
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ static inline int z_vrfy_sensor_attr_get(const struct device *dev,
|
||||||
struct sensor_value *val)
|
struct sensor_value *val)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_SENSOR(dev, attr_get));
|
Z_OOPS(Z_SYSCALL_DRIVER_SENSOR(dev, attr_get));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(val, sizeof(struct sensor_value)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(val, sizeof(struct sensor_value)));
|
||||||
return z_impl_sensor_attr_get((const struct device *)dev, chan, attr,
|
return z_impl_sensor_attr_get((const struct device *)dev, chan, attr,
|
||||||
(struct sensor_value *)val);
|
(struct sensor_value *)val);
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ static inline int z_vrfy_sensor_channel_get(const struct device *dev,
|
||||||
struct sensor_value *val)
|
struct sensor_value *val)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_SENSOR(dev, channel_get));
|
Z_OOPS(Z_SYSCALL_DRIVER_SENSOR(dev, channel_get));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(val, sizeof(struct sensor_value)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(val, sizeof(struct sensor_value)));
|
||||||
return z_impl_sensor_channel_get((const struct device *)dev, chan,
|
return z_impl_sensor_channel_get((const struct device *)dev, chan,
|
||||||
(struct sensor_value *)val);
|
(struct sensor_value *)val);
|
||||||
}
|
}
|
||||||
|
@ -62,8 +62,8 @@ static inline int z_vrfy_sensor_channel_get(const struct device *dev,
|
||||||
static inline int z_vrfy_sensor_get_decoder(const struct device *dev,
|
static inline int z_vrfy_sensor_get_decoder(const struct device *dev,
|
||||||
const struct sensor_decoder_api **decoder)
|
const struct sensor_decoder_api **decoder)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SENSOR));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SENSOR));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(decoder, sizeof(struct sensor_decoder_api)));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(decoder, sizeof(struct sensor_decoder_api)));
|
||||||
return z_impl_sensor_get_decoder(dev, decoder);
|
return z_impl_sensor_get_decoder(dev, decoder);
|
||||||
}
|
}
|
||||||
#include <syscalls/sensor_get_decoder_mrsh.c>
|
#include <syscalls/sensor_get_decoder_mrsh.c>
|
||||||
|
@ -73,9 +73,9 @@ static inline int z_vrfy_sensor_reconfigure_read_iodev(struct rtio_iodev *iodev,
|
||||||
const enum sensor_channel *channels,
|
const enum sensor_channel *channels,
|
||||||
size_t num_channels)
|
size_t num_channels)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(iodev, K_OBJ_RTIO_IODEV));
|
Z_OOPS(K_SYSCALL_OBJ(iodev, K_OBJ_RTIO_IODEV));
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(sensor, K_OBJ_DRIVER_SENSOR));
|
Z_OOPS(K_SYSCALL_OBJ(sensor, K_OBJ_DRIVER_SENSOR));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(channels, sizeof(enum sensor_channel) * num_channels));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(channels, sizeof(enum sensor_channel) * num_channels));
|
||||||
return z_impl_sensor_reconfigure_read_iodev(iodev, sensor, channels, num_channels);
|
return z_impl_sensor_reconfigure_read_iodev(iodev, sensor, channels, num_channels);
|
||||||
}
|
}
|
||||||
#include <syscalls/sensor_reconfigure_read_iodev_mrsh.c>
|
#include <syscalls/sensor_reconfigure_read_iodev_mrsh.c>
|
||||||
|
|
|
@ -28,7 +28,7 @@ static inline int z_vrfy_uart_poll_in(const struct device *dev,
|
||||||
unsigned char *p_char)
|
unsigned char *p_char)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, poll_in));
|
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, poll_in));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(p_char, sizeof(unsigned char)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(p_char, sizeof(unsigned char)));
|
||||||
return z_impl_uart_poll_in(dev, p_char);
|
return z_impl_uart_poll_in(dev, p_char);
|
||||||
}
|
}
|
||||||
#include <syscalls/uart_poll_in_mrsh.c>
|
#include <syscalls/uart_poll_in_mrsh.c>
|
||||||
|
@ -37,7 +37,7 @@ static inline int z_vrfy_uart_poll_in_u16(const struct device *dev,
|
||||||
uint16_t *p_u16)
|
uint16_t *p_u16)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, poll_in));
|
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, poll_in));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(p_u16, sizeof(uint16_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(p_u16, sizeof(uint16_t)));
|
||||||
return z_impl_uart_poll_in_u16(dev, p_u16);
|
return z_impl_uart_poll_in_u16(dev, p_u16);
|
||||||
}
|
}
|
||||||
#include <syscalls/uart_poll_in_u16_mrsh.c>
|
#include <syscalls/uart_poll_in_u16_mrsh.c>
|
||||||
|
@ -63,7 +63,7 @@ static inline int z_vrfy_uart_config_get(const struct device *dev,
|
||||||
struct uart_config *cfg)
|
struct uart_config *cfg)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, config_get));
|
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, config_get));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(cfg, sizeof(struct uart_config)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(cfg, sizeof(struct uart_config)));
|
||||||
|
|
||||||
return z_impl_uart_config_get(dev, cfg);
|
return z_impl_uart_config_get(dev, cfg);
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ static inline int z_vrfy_uart_configure(const struct device *dev,
|
||||||
const struct uart_config *cfg)
|
const struct uart_config *cfg)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, config_get));
|
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, config_get));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(cfg, sizeof(struct uart_config)));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(cfg, sizeof(struct uart_config)));
|
||||||
|
|
||||||
return z_impl_uart_configure(dev, cfg);
|
return z_impl_uart_configure(dev, cfg);
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ static inline int z_vrfy_uart_tx(const struct device *dev, const uint8_t *buf,
|
||||||
size_t len, int32_t timeout)
|
size_t len, int32_t timeout)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, tx));
|
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, tx));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(buf, len));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(buf, len));
|
||||||
return z_impl_uart_tx(dev, buf, len, timeout);
|
return z_impl_uart_tx(dev, buf, len, timeout);
|
||||||
}
|
}
|
||||||
#include <syscalls/uart_tx_mrsh.c>
|
#include <syscalls/uart_tx_mrsh.c>
|
||||||
|
@ -116,7 +116,7 @@ static inline int z_vrfy_uart_rx_enable(const struct device *dev,
|
||||||
size_t len, int32_t timeout)
|
size_t len, int32_t timeout)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, rx_enable));
|
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, rx_enable));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(buf, len));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(buf, len));
|
||||||
return z_impl_uart_rx_enable(dev, buf, len, timeout);
|
return z_impl_uart_rx_enable(dev, buf, len, timeout);
|
||||||
}
|
}
|
||||||
#include <syscalls/uart_rx_enable_mrsh.c>
|
#include <syscalls/uart_rx_enable_mrsh.c>
|
||||||
|
@ -170,7 +170,7 @@ static inline int z_vrfy_uart_line_ctrl_get(const struct device *dev,
|
||||||
uint32_t ctrl, uint32_t *val)
|
uint32_t ctrl, uint32_t *val)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, line_ctrl_get));
|
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, line_ctrl_get));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(val, sizeof(uint32_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(val, sizeof(uint32_t)));
|
||||||
return z_impl_uart_line_ctrl_get((const struct device *)dev, ctrl,
|
return z_impl_uart_line_ctrl_get((const struct device *)dev, ctrl,
|
||||||
(uint32_t *)val);
|
(uint32_t *)val);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ static inline int z_vrfy_smbus_get_config(const struct device *dev,
|
||||||
uint32_t *dev_config)
|
uint32_t *dev_config)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_SMBUS(dev, get_config));
|
Z_OOPS(Z_SYSCALL_DRIVER_SMBUS(dev, get_config));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(dev_config, sizeof(uint32_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(dev_config, sizeof(uint32_t)));
|
||||||
|
|
||||||
return z_impl_smbus_get_config(dev, dev_config);
|
return z_impl_smbus_get_config(dev, dev_config);
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ static inline int z_vrfy_smbus_get_config(const struct device *dev,
|
||||||
static inline int z_vrfy_smbus_quick(const struct device *dev, uint16_t addr,
|
static inline int z_vrfy_smbus_quick(const struct device *dev, uint16_t addr,
|
||||||
enum smbus_direction rw)
|
enum smbus_direction rw)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
||||||
|
|
||||||
return z_impl_smbus_quick(dev, addr, rw);
|
return z_impl_smbus_quick(dev, addr, rw);
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ static inline int z_vrfy_smbus_quick(const struct device *dev, uint16_t addr,
|
||||||
static inline int z_vrfy_smbus_byte_write(const struct device *dev,
|
static inline int z_vrfy_smbus_byte_write(const struct device *dev,
|
||||||
uint16_t addr, uint8_t byte)
|
uint16_t addr, uint8_t byte)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
||||||
|
|
||||||
return z_impl_smbus_byte_write(dev, addr, byte);
|
return z_impl_smbus_byte_write(dev, addr, byte);
|
||||||
}
|
}
|
||||||
|
@ -48,8 +48,8 @@ static inline int z_vrfy_smbus_byte_write(const struct device *dev,
|
||||||
static inline int z_vrfy_smbus_byte_read(const struct device *dev,
|
static inline int z_vrfy_smbus_byte_read(const struct device *dev,
|
||||||
uint16_t addr, uint8_t *byte)
|
uint16_t addr, uint8_t *byte)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(byte, sizeof(uint8_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(byte, sizeof(uint8_t)));
|
||||||
|
|
||||||
return z_impl_smbus_byte_read(dev, addr, byte);
|
return z_impl_smbus_byte_read(dev, addr, byte);
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ static inline int z_vrfy_smbus_byte_data_write(const struct device *dev,
|
||||||
uint16_t addr, uint8_t cmd,
|
uint16_t addr, uint8_t cmd,
|
||||||
uint8_t byte)
|
uint8_t byte)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
||||||
|
|
||||||
return z_impl_smbus_byte_data_write(dev, addr, cmd, byte);
|
return z_impl_smbus_byte_data_write(dev, addr, cmd, byte);
|
||||||
}
|
}
|
||||||
|
@ -69,8 +69,8 @@ static inline int z_vrfy_smbus_byte_data_read(const struct device *dev,
|
||||||
uint16_t addr, uint8_t cmd,
|
uint16_t addr, uint8_t cmd,
|
||||||
uint8_t *byte)
|
uint8_t *byte)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(byte, sizeof(uint8_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(byte, sizeof(uint8_t)));
|
||||||
|
|
||||||
return z_impl_smbus_byte_data_read(dev, addr, cmd, byte);
|
return z_impl_smbus_byte_data_read(dev, addr, cmd, byte);
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ static inline int z_vrfy_smbus_word_data_write(const struct device *dev,
|
||||||
uint16_t addr, uint8_t cmd,
|
uint16_t addr, uint8_t cmd,
|
||||||
uint16_t word)
|
uint16_t word)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
||||||
|
|
||||||
return z_impl_smbus_word_data_write(dev, addr, cmd, word);
|
return z_impl_smbus_word_data_write(dev, addr, cmd, word);
|
||||||
}
|
}
|
||||||
|
@ -90,8 +90,8 @@ static inline int z_vrfy_smbus_word_data_read(const struct device *dev,
|
||||||
uint16_t addr, uint8_t cmd,
|
uint16_t addr, uint8_t cmd,
|
||||||
uint16_t *word)
|
uint16_t *word)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(word, sizeof(uint16_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(word, sizeof(uint16_t)));
|
||||||
|
|
||||||
return z_impl_smbus_word_data_read(dev, addr, cmd, word);
|
return z_impl_smbus_word_data_read(dev, addr, cmd, word);
|
||||||
}
|
}
|
||||||
|
@ -101,8 +101,8 @@ static inline int z_vrfy_smbus_pcall(const struct device *dev,
|
||||||
uint16_t addr, uint8_t cmd,
|
uint16_t addr, uint8_t cmd,
|
||||||
uint16_t send_word, uint16_t *recv_word)
|
uint16_t send_word, uint16_t *recv_word)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(recv_word, sizeof(uint16_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(recv_word, sizeof(uint16_t)));
|
||||||
|
|
||||||
return z_impl_smbus_pcall(dev, addr, cmd, send_word, recv_word);
|
return z_impl_smbus_pcall(dev, addr, cmd, send_word, recv_word);
|
||||||
}
|
}
|
||||||
|
@ -112,8 +112,8 @@ static inline int z_vrfy_smbus_block_write(const struct device *dev,
|
||||||
uint16_t addr, uint8_t cmd,
|
uint16_t addr, uint8_t cmd,
|
||||||
uint8_t count, uint8_t *buf)
|
uint8_t count, uint8_t *buf)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(buf, count));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(buf, count));
|
||||||
|
|
||||||
return z_impl_smbus_block_write(dev, addr, cmd, count, buf);
|
return z_impl_smbus_block_write(dev, addr, cmd, count, buf);
|
||||||
}
|
}
|
||||||
|
@ -123,8 +123,8 @@ static inline int z_vrfy_smbus_block_read(const struct device *dev,
|
||||||
uint16_t addr, uint8_t cmd,
|
uint16_t addr, uint8_t cmd,
|
||||||
uint8_t *count, uint8_t *buf)
|
uint8_t *count, uint8_t *buf)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(count, sizeof(uint8_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(count, sizeof(uint8_t)));
|
||||||
|
|
||||||
return z_impl_smbus_block_read(dev, addr, cmd, count, buf);
|
return z_impl_smbus_block_read(dev, addr, cmd, count, buf);
|
||||||
}
|
}
|
||||||
|
@ -135,9 +135,9 @@ static inline int z_vrfy_smbus_block_pcall(const struct device *dev,
|
||||||
uint8_t snd_count, uint8_t *snd_buf,
|
uint8_t snd_count, uint8_t *snd_buf,
|
||||||
uint8_t *rcv_count, uint8_t *rcv_buf)
|
uint8_t *rcv_count, uint8_t *rcv_buf)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(snd_buf, snd_count));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(snd_buf, snd_count));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(rcv_count, sizeof(uint8_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(rcv_count, sizeof(uint8_t)));
|
||||||
|
|
||||||
return z_impl_smbus_block_pcall(dev, addr, cmd, snd_count, snd_buf,
|
return z_impl_smbus_block_pcall(dev, addr, cmd, snd_count, snd_buf,
|
||||||
rcv_count, rcv_buf);
|
rcv_count, rcv_buf);
|
||||||
|
@ -147,7 +147,7 @@ static inline int z_vrfy_smbus_block_pcall(const struct device *dev,
|
||||||
static inline int z_vrfy_smbus_smbalert_set_cb(const struct device *dev,
|
static inline int z_vrfy_smbus_smbalert_set_cb(const struct device *dev,
|
||||||
struct smbus_callback *cb)
|
struct smbus_callback *cb)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
||||||
|
|
||||||
return z_impl_smbus_smbalert_set_cb(dev, cb);
|
return z_impl_smbus_smbalert_set_cb(dev, cb);
|
||||||
}
|
}
|
||||||
|
@ -156,7 +156,7 @@ static inline int z_vrfy_smbus_smbalert_set_cb(const struct device *dev,
|
||||||
static inline int z_vrfy_smbus_smbalert_remove_cb(const struct device *dev,
|
static inline int z_vrfy_smbus_smbalert_remove_cb(const struct device *dev,
|
||||||
struct smbus_callback *cb)
|
struct smbus_callback *cb)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
||||||
|
|
||||||
return z_impl_smbus_smbalert_remove_cb(dev, cb);
|
return z_impl_smbus_smbalert_remove_cb(dev, cb);
|
||||||
}
|
}
|
||||||
|
@ -165,7 +165,7 @@ static inline int z_vrfy_smbus_smbalert_remove_cb(const struct device *dev,
|
||||||
static inline int z_vrfy_smbus_host_notify_set_cb(const struct device *dev,
|
static inline int z_vrfy_smbus_host_notify_set_cb(const struct device *dev,
|
||||||
struct smbus_callback *cb)
|
struct smbus_callback *cb)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
||||||
|
|
||||||
return z_impl_smbus_host_notify_set_cb(dev, cb);
|
return z_impl_smbus_host_notify_set_cb(dev, cb);
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ static inline int z_vrfy_smbus_host_notify_set_cb(const struct device *dev,
|
||||||
static inline int z_vrfy_smbus_host_notify_remove_cb(const struct device *dev,
|
static inline int z_vrfy_smbus_host_notify_remove_cb(const struct device *dev,
|
||||||
struct smbus_callback *cb)
|
struct smbus_callback *cb)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
||||||
|
|
||||||
return z_impl_smbus_host_notify_remove_cb(dev, cb);
|
return z_impl_smbus_host_notify_remove_cb(dev, cb);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ static struct spi_buf_set *copy_and_check(struct spi_buf_set *bufs,
|
||||||
*/
|
*/
|
||||||
const struct spi_buf *buf = &bufs->buffers[i];
|
const struct spi_buf *buf = &bufs->buffers[i];
|
||||||
|
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY(buf->buf, buf->len, writable));
|
Z_OOPS(K_SYSCALL_MEMORY(buf->buf, buf->len, writable));
|
||||||
}
|
}
|
||||||
|
|
||||||
return bufs;
|
return bufs;
|
||||||
|
@ -76,14 +76,14 @@ static inline int z_vrfy_spi_transceive(const struct device *dev,
|
||||||
struct spi_buf_set rx_bufs_copy;
|
struct spi_buf_set rx_bufs_copy;
|
||||||
struct spi_config config_copy;
|
struct spi_config config_copy;
|
||||||
|
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(config, sizeof(*config)));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(config, sizeof(*config)));
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_SPI(dev, transceive));
|
Z_OOPS(Z_SYSCALL_DRIVER_SPI(dev, transceive));
|
||||||
|
|
||||||
if (tx_bufs) {
|
if (tx_bufs) {
|
||||||
const struct spi_buf_set *tx =
|
const struct spi_buf_set *tx =
|
||||||
(const struct spi_buf_set *)tx_bufs;
|
(const struct spi_buf_set *)tx_bufs;
|
||||||
|
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(tx_bufs,
|
Z_OOPS(K_SYSCALL_MEMORY_READ(tx_bufs,
|
||||||
sizeof(struct spi_buf_set)));
|
sizeof(struct spi_buf_set)));
|
||||||
memcpy(&tx_bufs_copy, tx, sizeof(tx_bufs_copy));
|
memcpy(&tx_bufs_copy, tx, sizeof(tx_bufs_copy));
|
||||||
Z_OOPS(Z_SYSCALL_VERIFY(tx_bufs_copy.count < 32));
|
Z_OOPS(Z_SYSCALL_VERIFY(tx_bufs_copy.count < 32));
|
||||||
|
@ -95,7 +95,7 @@ static inline int z_vrfy_spi_transceive(const struct device *dev,
|
||||||
const struct spi_buf_set *rx =
|
const struct spi_buf_set *rx =
|
||||||
(const struct spi_buf_set *)rx_bufs;
|
(const struct spi_buf_set *)rx_bufs;
|
||||||
|
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(rx_bufs,
|
Z_OOPS(K_SYSCALL_MEMORY_READ(rx_bufs,
|
||||||
sizeof(struct spi_buf_set)));
|
sizeof(struct spi_buf_set)));
|
||||||
memcpy(&rx_bufs_copy, rx, sizeof(rx_bufs_copy));
|
memcpy(&rx_bufs_copy, rx, sizeof(rx_bufs_copy));
|
||||||
Z_OOPS(Z_SYSCALL_VERIFY(rx_bufs_copy.count < 32));
|
Z_OOPS(Z_SYSCALL_VERIFY(rx_bufs_copy.count < 32));
|
||||||
|
@ -105,7 +105,7 @@ static inline int z_vrfy_spi_transceive(const struct device *dev,
|
||||||
|
|
||||||
memcpy(&config_copy, config, sizeof(*config));
|
memcpy(&config_copy, config, sizeof(*config));
|
||||||
if (spi_cs_is_gpio(&config_copy)) {
|
if (spi_cs_is_gpio(&config_copy)) {
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(config_copy.cs.gpio.port,
|
Z_OOPS(K_SYSCALL_OBJ(config_copy.cs.gpio.port,
|
||||||
K_OBJ_DRIVER_GPIO));
|
K_OBJ_DRIVER_GPIO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ static inline int z_vrfy_spi_transceive(const struct device *dev,
|
||||||
static inline int z_vrfy_spi_release(const struct device *dev,
|
static inline int z_vrfy_spi_release(const struct device *dev,
|
||||||
const struct spi_config *config)
|
const struct spi_config *config)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(config, sizeof(*config)));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(config, sizeof(*config)));
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_SPI(dev, release));
|
Z_OOPS(Z_SYSCALL_DRIVER_SPI(dev, release));
|
||||||
return z_impl_spi_release((const struct device *)dev, config);
|
return z_impl_spi_release((const struct device *)dev, config);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ static inline size_t z_vrfy_ivshmem_get_mem(const struct device *dev,
|
||||||
uintptr_t *memmap)
|
uintptr_t *memmap)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_IVSHMEM(dev, get_mem));
|
Z_OOPS(Z_SYSCALL_DRIVER_IVSHMEM(dev, get_mem));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(memmap, sizeof(uintptr_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(memmap, sizeof(uintptr_t)));
|
||||||
|
|
||||||
return z_impl_ivshmem_get_mem(dev, memmap);
|
return z_impl_ivshmem_get_mem(dev, memmap);
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ static inline int z_vrfy_ivshmem_register_handler(const struct device *dev,
|
||||||
uint16_t vector)
|
uint16_t vector)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_IVSHMEM(dev, register_handler));
|
Z_OOPS(Z_SYSCALL_DRIVER_IVSHMEM(dev, register_handler));
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(signal, K_OBJ_POLL_SIGNAL));
|
Z_OOPS(K_SYSCALL_OBJ(signal, K_OBJ_POLL_SIGNAL));
|
||||||
|
|
||||||
return z_impl_ivshmem_register_handler(dev, signal, vector);
|
return z_impl_ivshmem_register_handler(dev, signal, vector);
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ static inline size_t z_vrfy_ivshmem_get_rw_mem_section(const struct device *dev,
|
||||||
uintptr_t *memmap)
|
uintptr_t *memmap)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_IVSHMEM(dev, get_rw_mem_section));
|
Z_OOPS(Z_SYSCALL_DRIVER_IVSHMEM(dev, get_rw_mem_section));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(memmap, sizeof(uintptr_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(memmap, sizeof(uintptr_t)));
|
||||||
|
|
||||||
return z_impl_ivshmem_get_rw_mem_section(dev, memmap);
|
return z_impl_ivshmem_get_rw_mem_section(dev, memmap);
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ static inline size_t z_vrfy_ivshmem_get_output_mem_section(const struct device *
|
||||||
uintptr_t *memmap)
|
uintptr_t *memmap)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_IVSHMEM(dev, get_output_mem_section));
|
Z_OOPS(Z_SYSCALL_DRIVER_IVSHMEM(dev, get_output_mem_section));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(memmap, sizeof(uintptr_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(memmap, sizeof(uintptr_t)));
|
||||||
|
|
||||||
return z_impl_ivshmem_get_output_mem_section(dev, peer_id, memmap);
|
return z_impl_ivshmem_get_output_mem_section(dev, peer_id, memmap);
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,8 +50,8 @@ static inline int z_vrfy_w1_write_byte(const struct device *dev, uint8_t byte)
|
||||||
static inline int z_vrfy_w1_read_block(const struct device *dev,
|
static inline int z_vrfy_w1_read_block(const struct device *dev,
|
||||||
uint8_t *buffer, size_t len)
|
uint8_t *buffer, size_t len)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_W1));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_W1));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(buffer, len));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(buffer, len));
|
||||||
|
|
||||||
return z_impl_w1_read_block((const struct device *)dev,
|
return z_impl_w1_read_block((const struct device *)dev,
|
||||||
(uint8_t *)buffer, (size_t)len);
|
(uint8_t *)buffer, (size_t)len);
|
||||||
|
@ -61,8 +61,8 @@ static inline int z_vrfy_w1_read_block(const struct device *dev,
|
||||||
static inline int z_vrfy_w1_write_block(const struct device *dev,
|
static inline int z_vrfy_w1_write_block(const struct device *dev,
|
||||||
const uint8_t *buffer, size_t len)
|
const uint8_t *buffer, size_t len)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_W1));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_W1));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(buffer, len));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(buffer, len));
|
||||||
|
|
||||||
return z_impl_w1_write_block((const struct device *)dev,
|
return z_impl_w1_write_block((const struct device *)dev,
|
||||||
(const uint8_t *)buffer, (size_t)len);
|
(const uint8_t *)buffer, (size_t)len);
|
||||||
|
@ -71,7 +71,7 @@ static inline int z_vrfy_w1_write_block(const struct device *dev,
|
||||||
|
|
||||||
static inline int z_vrfy_w1_change_bus_lock(const struct device *dev, bool lock)
|
static inline int z_vrfy_w1_change_bus_lock(const struct device *dev, bool lock)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_W1));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_W1));
|
||||||
|
|
||||||
return z_impl_w1_change_bus_lock((const struct device *)dev, lock);
|
return z_impl_w1_change_bus_lock((const struct device *)dev, lock);
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ static inline int z_vrfy_w1_configure(const struct device *dev,
|
||||||
|
|
||||||
static inline size_t z_vrfy_w1_get_slave_count(const struct device *dev)
|
static inline size_t z_vrfy_w1_get_slave_count(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_W1));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_W1));
|
||||||
|
|
||||||
return z_impl_w1_get_slave_count((const struct device *)dev);
|
return z_impl_w1_get_slave_count((const struct device *)dev);
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ static inline int z_vrfy_w1_search_bus(const struct device *dev,
|
||||||
w1_search_callback_t callback,
|
w1_search_callback_t callback,
|
||||||
void *user_data)
|
void *user_data)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_W1));
|
Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_W1));
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(callback == 0,
|
Z_OOPS(K_SYSCALL_VERIFY_MSG(callback == 0,
|
||||||
"callbacks may not be set from user mode"));
|
"callbacks may not be set from user mode"));
|
||||||
|
|
|
@ -189,7 +189,7 @@ void k_object_recycle(const void *obj);
|
||||||
* will be safely handled and an error code returned.
|
* will be safely handled and an error code returned.
|
||||||
*
|
*
|
||||||
* NOTE: Doesn't guarantee that user mode has actual access to this
|
* NOTE: Doesn't guarantee that user mode has actual access to this
|
||||||
* string, you will need to still do a Z_SYSCALL_MEMORY_READ()
|
* string, you will need to still do a K_SYSCALL_MEMORY_READ()
|
||||||
* with the obtained size value to guarantee this.
|
* with the obtained size value to guarantee this.
|
||||||
*
|
*
|
||||||
* @param src String to measure size of
|
* @param src String to measure size of
|
||||||
|
@ -346,7 +346,7 @@ int k_usermode_string_copy(char *dst, const char *src, size_t maxlen);
|
||||||
* read it
|
* read it
|
||||||
* @return 0 on success, nonzero on failure
|
* @return 0 on success, nonzero on failure
|
||||||
*/
|
*/
|
||||||
#define Z_SYSCALL_MEMORY(ptr, size, write) \
|
#define K_SYSCALL_MEMORY(ptr, size, write) \
|
||||||
K_SYSCALL_VERIFY_MSG(arch_buffer_validate((void *)ptr, size, write) \
|
K_SYSCALL_VERIFY_MSG(arch_buffer_validate((void *)ptr, size, write) \
|
||||||
== 0, \
|
== 0, \
|
||||||
"Memory region %p (size %zu) %s access denied", \
|
"Memory region %p (size %zu) %s access denied", \
|
||||||
|
@ -366,8 +366,8 @@ int k_usermode_string_copy(char *dst, const char *src, size_t maxlen);
|
||||||
* @param size Size of the memory area
|
* @param size Size of the memory area
|
||||||
* @return 0 on success, nonzero on failure
|
* @return 0 on success, nonzero on failure
|
||||||
*/
|
*/
|
||||||
#define Z_SYSCALL_MEMORY_READ(ptr, size) \
|
#define K_SYSCALL_MEMORY_READ(ptr, size) \
|
||||||
Z_SYSCALL_MEMORY(ptr, size, 0)
|
K_SYSCALL_MEMORY(ptr, size, 0)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Runtime check that a user thread has write permission to a memory area
|
* @brief Runtime check that a user thread has write permission to a memory area
|
||||||
|
@ -382,8 +382,8 @@ int k_usermode_string_copy(char *dst, const char *src, size_t maxlen);
|
||||||
* @param size Size of the memory area
|
* @param size Size of the memory area
|
||||||
* @param 0 on success, nonzero on failure
|
* @param 0 on success, nonzero on failure
|
||||||
*/
|
*/
|
||||||
#define Z_SYSCALL_MEMORY_WRITE(ptr, size) \
|
#define K_SYSCALL_MEMORY_WRITE(ptr, size) \
|
||||||
Z_SYSCALL_MEMORY(ptr, size, 1)
|
K_SYSCALL_MEMORY(ptr, size, 1)
|
||||||
|
|
||||||
#define K_SYSCALL_MEMORY_ARRAY(ptr, nmemb, size, write) \
|
#define K_SYSCALL_MEMORY_ARRAY(ptr, nmemb, size, write) \
|
||||||
({ \
|
({ \
|
||||||
|
@ -393,7 +393,7 @@ int k_usermode_string_copy(char *dst, const char *src, size_t maxlen);
|
||||||
&product), \
|
&product), \
|
||||||
"%zux%zu array is too large", \
|
"%zux%zu array is too large", \
|
||||||
(size_t)(nmemb), (size_t)(size)) || \
|
(size_t)(nmemb), (size_t)(size)) || \
|
||||||
Z_SYSCALL_MEMORY(ptr, product, write); \
|
K_SYSCALL_MEMORY(ptr, product, write); \
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -462,7 +462,7 @@ static inline int k_object_validation_check(struct k_object *ko,
|
||||||
* @param op Driver operation (e.g. manage_callback)
|
* @param op Driver operation (e.g. manage_callback)
|
||||||
* @return 0 on success, nonzero on failure
|
* @return 0 on success, nonzero on failure
|
||||||
*/
|
*/
|
||||||
#define Z_SYSCALL_DRIVER_OP(ptr, api_name, op) \
|
#define K_SYSCALL_DRIVER_OP(ptr, api_name, op) \
|
||||||
({ \
|
({ \
|
||||||
struct api_name *__device__ = (struct api_name *) \
|
struct api_name *__device__ = (struct api_name *) \
|
||||||
((const struct device *)ptr)->api; \
|
((const struct device *)ptr)->api; \
|
||||||
|
@ -490,10 +490,10 @@ static inline int k_object_validation_check(struct k_object *ko,
|
||||||
* @param _api Expected driver API structure memory address
|
* @param _api Expected driver API structure memory address
|
||||||
* @return 0 on success, nonzero on failure
|
* @return 0 on success, nonzero on failure
|
||||||
*/
|
*/
|
||||||
#define Z_SYSCALL_SPECIFIC_DRIVER(_device, _dtype, _api) \
|
#define K_SYSCALL_SPECIFIC_DRIVER(_device, _dtype, _api) \
|
||||||
({ \
|
({ \
|
||||||
const struct device *_dev = (const struct device *)_device; \
|
const struct device *_dev = (const struct device *)_device; \
|
||||||
Z_SYSCALL_OBJ(_dev, _dtype) || \
|
K_SYSCALL_OBJ(_dev, _dtype) || \
|
||||||
K_SYSCALL_VERIFY_MSG(_dev->api == _api, \
|
K_SYSCALL_VERIFY_MSG(_dev->api == _api, \
|
||||||
"API structure mismatch"); \
|
"API structure mismatch"); \
|
||||||
})
|
})
|
||||||
|
@ -509,7 +509,7 @@ static inline int k_object_validation_check(struct k_object *ko,
|
||||||
* @param type Expected kernel object type
|
* @param type Expected kernel object type
|
||||||
* @return 0 on success, nonzero on failure
|
* @return 0 on success, nonzero on failure
|
||||||
*/
|
*/
|
||||||
#define Z_SYSCALL_OBJ(ptr, type) \
|
#define K_SYSCALL_OBJ(ptr, type) \
|
||||||
K_SYSCALL_IS_OBJ(ptr, type, _OBJ_INIT_TRUE)
|
K_SYSCALL_IS_OBJ(ptr, type, _OBJ_INIT_TRUE)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -523,7 +523,7 @@ static inline int k_object_validation_check(struct k_object *ko,
|
||||||
* @return 0 on success, nonzero on failure
|
* @return 0 on success, nonzero on failure
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define Z_SYSCALL_OBJ_INIT(ptr, type) \
|
#define K_SYSCALL_OBJ_INIT(ptr, type) \
|
||||||
K_SYSCALL_IS_OBJ(ptr, type, _OBJ_INIT_ANY)
|
K_SYSCALL_IS_OBJ(ptr, type, _OBJ_INIT_ANY)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -539,7 +539,7 @@ static inline int k_object_validation_check(struct k_object *ko,
|
||||||
* @return 0 on success, nonzero on failure
|
* @return 0 on success, nonzero on failure
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define Z_SYSCALL_OBJ_NEVER_INIT(ptr, type) \
|
#define K_SYSCALL_OBJ_NEVER_INIT(ptr, type) \
|
||||||
K_SYSCALL_IS_OBJ(ptr, type, _OBJ_INIT_FALSE)
|
K_SYSCALL_IS_OBJ(ptr, type, _OBJ_INIT_FALSE)
|
||||||
|
|
||||||
#include <driver-validation.h>
|
#include <driver-validation.h>
|
||||||
|
|
|
@ -42,7 +42,7 @@ static struct k_spinlock lock;
|
||||||
#define ATOMIC_SYSCALL_HANDLER_TARGET(name) \
|
#define ATOMIC_SYSCALL_HANDLER_TARGET(name) \
|
||||||
static inline atomic_val_t z_vrfy_##name(atomic_t *target) \
|
static inline atomic_val_t z_vrfy_##name(atomic_t *target) \
|
||||||
{ \
|
{ \
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(target, sizeof(atomic_t))); \
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(target, sizeof(atomic_t))); \
|
||||||
return z_impl_##name((atomic_t *)target); \
|
return z_impl_##name((atomic_t *)target); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ static struct k_spinlock lock;
|
||||||
static inline atomic_val_t z_vrfy_##name(atomic_t *target, \
|
static inline atomic_val_t z_vrfy_##name(atomic_t *target, \
|
||||||
atomic_val_t value) \
|
atomic_val_t value) \
|
||||||
{ \
|
{ \
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(target, sizeof(atomic_t))); \
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(target, sizeof(atomic_t))); \
|
||||||
return z_impl_##name((atomic_t *)target, value); \
|
return z_impl_##name((atomic_t *)target, value); \
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -108,7 +108,7 @@ bool z_impl_atomic_cas(atomic_t *target, atomic_val_t old_value,
|
||||||
bool z_vrfy_atomic_cas(atomic_t *target, atomic_val_t old_value,
|
bool z_vrfy_atomic_cas(atomic_t *target, atomic_val_t old_value,
|
||||||
atomic_val_t new_value)
|
atomic_val_t new_value)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(target, sizeof(atomic_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(target, sizeof(atomic_t)));
|
||||||
|
|
||||||
return z_impl_atomic_cas((atomic_t *)target, old_value, new_value);
|
return z_impl_atomic_cas((atomic_t *)target, old_value, new_value);
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ static inline bool z_vrfy_atomic_ptr_cas(atomic_ptr_t *target,
|
||||||
atomic_ptr_val_t old_value,
|
atomic_ptr_val_t old_value,
|
||||||
atomic_ptr_val_t new_value)
|
atomic_ptr_val_t new_value)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(target, sizeof(atomic_ptr_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(target, sizeof(atomic_ptr_t)));
|
||||||
|
|
||||||
return z_impl_atomic_ptr_cas(target, old_value, new_value);
|
return z_impl_atomic_ptr_cas(target, old_value, new_value);
|
||||||
}
|
}
|
||||||
|
@ -276,7 +276,7 @@ atomic_ptr_val_t z_impl_atomic_ptr_set(atomic_ptr_t *target,
|
||||||
static inline atomic_ptr_val_t z_vrfy_atomic_ptr_set(atomic_ptr_t *target,
|
static inline atomic_ptr_val_t z_vrfy_atomic_ptr_set(atomic_ptr_t *target,
|
||||||
atomic_ptr_val_t value)
|
atomic_ptr_val_t value)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(target, sizeof(atomic_ptr_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(target, sizeof(atomic_ptr_t)));
|
||||||
|
|
||||||
return z_impl_atomic_ptr_set(target, value);
|
return z_impl_atomic_ptr_set(target, value);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ int z_impl_k_condvar_init(struct k_condvar *condvar)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
int z_vrfy_k_condvar_init(struct k_condvar *condvar)
|
int z_vrfy_k_condvar_init(struct k_condvar *condvar)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ_INIT(condvar, K_OBJ_CONDVAR));
|
Z_OOPS(K_SYSCALL_OBJ_INIT(condvar, K_OBJ_CONDVAR));
|
||||||
return z_impl_k_condvar_init(condvar);
|
return z_impl_k_condvar_init(condvar);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_condvar_init_mrsh.c>
|
#include <syscalls/k_condvar_init_mrsh.c>
|
||||||
|
@ -67,7 +67,7 @@ int z_impl_k_condvar_signal(struct k_condvar *condvar)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
int z_vrfy_k_condvar_signal(struct k_condvar *condvar)
|
int z_vrfy_k_condvar_signal(struct k_condvar *condvar)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(condvar, K_OBJ_CONDVAR));
|
Z_OOPS(K_SYSCALL_OBJ(condvar, K_OBJ_CONDVAR));
|
||||||
return z_impl_k_condvar_signal(condvar);
|
return z_impl_k_condvar_signal(condvar);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_condvar_signal_mrsh.c>
|
#include <syscalls/k_condvar_signal_mrsh.c>
|
||||||
|
@ -100,7 +100,7 @@ int z_impl_k_condvar_broadcast(struct k_condvar *condvar)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
int z_vrfy_k_condvar_broadcast(struct k_condvar *condvar)
|
int z_vrfy_k_condvar_broadcast(struct k_condvar *condvar)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(condvar, K_OBJ_CONDVAR));
|
Z_OOPS(K_SYSCALL_OBJ(condvar, K_OBJ_CONDVAR));
|
||||||
return z_impl_k_condvar_broadcast(condvar);
|
return z_impl_k_condvar_broadcast(condvar);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_condvar_broadcast_mrsh.c>
|
#include <syscalls/k_condvar_broadcast_mrsh.c>
|
||||||
|
@ -128,8 +128,8 @@ int z_impl_k_condvar_wait(struct k_condvar *condvar, struct k_mutex *mutex,
|
||||||
int z_vrfy_k_condvar_wait(struct k_condvar *condvar, struct k_mutex *mutex,
|
int z_vrfy_k_condvar_wait(struct k_condvar *condvar, struct k_mutex *mutex,
|
||||||
k_timeout_t timeout)
|
k_timeout_t timeout)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(condvar, K_OBJ_CONDVAR));
|
Z_OOPS(K_SYSCALL_OBJ(condvar, K_OBJ_CONDVAR));
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(mutex, K_OBJ_MUTEX));
|
Z_OOPS(K_SYSCALL_OBJ(mutex, K_OBJ_MUTEX));
|
||||||
return z_impl_k_condvar_wait(condvar, mutex, timeout);
|
return z_impl_k_condvar_wait(condvar, mutex, timeout);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_condvar_wait_mrsh.c>
|
#include <syscalls/k_condvar_wait_mrsh.c>
|
||||||
|
|
|
@ -70,7 +70,7 @@ static inline const struct device *z_vrfy_device_get_binding(const char *name)
|
||||||
|
|
||||||
static inline bool z_vrfy_device_is_ready(const struct device *dev)
|
static inline bool z_vrfy_device_is_ready(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ_INIT(dev, K_OBJ_ANY));
|
Z_OOPS(K_SYSCALL_OBJ_INIT(dev, K_OBJ_ANY));
|
||||||
|
|
||||||
return z_impl_device_is_ready(dev);
|
return z_impl_device_is_ready(dev);
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ void z_impl_k_event_init(struct k_event *event)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
void z_vrfy_k_event_init(struct k_event *event)
|
void z_vrfy_k_event_init(struct k_event *event)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ_NEVER_INIT(event, K_OBJ_EVENT));
|
Z_OOPS(K_SYSCALL_OBJ_NEVER_INIT(event, K_OBJ_EVENT));
|
||||||
z_impl_k_event_init(event);
|
z_impl_k_event_init(event);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_event_init_mrsh.c>
|
#include <syscalls/k_event_init_mrsh.c>
|
||||||
|
@ -187,7 +187,7 @@ uint32_t z_impl_k_event_post(struct k_event *event, uint32_t events)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
uint32_t z_vrfy_k_event_post(struct k_event *event, uint32_t events)
|
uint32_t z_vrfy_k_event_post(struct k_event *event, uint32_t events)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(event, K_OBJ_EVENT));
|
Z_OOPS(K_SYSCALL_OBJ(event, K_OBJ_EVENT));
|
||||||
return z_impl_k_event_post(event, events);
|
return z_impl_k_event_post(event, events);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_event_post_mrsh.c>
|
#include <syscalls/k_event_post_mrsh.c>
|
||||||
|
@ -201,7 +201,7 @@ uint32_t z_impl_k_event_set(struct k_event *event, uint32_t events)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
uint32_t z_vrfy_k_event_set(struct k_event *event, uint32_t events)
|
uint32_t z_vrfy_k_event_set(struct k_event *event, uint32_t events)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(event, K_OBJ_EVENT));
|
Z_OOPS(K_SYSCALL_OBJ(event, K_OBJ_EVENT));
|
||||||
return z_impl_k_event_set(event, events);
|
return z_impl_k_event_set(event, events);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_event_set_mrsh.c>
|
#include <syscalls/k_event_set_mrsh.c>
|
||||||
|
@ -217,7 +217,7 @@ uint32_t z_impl_k_event_set_masked(struct k_event *event, uint32_t events,
|
||||||
uint32_t z_vrfy_k_event_set_masked(struct k_event *event, uint32_t events,
|
uint32_t z_vrfy_k_event_set_masked(struct k_event *event, uint32_t events,
|
||||||
uint32_t events_mask)
|
uint32_t events_mask)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(event, K_OBJ_EVENT));
|
Z_OOPS(K_SYSCALL_OBJ(event, K_OBJ_EVENT));
|
||||||
return z_impl_k_event_set_masked(event, events, events_mask);
|
return z_impl_k_event_set_masked(event, events, events_mask);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_event_set_masked_mrsh.c>
|
#include <syscalls/k_event_set_masked_mrsh.c>
|
||||||
|
@ -231,7 +231,7 @@ uint32_t z_impl_k_event_clear(struct k_event *event, uint32_t events)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
uint32_t z_vrfy_k_event_clear(struct k_event *event, uint32_t events)
|
uint32_t z_vrfy_k_event_clear(struct k_event *event, uint32_t events)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(event, K_OBJ_EVENT));
|
Z_OOPS(K_SYSCALL_OBJ(event, K_OBJ_EVENT));
|
||||||
return z_impl_k_event_clear(event, events);
|
return z_impl_k_event_clear(event, events);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_event_clear_mrsh.c>
|
#include <syscalls/k_event_clear_mrsh.c>
|
||||||
|
@ -317,7 +317,7 @@ uint32_t z_impl_k_event_wait(struct k_event *event, uint32_t events,
|
||||||
uint32_t z_vrfy_k_event_wait(struct k_event *event, uint32_t events,
|
uint32_t z_vrfy_k_event_wait(struct k_event *event, uint32_t events,
|
||||||
bool reset, k_timeout_t timeout)
|
bool reset, k_timeout_t timeout)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(event, K_OBJ_EVENT));
|
Z_OOPS(K_SYSCALL_OBJ(event, K_OBJ_EVENT));
|
||||||
return z_impl_k_event_wait(event, events, reset, timeout);
|
return z_impl_k_event_wait(event, events, reset, timeout);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_event_wait_mrsh.c>
|
#include <syscalls/k_event_wait_mrsh.c>
|
||||||
|
@ -339,7 +339,7 @@ uint32_t z_impl_k_event_wait_all(struct k_event *event, uint32_t events,
|
||||||
uint32_t z_vrfy_k_event_wait_all(struct k_event *event, uint32_t events,
|
uint32_t z_vrfy_k_event_wait_all(struct k_event *event, uint32_t events,
|
||||||
bool reset, k_timeout_t timeout)
|
bool reset, k_timeout_t timeout)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(event, K_OBJ_EVENT));
|
Z_OOPS(K_SYSCALL_OBJ(event, K_OBJ_EVENT));
|
||||||
return z_impl_k_event_wait_all(event, events, reset, timeout);
|
return z_impl_k_event_wait_all(event, events, reset, timeout);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_event_wait_all_mrsh.c>
|
#include <syscalls/k_event_wait_all_mrsh.c>
|
||||||
|
|
|
@ -54,7 +54,7 @@ int z_impl_k_futex_wake(struct k_futex *futex, bool wake_all)
|
||||||
|
|
||||||
static inline int z_vrfy_k_futex_wake(struct k_futex *futex, bool wake_all)
|
static inline int z_vrfy_k_futex_wake(struct k_futex *futex, bool wake_all)
|
||||||
{
|
{
|
||||||
if (Z_SYSCALL_MEMORY_WRITE(futex, sizeof(struct k_futex)) != 0) {
|
if (K_SYSCALL_MEMORY_WRITE(futex, sizeof(struct k_futex)) != 0) {
|
||||||
return -EACCES;
|
return -EACCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ int z_impl_k_futex_wait(struct k_futex *futex, int expected,
|
||||||
static inline int z_vrfy_k_futex_wait(struct k_futex *futex, int expected,
|
static inline int z_vrfy_k_futex_wait(struct k_futex *futex, int expected,
|
||||||
k_timeout_t timeout)
|
k_timeout_t timeout)
|
||||||
{
|
{
|
||||||
if (Z_SYSCALL_MEMORY_WRITE(futex, sizeof(struct k_futex)) != 0) {
|
if (K_SYSCALL_MEMORY_WRITE(futex, sizeof(struct k_futex)) != 0) {
|
||||||
return -EACCES;
|
return -EACCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ int z_impl_k_msgq_alloc_init(struct k_msgq *msgq, size_t msg_size,
|
||||||
int z_vrfy_k_msgq_alloc_init(struct k_msgq *msgq, size_t msg_size,
|
int z_vrfy_k_msgq_alloc_init(struct k_msgq *msgq, size_t msg_size,
|
||||||
uint32_t max_msgs)
|
uint32_t max_msgs)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ_NEVER_INIT(msgq, K_OBJ_MSGQ));
|
Z_OOPS(K_SYSCALL_OBJ_NEVER_INIT(msgq, K_OBJ_MSGQ));
|
||||||
|
|
||||||
return z_impl_k_msgq_alloc_init(msgq, msg_size, max_msgs);
|
return z_impl_k_msgq_alloc_init(msgq, msg_size, max_msgs);
|
||||||
}
|
}
|
||||||
|
@ -187,8 +187,8 @@ int z_impl_k_msgq_put(struct k_msgq *msgq, const void *data, k_timeout_t timeout
|
||||||
static inline int z_vrfy_k_msgq_put(struct k_msgq *msgq, const void *data,
|
static inline int z_vrfy_k_msgq_put(struct k_msgq *msgq, const void *data,
|
||||||
k_timeout_t timeout)
|
k_timeout_t timeout)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
Z_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(data, msgq->msg_size));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(data, msgq->msg_size));
|
||||||
|
|
||||||
return z_impl_k_msgq_put(msgq, data, timeout);
|
return z_impl_k_msgq_put(msgq, data, timeout);
|
||||||
}
|
}
|
||||||
|
@ -206,8 +206,8 @@ void z_impl_k_msgq_get_attrs(struct k_msgq *msgq, struct k_msgq_attrs *attrs)
|
||||||
static inline void z_vrfy_k_msgq_get_attrs(struct k_msgq *msgq,
|
static inline void z_vrfy_k_msgq_get_attrs(struct k_msgq *msgq,
|
||||||
struct k_msgq_attrs *attrs)
|
struct k_msgq_attrs *attrs)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
Z_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(attrs, sizeof(struct k_msgq_attrs)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(attrs, sizeof(struct k_msgq_attrs)));
|
||||||
z_impl_k_msgq_get_attrs(msgq, attrs);
|
z_impl_k_msgq_get_attrs(msgq, attrs);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_msgq_get_attrs_mrsh.c>
|
#include <syscalls/k_msgq_get_attrs_mrsh.c>
|
||||||
|
@ -285,8 +285,8 @@ int z_impl_k_msgq_get(struct k_msgq *msgq, void *data, k_timeout_t timeout)
|
||||||
static inline int z_vrfy_k_msgq_get(struct k_msgq *msgq, void *data,
|
static inline int z_vrfy_k_msgq_get(struct k_msgq *msgq, void *data,
|
||||||
k_timeout_t timeout)
|
k_timeout_t timeout)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
Z_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(data, msgq->msg_size));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(data, msgq->msg_size));
|
||||||
|
|
||||||
return z_impl_k_msgq_get(msgq, data, timeout);
|
return z_impl_k_msgq_get(msgq, data, timeout);
|
||||||
}
|
}
|
||||||
|
@ -319,8 +319,8 @@ int z_impl_k_msgq_peek(struct k_msgq *msgq, void *data)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline int z_vrfy_k_msgq_peek(struct k_msgq *msgq, void *data)
|
static inline int z_vrfy_k_msgq_peek(struct k_msgq *msgq, void *data)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
Z_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(data, msgq->msg_size));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(data, msgq->msg_size));
|
||||||
|
|
||||||
return z_impl_k_msgq_peek(msgq, data);
|
return z_impl_k_msgq_peek(msgq, data);
|
||||||
}
|
}
|
||||||
|
@ -365,8 +365,8 @@ int z_impl_k_msgq_peek_at(struct k_msgq *msgq, void *data, uint32_t idx)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline int z_vrfy_k_msgq_peek_at(struct k_msgq *msgq, void *data, uint32_t idx)
|
static inline int z_vrfy_k_msgq_peek_at(struct k_msgq *msgq, void *data, uint32_t idx)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
Z_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(data, msgq->msg_size));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(data, msgq->msg_size));
|
||||||
|
|
||||||
return z_impl_k_msgq_peek_at(msgq, data, idx);
|
return z_impl_k_msgq_peek_at(msgq, data, idx);
|
||||||
}
|
}
|
||||||
|
@ -397,21 +397,21 @@ void z_impl_k_msgq_purge(struct k_msgq *msgq)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline void z_vrfy_k_msgq_purge(struct k_msgq *msgq)
|
static inline void z_vrfy_k_msgq_purge(struct k_msgq *msgq)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
Z_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
||||||
z_impl_k_msgq_purge(msgq);
|
z_impl_k_msgq_purge(msgq);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_msgq_purge_mrsh.c>
|
#include <syscalls/k_msgq_purge_mrsh.c>
|
||||||
|
|
||||||
static inline uint32_t z_vrfy_k_msgq_num_free_get(struct k_msgq *msgq)
|
static inline uint32_t z_vrfy_k_msgq_num_free_get(struct k_msgq *msgq)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
Z_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
||||||
return z_impl_k_msgq_num_free_get(msgq);
|
return z_impl_k_msgq_num_free_get(msgq);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_msgq_num_free_get_mrsh.c>
|
#include <syscalls/k_msgq_num_free_get_mrsh.c>
|
||||||
|
|
||||||
static inline uint32_t z_vrfy_k_msgq_num_used_get(struct k_msgq *msgq)
|
static inline uint32_t z_vrfy_k_msgq_num_used_get(struct k_msgq *msgq)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
Z_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
||||||
return z_impl_k_msgq_num_used_get(msgq);
|
return z_impl_k_msgq_num_used_get(msgq);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_msgq_num_used_get_mrsh.c>
|
#include <syscalls/k_msgq_num_used_get_mrsh.c>
|
||||||
|
|
|
@ -71,7 +71,7 @@ int z_impl_k_mutex_init(struct k_mutex *mutex)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline int z_vrfy_k_mutex_init(struct k_mutex *mutex)
|
static inline int z_vrfy_k_mutex_init(struct k_mutex *mutex)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ_INIT(mutex, K_OBJ_MUTEX));
|
Z_OOPS(K_SYSCALL_OBJ_INIT(mutex, K_OBJ_MUTEX));
|
||||||
return z_impl_k_mutex_init(mutex);
|
return z_impl_k_mutex_init(mutex);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_mutex_init_mrsh.c>
|
#include <syscalls/k_mutex_init_mrsh.c>
|
||||||
|
@ -200,7 +200,7 @@ int z_impl_k_mutex_lock(struct k_mutex *mutex, k_timeout_t timeout)
|
||||||
static inline int z_vrfy_k_mutex_lock(struct k_mutex *mutex,
|
static inline int z_vrfy_k_mutex_lock(struct k_mutex *mutex,
|
||||||
k_timeout_t timeout)
|
k_timeout_t timeout)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(mutex, K_OBJ_MUTEX));
|
Z_OOPS(K_SYSCALL_OBJ(mutex, K_OBJ_MUTEX));
|
||||||
return z_impl_k_mutex_lock(mutex, timeout);
|
return z_impl_k_mutex_lock(mutex, timeout);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_mutex_lock_mrsh.c>
|
#include <syscalls/k_mutex_lock_mrsh.c>
|
||||||
|
@ -284,7 +284,7 @@ k_mutex_unlock_return:
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline int z_vrfy_k_mutex_unlock(struct k_mutex *mutex)
|
static inline int z_vrfy_k_mutex_unlock(struct k_mutex *mutex)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(mutex, K_OBJ_MUTEX));
|
Z_OOPS(K_SYSCALL_OBJ(mutex, K_OBJ_MUTEX));
|
||||||
return z_impl_k_mutex_unlock(mutex);
|
return z_impl_k_mutex_unlock(mutex);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_mutex_unlock_mrsh.c>
|
#include <syscalls/k_mutex_unlock_mrsh.c>
|
||||||
|
|
|
@ -102,7 +102,7 @@ void z_impl_k_mem_paging_stats_get(struct k_mem_paging_stats_t *stats)
|
||||||
static inline
|
static inline
|
||||||
void z_vrfy_k_mem_paging_stats_get(struct k_mem_paging_stats_t *stats)
|
void z_vrfy_k_mem_paging_stats_get(struct k_mem_paging_stats_t *stats)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(stats, sizeof(*stats)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(stats, sizeof(*stats)));
|
||||||
z_impl_k_mem_paging_stats_get(stats);
|
z_impl_k_mem_paging_stats_get(stats);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_mem_paging_stats_get_mrsh.c>
|
#include <syscalls/k_mem_paging_stats_get_mrsh.c>
|
||||||
|
@ -125,8 +125,8 @@ static inline
|
||||||
void z_vrfy_k_mem_paging_thread_stats_get(struct k_thread *thread,
|
void z_vrfy_k_mem_paging_thread_stats_get(struct k_thread *thread,
|
||||||
struct k_mem_paging_stats_t *stats)
|
struct k_mem_paging_stats_t *stats)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
Z_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(stats, sizeof(*stats)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(stats, sizeof(*stats)));
|
||||||
z_impl_k_mem_paging_thread_stats_get(thread, stats);
|
z_impl_k_mem_paging_thread_stats_get(thread, stats);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_mem_paging_thread_stats_get_mrsh.c>
|
#include <syscalls/k_mem_paging_thread_stats_get_mrsh.c>
|
||||||
|
@ -224,7 +224,7 @@ static inline
|
||||||
void z_vrfy_k_mem_paging_histogram_eviction_get(
|
void z_vrfy_k_mem_paging_histogram_eviction_get(
|
||||||
struct k_mem_paging_histogram_t *hist)
|
struct k_mem_paging_histogram_t *hist)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(hist, sizeof(*hist)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(hist, sizeof(*hist)));
|
||||||
z_impl_k_mem_paging_histogram_eviction_get(hist);
|
z_impl_k_mem_paging_histogram_eviction_get(hist);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_mem_paging_histogram_eviction_get_mrsh.c>
|
#include <syscalls/k_mem_paging_histogram_eviction_get_mrsh.c>
|
||||||
|
@ -233,7 +233,7 @@ static inline
|
||||||
void z_vrfy_k_mem_paging_histogram_backing_store_page_in_get(
|
void z_vrfy_k_mem_paging_histogram_backing_store_page_in_get(
|
||||||
struct k_mem_paging_histogram_t *hist)
|
struct k_mem_paging_histogram_t *hist)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(hist, sizeof(*hist)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(hist, sizeof(*hist)));
|
||||||
z_impl_k_mem_paging_histogram_backing_store_page_in_get(hist);
|
z_impl_k_mem_paging_histogram_backing_store_page_in_get(hist);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_mem_paging_histogram_backing_store_page_in_get_mrsh.c>
|
#include <syscalls/k_mem_paging_histogram_backing_store_page_in_get_mrsh.c>
|
||||||
|
@ -242,7 +242,7 @@ static inline
|
||||||
void z_vrfy_k_mem_paging_histogram_backing_store_page_out_get(
|
void z_vrfy_k_mem_paging_histogram_backing_store_page_out_get(
|
||||||
struct k_mem_paging_histogram_t *hist)
|
struct k_mem_paging_histogram_t *hist)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(hist, sizeof(*hist)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(hist, sizeof(*hist)));
|
||||||
z_impl_k_mem_paging_histogram_backing_store_page_out_get(hist);
|
z_impl_k_mem_paging_histogram_backing_store_page_out_get(hist);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_mem_paging_histogram_backing_store_page_out_get_mrsh.c>
|
#include <syscalls/k_mem_paging_histogram_backing_store_page_out_get_mrsh.c>
|
||||||
|
|
|
@ -89,7 +89,7 @@ int z_impl_k_pipe_alloc_init(struct k_pipe *pipe, size_t size)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline int z_vrfy_k_pipe_alloc_init(struct k_pipe *pipe, size_t size)
|
static inline int z_vrfy_k_pipe_alloc_init(struct k_pipe *pipe, size_t size)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ_NEVER_INIT(pipe, K_OBJ_PIPE));
|
Z_OOPS(K_SYSCALL_OBJ_NEVER_INIT(pipe, K_OBJ_PIPE));
|
||||||
|
|
||||||
return z_impl_k_pipe_alloc_init(pipe, size);
|
return z_impl_k_pipe_alloc_init(pipe, size);
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ void z_impl_k_pipe_flush(struct k_pipe *pipe)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
void z_vrfy_k_pipe_flush(struct k_pipe *pipe)
|
void z_vrfy_k_pipe_flush(struct k_pipe *pipe)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(pipe, K_OBJ_PIPE));
|
Z_OOPS(K_SYSCALL_OBJ(pipe, K_OBJ_PIPE));
|
||||||
|
|
||||||
z_impl_k_pipe_flush(pipe);
|
z_impl_k_pipe_flush(pipe);
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ void z_impl_k_pipe_buffer_flush(struct k_pipe *pipe)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
void z_vrfy_k_pipe_buffer_flush(struct k_pipe *pipe)
|
void z_vrfy_k_pipe_buffer_flush(struct k_pipe *pipe)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(pipe, K_OBJ_PIPE));
|
Z_OOPS(K_SYSCALL_OBJ(pipe, K_OBJ_PIPE));
|
||||||
|
|
||||||
z_impl_k_pipe_buffer_flush(pipe);
|
z_impl_k_pipe_buffer_flush(pipe);
|
||||||
}
|
}
|
||||||
|
@ -517,9 +517,9 @@ int z_vrfy_k_pipe_put(struct k_pipe *pipe, void *data, size_t bytes_to_write,
|
||||||
size_t *bytes_written, size_t min_xfer,
|
size_t *bytes_written, size_t min_xfer,
|
||||||
k_timeout_t timeout)
|
k_timeout_t timeout)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(pipe, K_OBJ_PIPE));
|
Z_OOPS(K_SYSCALL_OBJ(pipe, K_OBJ_PIPE));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(bytes_written, sizeof(*bytes_written)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(bytes_written, sizeof(*bytes_written)));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ((void *)data, bytes_to_write));
|
Z_OOPS(K_SYSCALL_MEMORY_READ((void *)data, bytes_to_write));
|
||||||
|
|
||||||
return z_impl_k_pipe_put((struct k_pipe *)pipe, (void *)data,
|
return z_impl_k_pipe_put((struct k_pipe *)pipe, (void *)data,
|
||||||
bytes_to_write, bytes_written, min_xfer,
|
bytes_to_write, bytes_written, min_xfer,
|
||||||
|
@ -725,9 +725,9 @@ int z_impl_k_pipe_get(struct k_pipe *pipe, void *data, size_t bytes_to_read,
|
||||||
int z_vrfy_k_pipe_get(struct k_pipe *pipe, void *data, size_t bytes_to_read,
|
int z_vrfy_k_pipe_get(struct k_pipe *pipe, void *data, size_t bytes_to_read,
|
||||||
size_t *bytes_read, size_t min_xfer, k_timeout_t timeout)
|
size_t *bytes_read, size_t min_xfer, k_timeout_t timeout)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(pipe, K_OBJ_PIPE));
|
Z_OOPS(K_SYSCALL_OBJ(pipe, K_OBJ_PIPE));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(bytes_read, sizeof(*bytes_read)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(bytes_read, sizeof(*bytes_read)));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE((void *)data, bytes_to_read));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE((void *)data, bytes_to_read));
|
||||||
|
|
||||||
return z_impl_k_pipe_get((struct k_pipe *)pipe, (void *)data,
|
return z_impl_k_pipe_get((struct k_pipe *)pipe, (void *)data,
|
||||||
bytes_to_read, bytes_read, min_xfer,
|
bytes_to_read, bytes_read, min_xfer,
|
||||||
|
@ -766,7 +766,7 @@ out:
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
size_t z_vrfy_k_pipe_read_avail(struct k_pipe *pipe)
|
size_t z_vrfy_k_pipe_read_avail(struct k_pipe *pipe)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(pipe, K_OBJ_PIPE));
|
Z_OOPS(K_SYSCALL_OBJ(pipe, K_OBJ_PIPE));
|
||||||
|
|
||||||
return z_impl_k_pipe_read_avail(pipe);
|
return z_impl_k_pipe_read_avail(pipe);
|
||||||
}
|
}
|
||||||
|
@ -803,7 +803,7 @@ out:
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
size_t z_vrfy_k_pipe_write_avail(struct k_pipe *pipe)
|
size_t z_vrfy_k_pipe_write_avail(struct k_pipe *pipe)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(pipe, K_OBJ_PIPE));
|
Z_OOPS(K_SYSCALL_OBJ(pipe, K_OBJ_PIPE));
|
||||||
|
|
||||||
return z_impl_k_pipe_write_avail(pipe);
|
return z_impl_k_pipe_write_avail(pipe);
|
||||||
}
|
}
|
||||||
|
|
|
@ -382,7 +382,7 @@ static inline int z_vrfy_k_poll(struct k_poll_event *events,
|
||||||
}
|
}
|
||||||
|
|
||||||
key = k_spin_lock(&lock);
|
key = k_spin_lock(&lock);
|
||||||
if (Z_SYSCALL_MEMORY_WRITE(events, bounds)) {
|
if (K_SYSCALL_MEMORY_WRITE(events, bounds)) {
|
||||||
k_spin_unlock(&lock, key);
|
k_spin_unlock(&lock, key);
|
||||||
goto oops_free;
|
goto oops_free;
|
||||||
}
|
}
|
||||||
|
@ -402,20 +402,20 @@ static inline int z_vrfy_k_poll(struct k_poll_event *events,
|
||||||
case K_POLL_TYPE_IGNORE:
|
case K_POLL_TYPE_IGNORE:
|
||||||
break;
|
break;
|
||||||
case K_POLL_TYPE_SIGNAL:
|
case K_POLL_TYPE_SIGNAL:
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(e->signal, K_OBJ_POLL_SIGNAL));
|
Z_OOPS(K_SYSCALL_OBJ(e->signal, K_OBJ_POLL_SIGNAL));
|
||||||
break;
|
break;
|
||||||
case K_POLL_TYPE_SEM_AVAILABLE:
|
case K_POLL_TYPE_SEM_AVAILABLE:
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(e->sem, K_OBJ_SEM));
|
Z_OOPS(K_SYSCALL_OBJ(e->sem, K_OBJ_SEM));
|
||||||
break;
|
break;
|
||||||
case K_POLL_TYPE_DATA_AVAILABLE:
|
case K_POLL_TYPE_DATA_AVAILABLE:
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(e->queue, K_OBJ_QUEUE));
|
Z_OOPS(K_SYSCALL_OBJ(e->queue, K_OBJ_QUEUE));
|
||||||
break;
|
break;
|
||||||
case K_POLL_TYPE_MSGQ_DATA_AVAILABLE:
|
case K_POLL_TYPE_MSGQ_DATA_AVAILABLE:
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(e->msgq, K_OBJ_MSGQ));
|
Z_OOPS(K_SYSCALL_OBJ(e->msgq, K_OBJ_MSGQ));
|
||||||
break;
|
break;
|
||||||
#ifdef CONFIG_PIPES
|
#ifdef CONFIG_PIPES
|
||||||
case K_POLL_TYPE_PIPE_DATA_AVAILABLE:
|
case K_POLL_TYPE_PIPE_DATA_AVAILABLE:
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(e->pipe, K_OBJ_PIPE));
|
Z_OOPS(K_SYSCALL_OBJ(e->pipe, K_OBJ_PIPE));
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
|
@ -490,7 +490,7 @@ void z_impl_k_poll_signal_init(struct k_poll_signal *sig)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline void z_vrfy_k_poll_signal_init(struct k_poll_signal *sig)
|
static inline void z_vrfy_k_poll_signal_init(struct k_poll_signal *sig)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ_INIT(sig, K_OBJ_POLL_SIGNAL));
|
Z_OOPS(K_SYSCALL_OBJ_INIT(sig, K_OBJ_POLL_SIGNAL));
|
||||||
z_impl_k_poll_signal_init(sig);
|
z_impl_k_poll_signal_init(sig);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_poll_signal_init_mrsh.c>
|
#include <syscalls/k_poll_signal_init_mrsh.c>
|
||||||
|
@ -516,9 +516,9 @@ void z_impl_k_poll_signal_check(struct k_poll_signal *sig,
|
||||||
void z_vrfy_k_poll_signal_check(struct k_poll_signal *sig,
|
void z_vrfy_k_poll_signal_check(struct k_poll_signal *sig,
|
||||||
unsigned int *signaled, int *result)
|
unsigned int *signaled, int *result)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(sig, K_OBJ_POLL_SIGNAL));
|
Z_OOPS(K_SYSCALL_OBJ(sig, K_OBJ_POLL_SIGNAL));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(signaled, sizeof(unsigned int)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(signaled, sizeof(unsigned int)));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(result, sizeof(int)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(result, sizeof(int)));
|
||||||
z_impl_k_poll_signal_check(sig, signaled, result);
|
z_impl_k_poll_signal_check(sig, signaled, result);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_poll_signal_check_mrsh.c>
|
#include <syscalls/k_poll_signal_check_mrsh.c>
|
||||||
|
@ -553,14 +553,14 @@ int z_impl_k_poll_signal_raise(struct k_poll_signal *sig, int result)
|
||||||
static inline int z_vrfy_k_poll_signal_raise(struct k_poll_signal *sig,
|
static inline int z_vrfy_k_poll_signal_raise(struct k_poll_signal *sig,
|
||||||
int result)
|
int result)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(sig, K_OBJ_POLL_SIGNAL));
|
Z_OOPS(K_SYSCALL_OBJ(sig, K_OBJ_POLL_SIGNAL));
|
||||||
return z_impl_k_poll_signal_raise(sig, result);
|
return z_impl_k_poll_signal_raise(sig, result);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_poll_signal_raise_mrsh.c>
|
#include <syscalls/k_poll_signal_raise_mrsh.c>
|
||||||
|
|
||||||
static inline void z_vrfy_k_poll_signal_reset(struct k_poll_signal *sig)
|
static inline void z_vrfy_k_poll_signal_reset(struct k_poll_signal *sig)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(sig, K_OBJ_POLL_SIGNAL));
|
Z_OOPS(K_SYSCALL_OBJ(sig, K_OBJ_POLL_SIGNAL));
|
||||||
z_impl_k_poll_signal_reset(sig);
|
z_impl_k_poll_signal_reset(sig);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_poll_signal_reset_mrsh.c>
|
#include <syscalls/k_poll_signal_reset_mrsh.c>
|
||||||
|
|
|
@ -72,7 +72,7 @@ void z_impl_k_queue_init(struct k_queue *queue)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline void z_vrfy_k_queue_init(struct k_queue *queue)
|
static inline void z_vrfy_k_queue_init(struct k_queue *queue)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ_NEVER_INIT(queue, K_OBJ_QUEUE));
|
Z_OOPS(K_SYSCALL_OBJ_NEVER_INIT(queue, K_OBJ_QUEUE));
|
||||||
z_impl_k_queue_init(queue);
|
z_impl_k_queue_init(queue);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_queue_init_mrsh.c>
|
#include <syscalls/k_queue_init_mrsh.c>
|
||||||
|
@ -114,7 +114,7 @@ void z_impl_k_queue_cancel_wait(struct k_queue *queue)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline void z_vrfy_k_queue_cancel_wait(struct k_queue *queue)
|
static inline void z_vrfy_k_queue_cancel_wait(struct k_queue *queue)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(queue, K_OBJ_QUEUE));
|
Z_OOPS(K_SYSCALL_OBJ(queue, K_OBJ_QUEUE));
|
||||||
z_impl_k_queue_cancel_wait(queue);
|
z_impl_k_queue_cancel_wait(queue);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_queue_cancel_wait_mrsh.c>
|
#include <syscalls/k_queue_cancel_wait_mrsh.c>
|
||||||
|
@ -217,7 +217,7 @@ int32_t z_impl_k_queue_alloc_append(struct k_queue *queue, void *data)
|
||||||
static inline int32_t z_vrfy_k_queue_alloc_append(struct k_queue *queue,
|
static inline int32_t z_vrfy_k_queue_alloc_append(struct k_queue *queue,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(queue, K_OBJ_QUEUE));
|
Z_OOPS(K_SYSCALL_OBJ(queue, K_OBJ_QUEUE));
|
||||||
return z_impl_k_queue_alloc_append(queue, data);
|
return z_impl_k_queue_alloc_append(queue, data);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_queue_alloc_append_mrsh.c>
|
#include <syscalls/k_queue_alloc_append_mrsh.c>
|
||||||
|
@ -238,7 +238,7 @@ int32_t z_impl_k_queue_alloc_prepend(struct k_queue *queue, void *data)
|
||||||
static inline int32_t z_vrfy_k_queue_alloc_prepend(struct k_queue *queue,
|
static inline int32_t z_vrfy_k_queue_alloc_prepend(struct k_queue *queue,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(queue, K_OBJ_QUEUE));
|
Z_OOPS(K_SYSCALL_OBJ(queue, K_OBJ_QUEUE));
|
||||||
return z_impl_k_queue_alloc_prepend(queue, data);
|
return z_impl_k_queue_alloc_prepend(queue, data);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_queue_alloc_prepend_mrsh.c>
|
#include <syscalls/k_queue_alloc_prepend_mrsh.c>
|
||||||
|
@ -405,28 +405,28 @@ void *z_impl_k_queue_peek_tail(struct k_queue *queue)
|
||||||
static inline void *z_vrfy_k_queue_get(struct k_queue *queue,
|
static inline void *z_vrfy_k_queue_get(struct k_queue *queue,
|
||||||
k_timeout_t timeout)
|
k_timeout_t timeout)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(queue, K_OBJ_QUEUE));
|
Z_OOPS(K_SYSCALL_OBJ(queue, K_OBJ_QUEUE));
|
||||||
return z_impl_k_queue_get(queue, timeout);
|
return z_impl_k_queue_get(queue, timeout);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_queue_get_mrsh.c>
|
#include <syscalls/k_queue_get_mrsh.c>
|
||||||
|
|
||||||
static inline int z_vrfy_k_queue_is_empty(struct k_queue *queue)
|
static inline int z_vrfy_k_queue_is_empty(struct k_queue *queue)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(queue, K_OBJ_QUEUE));
|
Z_OOPS(K_SYSCALL_OBJ(queue, K_OBJ_QUEUE));
|
||||||
return z_impl_k_queue_is_empty(queue);
|
return z_impl_k_queue_is_empty(queue);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_queue_is_empty_mrsh.c>
|
#include <syscalls/k_queue_is_empty_mrsh.c>
|
||||||
|
|
||||||
static inline void *z_vrfy_k_queue_peek_head(struct k_queue *queue)
|
static inline void *z_vrfy_k_queue_peek_head(struct k_queue *queue)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(queue, K_OBJ_QUEUE));
|
Z_OOPS(K_SYSCALL_OBJ(queue, K_OBJ_QUEUE));
|
||||||
return z_impl_k_queue_peek_head(queue);
|
return z_impl_k_queue_peek_head(queue);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_queue_peek_head_mrsh.c>
|
#include <syscalls/k_queue_peek_head_mrsh.c>
|
||||||
|
|
||||||
static inline void *z_vrfy_k_queue_peek_tail(struct k_queue *queue)
|
static inline void *z_vrfy_k_queue_peek_tail(struct k_queue *queue)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(queue, K_OBJ_QUEUE));
|
Z_OOPS(K_SYSCALL_OBJ(queue, K_OBJ_QUEUE));
|
||||||
return z_impl_k_queue_peek_tail(queue);
|
return z_impl_k_queue_peek_tail(queue);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_queue_peek_tail_mrsh.c>
|
#include <syscalls/k_queue_peek_tail_mrsh.c>
|
||||||
|
|
|
@ -689,7 +689,7 @@ void z_impl_k_thread_suspend(struct k_thread *thread)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline void z_vrfy_k_thread_suspend(struct k_thread *thread)
|
static inline void z_vrfy_k_thread_suspend(struct k_thread *thread)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
Z_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
||||||
z_impl_k_thread_suspend(thread);
|
z_impl_k_thread_suspend(thread);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_thread_suspend_mrsh.c>
|
#include <syscalls/k_thread_suspend_mrsh.c>
|
||||||
|
@ -718,7 +718,7 @@ void z_impl_k_thread_resume(struct k_thread *thread)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline void z_vrfy_k_thread_resume(struct k_thread *thread)
|
static inline void z_vrfy_k_thread_resume(struct k_thread *thread)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
Z_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
||||||
z_impl_k_thread_resume(thread);
|
z_impl_k_thread_resume(thread);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_thread_resume_mrsh.c>
|
#include <syscalls/k_thread_resume_mrsh.c>
|
||||||
|
@ -1335,7 +1335,7 @@ int z_impl_k_thread_priority_get(k_tid_t thread)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline int z_vrfy_k_thread_priority_get(k_tid_t thread)
|
static inline int z_vrfy_k_thread_priority_get(k_tid_t thread)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
Z_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
||||||
return z_impl_k_thread_priority_get(thread);
|
return z_impl_k_thread_priority_get(thread);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_thread_priority_get_mrsh.c>
|
#include <syscalls/k_thread_priority_get_mrsh.c>
|
||||||
|
@ -1358,7 +1358,7 @@ void z_impl_k_thread_priority_set(k_tid_t thread, int prio)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline void z_vrfy_k_thread_priority_set(k_tid_t thread, int prio)
|
static inline void z_vrfy_k_thread_priority_set(k_tid_t thread, int prio)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
Z_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(_is_valid_prio(prio, NULL),
|
Z_OOPS(K_SYSCALL_VERIFY_MSG(_is_valid_prio(prio, NULL),
|
||||||
"invalid thread priority %d", prio));
|
"invalid thread priority %d", prio));
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG((int8_t)prio >= thread->base.prio,
|
Z_OOPS(K_SYSCALL_VERIFY_MSG((int8_t)prio >= thread->base.prio,
|
||||||
|
@ -1389,7 +1389,7 @@ static inline void z_vrfy_k_thread_deadline_set(k_tid_t tid, int deadline)
|
||||||
{
|
{
|
||||||
struct k_thread *thread = tid;
|
struct k_thread *thread = tid;
|
||||||
|
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
Z_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(deadline > 0,
|
Z_OOPS(K_SYSCALL_VERIFY_MSG(deadline > 0,
|
||||||
"invalid thread deadline %d",
|
"invalid thread deadline %d",
|
||||||
(int)deadline));
|
(int)deadline));
|
||||||
|
@ -1583,7 +1583,7 @@ void z_sched_ipi(void)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline void z_vrfy_k_wakeup(k_tid_t thread)
|
static inline void z_vrfy_k_wakeup(k_tid_t thread)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
Z_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
||||||
z_impl_k_wakeup(thread);
|
z_impl_k_wakeup(thread);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_wakeup_mrsh.c>
|
#include <syscalls/k_wakeup_mrsh.c>
|
||||||
|
|
10
kernel/sem.c
10
kernel/sem.c
|
@ -76,7 +76,7 @@ int z_impl_k_sem_init(struct k_sem *sem, unsigned int initial_count,
|
||||||
int z_vrfy_k_sem_init(struct k_sem *sem, unsigned int initial_count,
|
int z_vrfy_k_sem_init(struct k_sem *sem, unsigned int initial_count,
|
||||||
unsigned int limit)
|
unsigned int limit)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ_INIT(sem, K_OBJ_SEM));
|
Z_OOPS(K_SYSCALL_OBJ_INIT(sem, K_OBJ_SEM));
|
||||||
return z_impl_k_sem_init(sem, initial_count, limit);
|
return z_impl_k_sem_init(sem, initial_count, limit);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_sem_init_mrsh.c>
|
#include <syscalls/k_sem_init_mrsh.c>
|
||||||
|
@ -123,7 +123,7 @@ void z_impl_k_sem_give(struct k_sem *sem)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline void z_vrfy_k_sem_give(struct k_sem *sem)
|
static inline void z_vrfy_k_sem_give(struct k_sem *sem)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(sem, K_OBJ_SEM));
|
Z_OOPS(K_SYSCALL_OBJ(sem, K_OBJ_SEM));
|
||||||
z_impl_k_sem_give(sem);
|
z_impl_k_sem_give(sem);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_sem_give_mrsh.c>
|
#include <syscalls/k_sem_give_mrsh.c>
|
||||||
|
@ -188,21 +188,21 @@ void z_impl_k_sem_reset(struct k_sem *sem)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline int z_vrfy_k_sem_take(struct k_sem *sem, k_timeout_t timeout)
|
static inline int z_vrfy_k_sem_take(struct k_sem *sem, k_timeout_t timeout)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(sem, K_OBJ_SEM));
|
Z_OOPS(K_SYSCALL_OBJ(sem, K_OBJ_SEM));
|
||||||
return z_impl_k_sem_take((struct k_sem *)sem, timeout);
|
return z_impl_k_sem_take((struct k_sem *)sem, timeout);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_sem_take_mrsh.c>
|
#include <syscalls/k_sem_take_mrsh.c>
|
||||||
|
|
||||||
static inline void z_vrfy_k_sem_reset(struct k_sem *sem)
|
static inline void z_vrfy_k_sem_reset(struct k_sem *sem)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(sem, K_OBJ_SEM));
|
Z_OOPS(K_SYSCALL_OBJ(sem, K_OBJ_SEM));
|
||||||
z_impl_k_sem_reset(sem);
|
z_impl_k_sem_reset(sem);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_sem_reset_mrsh.c>
|
#include <syscalls/k_sem_reset_mrsh.c>
|
||||||
|
|
||||||
static inline unsigned int z_vrfy_k_sem_count_get(struct k_sem *sem)
|
static inline unsigned int z_vrfy_k_sem_count_get(struct k_sem *sem)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(sem, K_OBJ_SEM));
|
Z_OOPS(K_SYSCALL_OBJ(sem, K_OBJ_SEM));
|
||||||
return z_impl_k_sem_count_get(sem);
|
return z_impl_k_sem_count_get(sem);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_sem_count_get_mrsh.c>
|
#include <syscalls/k_sem_count_get_mrsh.c>
|
||||||
|
|
|
@ -64,7 +64,7 @@ int32_t z_impl_k_stack_alloc_init(struct k_stack *stack, uint32_t num_entries)
|
||||||
static inline int32_t z_vrfy_k_stack_alloc_init(struct k_stack *stack,
|
static inline int32_t z_vrfy_k_stack_alloc_init(struct k_stack *stack,
|
||||||
uint32_t num_entries)
|
uint32_t num_entries)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ_NEVER_INIT(stack, K_OBJ_STACK));
|
Z_OOPS(K_SYSCALL_OBJ_NEVER_INIT(stack, K_OBJ_STACK));
|
||||||
Z_OOPS(Z_SYSCALL_VERIFY(num_entries > 0));
|
Z_OOPS(Z_SYSCALL_VERIFY(num_entries > 0));
|
||||||
return z_impl_k_stack_alloc_init(stack, num_entries);
|
return z_impl_k_stack_alloc_init(stack, num_entries);
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ end:
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline int z_vrfy_k_stack_push(struct k_stack *stack, stack_data_t data)
|
static inline int z_vrfy_k_stack_push(struct k_stack *stack, stack_data_t data)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(stack, K_OBJ_STACK));
|
Z_OOPS(K_SYSCALL_OBJ(stack, K_OBJ_STACK));
|
||||||
|
|
||||||
return z_impl_k_stack_push(stack, data);
|
return z_impl_k_stack_push(stack, data);
|
||||||
}
|
}
|
||||||
|
@ -187,8 +187,8 @@ int z_impl_k_stack_pop(struct k_stack *stack, stack_data_t *data,
|
||||||
static inline int z_vrfy_k_stack_pop(struct k_stack *stack,
|
static inline int z_vrfy_k_stack_pop(struct k_stack *stack,
|
||||||
stack_data_t *data, k_timeout_t timeout)
|
stack_data_t *data, k_timeout_t timeout)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(stack, K_OBJ_STACK));
|
Z_OOPS(K_SYSCALL_OBJ(stack, K_OBJ_STACK));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(data, sizeof(stack_data_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(data, sizeof(stack_data_t)));
|
||||||
return z_impl_k_stack_pop(stack, data, timeout);
|
return z_impl_k_stack_pop(stack, data, timeout);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_stack_pop_mrsh.c>
|
#include <syscalls/k_stack_pop_mrsh.c>
|
||||||
|
|
|
@ -257,7 +257,7 @@ static inline int z_vrfy_k_thread_name_set(struct k_thread *thread, const char *
|
||||||
char name[CONFIG_THREAD_MAX_NAME_LEN];
|
char name[CONFIG_THREAD_MAX_NAME_LEN];
|
||||||
|
|
||||||
if (thread != NULL) {
|
if (thread != NULL) {
|
||||||
if (Z_SYSCALL_OBJ(thread, K_OBJ_THREAD) != 0) {
|
if (K_SYSCALL_OBJ(thread, K_OBJ_THREAD) != 0) {
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -369,7 +369,7 @@ static inline int z_vrfy_k_thread_name_copy(k_tid_t thread,
|
||||||
(ko->flags & K_OBJ_FLAG_INITIALIZED) == 0) {
|
(ko->flags & K_OBJ_FLAG_INITIALIZED) == 0) {
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
if (Z_SYSCALL_MEMORY_WRITE(buf, size) != 0) {
|
if (K_SYSCALL_MEMORY_WRITE(buf, size) != 0) {
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
len = strlen(thread->name);
|
len = strlen(thread->name);
|
||||||
|
@ -433,7 +433,7 @@ void z_impl_k_thread_start(struct k_thread *thread)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline void z_vrfy_k_thread_start(struct k_thread *thread)
|
static inline void z_vrfy_k_thread_start(struct k_thread *thread)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
Z_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
||||||
return z_impl_k_thread_start(thread);
|
return z_impl_k_thread_start(thread);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_thread_start_mrsh.c>
|
#include <syscalls/k_thread_start_mrsh.c>
|
||||||
|
@ -728,7 +728,7 @@ k_tid_t z_vrfy_k_thread_create(struct k_thread *new_thread,
|
||||||
struct k_object *stack_object;
|
struct k_object *stack_object;
|
||||||
|
|
||||||
/* The thread and stack objects *must* be in an uninitialized state */
|
/* The thread and stack objects *must* be in an uninitialized state */
|
||||||
Z_OOPS(Z_SYSCALL_OBJ_NEVER_INIT(new_thread, K_OBJ_THREAD));
|
Z_OOPS(K_SYSCALL_OBJ_NEVER_INIT(new_thread, K_OBJ_THREAD));
|
||||||
|
|
||||||
/* No need to check z_stack_is_user_capable(), it won't be in the
|
/* No need to check z_stack_is_user_capable(), it won't be in the
|
||||||
* object table if it isn't
|
* object table if it isn't
|
||||||
|
@ -966,7 +966,7 @@ int z_impl_k_float_enable(struct k_thread *thread, unsigned int options)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline int z_vrfy_k_float_disable(struct k_thread *thread)
|
static inline int z_vrfy_k_float_disable(struct k_thread *thread)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
Z_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
||||||
return z_impl_k_float_disable(thread);
|
return z_impl_k_float_disable(thread);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_float_disable_mrsh.c>
|
#include <syscalls/k_float_disable_mrsh.c>
|
||||||
|
@ -1060,7 +1060,7 @@ int z_vrfy_k_thread_stack_space_get(const struct k_thread *thread,
|
||||||
size_t unused;
|
size_t unused;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = Z_SYSCALL_OBJ(thread, K_OBJ_THREAD);
|
ret = K_SYSCALL_OBJ(thread, K_OBJ_THREAD);
|
||||||
CHECKIF(ret != 0) {
|
CHECKIF(ret != 0) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1085,7 +1085,7 @@ int z_vrfy_k_thread_stack_space_get(const struct k_thread *thread,
|
||||||
static inline k_ticks_t z_vrfy_k_thread_timeout_remaining_ticks(
|
static inline k_ticks_t z_vrfy_k_thread_timeout_remaining_ticks(
|
||||||
const struct k_thread *t)
|
const struct k_thread *t)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(t, K_OBJ_THREAD));
|
Z_OOPS(K_SYSCALL_OBJ(t, K_OBJ_THREAD));
|
||||||
return z_impl_k_thread_timeout_remaining_ticks(t);
|
return z_impl_k_thread_timeout_remaining_ticks(t);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_thread_timeout_remaining_ticks_mrsh.c>
|
#include <syscalls/k_thread_timeout_remaining_ticks_mrsh.c>
|
||||||
|
@ -1093,7 +1093,7 @@ static inline k_ticks_t z_vrfy_k_thread_timeout_remaining_ticks(
|
||||||
static inline k_ticks_t z_vrfy_k_thread_timeout_expires_ticks(
|
static inline k_ticks_t z_vrfy_k_thread_timeout_expires_ticks(
|
||||||
const struct k_thread *t)
|
const struct k_thread *t)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(t, K_OBJ_THREAD));
|
Z_OOPS(K_SYSCALL_OBJ(t, K_OBJ_THREAD));
|
||||||
return z_impl_k_thread_timeout_expires_ticks(t);
|
return z_impl_k_thread_timeout_expires_ticks(t);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_thread_timeout_expires_ticks_mrsh.c>
|
#include <syscalls/k_thread_timeout_expires_ticks_mrsh.c>
|
||||||
|
|
|
@ -185,7 +185,7 @@ static inline void z_vrfy_k_timer_start(struct k_timer *timer,
|
||||||
k_timeout_t duration,
|
k_timeout_t duration,
|
||||||
k_timeout_t period)
|
k_timeout_t period)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
Z_OOPS(K_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
||||||
z_impl_k_timer_start(timer, duration, period);
|
z_impl_k_timer_start(timer, duration, period);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_timer_start_mrsh.c>
|
#include <syscalls/k_timer_start_mrsh.c>
|
||||||
|
@ -218,7 +218,7 @@ void z_impl_k_timer_stop(struct k_timer *timer)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline void z_vrfy_k_timer_stop(struct k_timer *timer)
|
static inline void z_vrfy_k_timer_stop(struct k_timer *timer)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
Z_OOPS(K_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
||||||
z_impl_k_timer_stop(timer);
|
z_impl_k_timer_stop(timer);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_timer_stop_mrsh.c>
|
#include <syscalls/k_timer_stop_mrsh.c>
|
||||||
|
@ -238,7 +238,7 @@ uint32_t z_impl_k_timer_status_get(struct k_timer *timer)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline uint32_t z_vrfy_k_timer_status_get(struct k_timer *timer)
|
static inline uint32_t z_vrfy_k_timer_status_get(struct k_timer *timer)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
Z_OOPS(K_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
||||||
return z_impl_k_timer_status_get(timer);
|
return z_impl_k_timer_status_get(timer);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_timer_status_get_mrsh.c>
|
#include <syscalls/k_timer_status_get_mrsh.c>
|
||||||
|
@ -306,7 +306,7 @@ uint32_t z_impl_k_timer_status_sync(struct k_timer *timer)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline uint32_t z_vrfy_k_timer_status_sync(struct k_timer *timer)
|
static inline uint32_t z_vrfy_k_timer_status_sync(struct k_timer *timer)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
Z_OOPS(K_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
||||||
return z_impl_k_timer_status_sync(timer);
|
return z_impl_k_timer_status_sync(timer);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_timer_status_sync_mrsh.c>
|
#include <syscalls/k_timer_status_sync_mrsh.c>
|
||||||
|
@ -314,7 +314,7 @@ static inline uint32_t z_vrfy_k_timer_status_sync(struct k_timer *timer)
|
||||||
static inline k_ticks_t z_vrfy_k_timer_remaining_ticks(
|
static inline k_ticks_t z_vrfy_k_timer_remaining_ticks(
|
||||||
const struct k_timer *timer)
|
const struct k_timer *timer)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
Z_OOPS(K_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
||||||
return z_impl_k_timer_remaining_ticks(timer);
|
return z_impl_k_timer_remaining_ticks(timer);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_timer_remaining_ticks_mrsh.c>
|
#include <syscalls/k_timer_remaining_ticks_mrsh.c>
|
||||||
|
@ -322,14 +322,14 @@ static inline k_ticks_t z_vrfy_k_timer_remaining_ticks(
|
||||||
static inline k_ticks_t z_vrfy_k_timer_expires_ticks(
|
static inline k_ticks_t z_vrfy_k_timer_expires_ticks(
|
||||||
const struct k_timer *timer)
|
const struct k_timer *timer)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
Z_OOPS(K_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
||||||
return z_impl_k_timer_expires_ticks(timer);
|
return z_impl_k_timer_expires_ticks(timer);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_timer_expires_ticks_mrsh.c>
|
#include <syscalls/k_timer_expires_ticks_mrsh.c>
|
||||||
|
|
||||||
static inline void *z_vrfy_k_timer_user_data_get(const struct k_timer *timer)
|
static inline void *z_vrfy_k_timer_user_data_get(const struct k_timer *timer)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
Z_OOPS(K_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
||||||
return z_impl_k_timer_user_data_get(timer);
|
return z_impl_k_timer_user_data_get(timer);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_timer_user_data_get_mrsh.c>
|
#include <syscalls/k_timer_user_data_get_mrsh.c>
|
||||||
|
@ -337,7 +337,7 @@ static inline void *z_vrfy_k_timer_user_data_get(const struct k_timer *timer)
|
||||||
static inline void z_vrfy_k_timer_user_data_set(struct k_timer *timer,
|
static inline void z_vrfy_k_timer_user_data_set(struct k_timer *timer,
|
||||||
void *user_data)
|
void *user_data)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
Z_OOPS(K_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
||||||
z_impl_k_timer_user_data_set(timer, user_data);
|
z_impl_k_timer_user_data_set(timer, user_data);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_timer_user_data_set_mrsh.c>
|
#include <syscalls/k_timer_user_data_set_mrsh.c>
|
||||||
|
|
|
@ -811,7 +811,7 @@ void *k_usermode_alloc_from_copy(const void *src, size_t size)
|
||||||
void *dst = NULL;
|
void *dst = NULL;
|
||||||
|
|
||||||
/* Does the caller in user mode have access to read this memory? */
|
/* Does the caller in user mode have access to read this memory? */
|
||||||
if (Z_SYSCALL_MEMORY_READ(src, size)) {
|
if (K_SYSCALL_MEMORY_READ(src, size)) {
|
||||||
goto out_err;
|
goto out_err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -831,8 +831,8 @@ static int user_copy(void *dst, const void *src, size_t size, bool to_user)
|
||||||
int ret = EFAULT;
|
int ret = EFAULT;
|
||||||
|
|
||||||
/* Does the caller in user mode have access to this memory? */
|
/* Does the caller in user mode have access to this memory? */
|
||||||
if (to_user ? Z_SYSCALL_MEMORY_WRITE(dst, size) :
|
if (to_user ? K_SYSCALL_MEMORY_WRITE(dst, size) :
|
||||||
Z_SYSCALL_MEMORY_READ(src, size)) {
|
K_SYSCALL_MEMORY_READ(src, size)) {
|
||||||
goto out_err;
|
goto out_err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ static inline void z_vrfy_k_object_access_grant(const void *object,
|
||||||
{
|
{
|
||||||
struct k_object *ko;
|
struct k_object *ko;
|
||||||
|
|
||||||
Z_OOPS(Z_SYSCALL_OBJ_INIT(thread, K_OBJ_THREAD));
|
Z_OOPS(K_SYSCALL_OBJ_INIT(thread, K_OBJ_THREAD));
|
||||||
ko = validate_any_object(object);
|
ko = validate_any_object(object);
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(ko != NULL, "object %p access denied",
|
Z_OOPS(K_SYSCALL_VERIFY_MSG(ko != NULL, "object %p access denied",
|
||||||
object));
|
object));
|
||||||
|
|
|
@ -56,7 +56,7 @@ int z_impl_zephyr_write_stdout(const void *buffer, int nbytes)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline int z_vrfy_zephyr_write_stdout(const void *buf, int nbytes)
|
static inline int z_vrfy_zephyr_write_stdout(const void *buf, int nbytes)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(buf, nbytes));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(buf, nbytes));
|
||||||
return z_impl_zephyr_write_stdout(buf, nbytes);
|
return z_impl_zephyr_write_stdout(buf, nbytes);
|
||||||
}
|
}
|
||||||
#include <syscalls/zephyr_write_stdout_mrsh.c>
|
#include <syscalls/zephyr_write_stdout_mrsh.c>
|
||||||
|
|
|
@ -181,7 +181,7 @@ int z_impl_zephyr_read_stdin(char *buf, int nbytes)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline int z_vrfy_zephyr_read_stdin(char *buf, int nbytes)
|
static inline int z_vrfy_zephyr_read_stdin(char *buf, int nbytes)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(buf, nbytes));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(buf, nbytes));
|
||||||
return z_impl_zephyr_read_stdin((char *)buf, nbytes);
|
return z_impl_zephyr_read_stdin((char *)buf, nbytes);
|
||||||
}
|
}
|
||||||
#include <syscalls/zephyr_read_stdin_mrsh.c>
|
#include <syscalls/zephyr_read_stdin_mrsh.c>
|
||||||
|
@ -204,7 +204,7 @@ int z_impl_zephyr_write_stdout(const void *buffer, int nbytes)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline int z_vrfy_zephyr_write_stdout(const void *buf, int nbytes)
|
static inline int z_vrfy_zephyr_write_stdout(const void *buf, int nbytes)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(buf, nbytes));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(buf, nbytes));
|
||||||
return z_impl_zephyr_write_stdout((const void *)buf, nbytes);
|
return z_impl_zephyr_write_stdout((const void *)buf, nbytes);
|
||||||
}
|
}
|
||||||
#include <syscalls/zephyr_write_stdout_mrsh.c>
|
#include <syscalls/zephyr_write_stdout_mrsh.c>
|
||||||
|
|
|
@ -27,7 +27,7 @@ static bool check_sys_mutex_addr(struct sys_mutex *addr)
|
||||||
* underlying k_mutex, but we don't want threads using mutexes
|
* underlying k_mutex, but we don't want threads using mutexes
|
||||||
* that are outside their memory domain
|
* that are outside their memory domain
|
||||||
*/
|
*/
|
||||||
return Z_SYSCALL_MEMORY_WRITE(addr, sizeof(struct sys_mutex));
|
return K_SYSCALL_MEMORY_WRITE(addr, sizeof(struct sys_mutex));
|
||||||
}
|
}
|
||||||
|
|
||||||
int z_impl_z_sys_mutex_kernel_lock(struct sys_mutex *mutex, k_timeout_t timeout)
|
int z_impl_z_sys_mutex_kernel_lock(struct sys_mutex *mutex, k_timeout_t timeout)
|
||||||
|
|
|
@ -174,7 +174,7 @@ void z_impl_k_str_out(char *c, size_t n)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline void z_vrfy_k_str_out(char *c, size_t n)
|
static inline void z_vrfy_k_str_out(char *c, size_t n)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(c, n));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(c, n));
|
||||||
z_impl_k_str_out((char *)c, n);
|
z_impl_k_str_out((char *)c, n);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_str_out_mrsh.c>
|
#include <syscalls/k_str_out_mrsh.c>
|
||||||
|
|
|
@ -68,7 +68,7 @@ int z_impl_clock_gettime(clockid_t clock_id, struct timespec *ts)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
int z_vrfy_clock_gettime(clockid_t clock_id, struct timespec *ts)
|
int z_vrfy_clock_gettime(clockid_t clock_id, struct timespec *ts)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(ts, sizeof(*ts)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(ts, sizeof(*ts)));
|
||||||
return z_impl_clock_gettime(clock_id, ts);
|
return z_impl_clock_gettime(clock_id, ts);
|
||||||
}
|
}
|
||||||
#include <syscalls/clock_gettime_mrsh.c>
|
#include <syscalls/clock_gettime_mrsh.c>
|
||||||
|
|
|
@ -25,7 +25,7 @@ int z_vrfy_sample_driver_write(const struct device *dev, void *buf)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Z_SYSCALL_MEMORY_READ(buf, SAMPLE_DRIVER_MSG_SIZE)) {
|
if (K_SYSCALL_MEMORY_READ(buf, SAMPLE_DRIVER_MSG_SIZE)) {
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -894,8 +894,8 @@ def write_validation_output(fp):
|
||||||
fp.write("#define DRIVER_VALIDATION_GEN_H\n")
|
fp.write("#define DRIVER_VALIDATION_GEN_H\n")
|
||||||
|
|
||||||
fp.write("""#define Z_SYSCALL_DRIVER_GEN(ptr, op, driver_lower_case, driver_upper_case) \\
|
fp.write("""#define Z_SYSCALL_DRIVER_GEN(ptr, op, driver_lower_case, driver_upper_case) \\
|
||||||
(Z_SYSCALL_OBJ(ptr, K_OBJ_DRIVER_##driver_upper_case) || \\
|
(K_SYSCALL_OBJ(ptr, K_OBJ_DRIVER_##driver_upper_case) || \\
|
||||||
Z_SYSCALL_DRIVER_OP(ptr, driver_lower_case##_driver_api, op))
|
K_SYSCALL_DRIVER_OP(ptr, driver_lower_case##_driver_api, op))
|
||||||
""")
|
""")
|
||||||
|
|
||||||
for subsystem in subsystems:
|
for subsystem in subsystems:
|
||||||
|
|
|
@ -322,7 +322,7 @@ def marshall_defs(func_name, func_type, args):
|
||||||
mrsh += "\t(void) arg%d;\t/* unused */\n" % unused_arg
|
mrsh += "\t(void) arg%d;\t/* unused */\n" % unused_arg
|
||||||
|
|
||||||
if nmrsh > 6:
|
if nmrsh > 6:
|
||||||
mrsh += ("\tZ_OOPS(Z_SYSCALL_MEMORY_READ(more, "
|
mrsh += ("\tZ_OOPS(K_SYSCALL_MEMORY_READ(more, "
|
||||||
+ str(nmrsh - 5) + " * sizeof(uintptr_t)));\n")
|
+ str(nmrsh - 5) + " * sizeof(uintptr_t)));\n")
|
||||||
|
|
||||||
argnum = 0
|
argnum = 0
|
||||||
|
@ -349,7 +349,7 @@ def marshall_defs(func_name, func_type, args):
|
||||||
|
|
||||||
if need_split(func_type):
|
if need_split(func_type):
|
||||||
ptr = "((uint64_t *)%s)" % mrsh_rval(nmrsh - 1, nmrsh)
|
ptr = "((uint64_t *)%s)" % mrsh_rval(nmrsh - 1, nmrsh)
|
||||||
mrsh += "\t" + "Z_OOPS(Z_SYSCALL_MEMORY_WRITE(%s, 8));\n" % ptr
|
mrsh += "\t" + "Z_OOPS(K_SYSCALL_MEMORY_WRITE(%s, 8));\n" % ptr
|
||||||
mrsh += "\t" + "*%s = ret;\n" % ptr
|
mrsh += "\t" + "*%s = ret;\n" % ptr
|
||||||
mrsh += "\t" + "_current->syscall_frame = NULL;\n"
|
mrsh += "\t" + "_current->syscall_frame = NULL;\n"
|
||||||
mrsh += "\t" + "return 0;\n"
|
mrsh += "\t" + "return 0;\n"
|
||||||
|
|
|
@ -304,7 +304,7 @@ char *z_vrfy_net_addr_ntop(sa_family_t family, const void *src,
|
||||||
char *out;
|
char *out;
|
||||||
const void *addr;
|
const void *addr;
|
||||||
|
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(dst, size));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(dst, size));
|
||||||
|
|
||||||
if (family == AF_INET) {
|
if (family == AF_INET) {
|
||||||
Z_OOPS(k_usermode_from_copy(&addr4, (const void *)src,
|
Z_OOPS(k_usermode_from_copy(&addr4, (const void *)src,
|
||||||
|
@ -488,7 +488,7 @@ int z_vrfy_net_addr_pton(sa_family_t family, const char *src,
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(dst, size));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(dst, size));
|
||||||
|
|
||||||
err = z_impl_net_addr_pton(family, str, addr);
|
err = z_impl_net_addr_pton(family, str, addr);
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
|
@ -341,7 +341,7 @@ int z_vrfy_zsock_socketpair(int family, int type, int proto, int *sv)
|
||||||
int ret;
|
int ret;
|
||||||
int tmp[2];
|
int tmp[2];
|
||||||
|
|
||||||
if (!sv || Z_SYSCALL_MEMORY_WRITE(sv, sizeof(tmp)) != 0) {
|
if (!sv || K_SYSCALL_MEMORY_WRITE(sv, sizeof(tmp)) != 0) {
|
||||||
/* not listed in normative spec, but mimics linux behaviour */
|
/* not listed in normative spec, but mimics linux behaviour */
|
||||||
errno = EFAULT;
|
errno = EFAULT;
|
||||||
ret = -1;
|
ret = -1;
|
||||||
|
|
|
@ -695,7 +695,7 @@ static inline int z_vrfy_zsock_accept(int sock, struct sockaddr *addr,
|
||||||
|
|
||||||
Z_OOPS(addrlen && k_usermode_from_copy(&addrlen_copy, addrlen,
|
Z_OOPS(addrlen && k_usermode_from_copy(&addrlen_copy, addrlen,
|
||||||
sizeof(socklen_t)));
|
sizeof(socklen_t)));
|
||||||
Z_OOPS(addr && Z_SYSCALL_MEMORY_WRITE(addr, addrlen ? addrlen_copy : 0));
|
Z_OOPS(addr && K_SYSCALL_MEMORY_WRITE(addr, addrlen ? addrlen_copy : 0));
|
||||||
|
|
||||||
ret = z_impl_zsock_accept(sock, (struct sockaddr *)addr,
|
ret = z_impl_zsock_accept(sock, (struct sockaddr *)addr,
|
||||||
addrlen ? &addrlen_copy : NULL);
|
addrlen ? &addrlen_copy : NULL);
|
||||||
|
@ -862,7 +862,7 @@ ssize_t z_vrfy_zsock_sendto(int sock, const void *buf, size_t len, int flags,
|
||||||
{
|
{
|
||||||
struct sockaddr_storage dest_addr_copy;
|
struct sockaddr_storage dest_addr_copy;
|
||||||
|
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(buf, len));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(buf, len));
|
||||||
if (dest_addr) {
|
if (dest_addr) {
|
||||||
Z_OOPS(Z_SYSCALL_VERIFY(addrlen <= sizeof(dest_addr_copy)));
|
Z_OOPS(Z_SYSCALL_VERIFY(addrlen <= sizeof(dest_addr_copy)));
|
||||||
Z_OOPS(k_usermode_from_copy(&dest_addr_copy, (void *)dest_addr,
|
Z_OOPS(k_usermode_from_copy(&dest_addr_copy, (void *)dest_addr,
|
||||||
|
@ -1514,7 +1514,7 @@ ssize_t z_vrfy_zsock_recvfrom(int sock, void *buf, size_t max_len, int flags,
|
||||||
socklen_t addrlen_copy;
|
socklen_t addrlen_copy;
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
|
|
||||||
if (Z_SYSCALL_MEMORY_WRITE(buf, max_len)) {
|
if (K_SYSCALL_MEMORY_WRITE(buf, max_len)) {
|
||||||
errno = EFAULT;
|
errno = EFAULT;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -1523,7 +1523,7 @@ ssize_t z_vrfy_zsock_recvfrom(int sock, void *buf, size_t max_len, int flags,
|
||||||
Z_OOPS(k_usermode_from_copy(&addrlen_copy, addrlen,
|
Z_OOPS(k_usermode_from_copy(&addrlen_copy, addrlen,
|
||||||
sizeof(socklen_t)));
|
sizeof(socklen_t)));
|
||||||
}
|
}
|
||||||
Z_OOPS(src_addr && Z_SYSCALL_MEMORY_WRITE(src_addr, addrlen_copy));
|
Z_OOPS(src_addr && K_SYSCALL_MEMORY_WRITE(src_addr, addrlen_copy));
|
||||||
|
|
||||||
ret = z_impl_zsock_recvfrom(sock, (void *)buf, max_len, flags,
|
ret = z_impl_zsock_recvfrom(sock, (void *)buf, max_len, flags,
|
||||||
(struct sockaddr *)src_addr,
|
(struct sockaddr *)src_addr,
|
||||||
|
@ -1609,7 +1609,7 @@ static inline int z_vrfy_zsock_ioctl(int sock, unsigned long request, va_list ar
|
||||||
int *avail;
|
int *avail;
|
||||||
|
|
||||||
avail = va_arg(args, int *);
|
avail = va_arg(args, int *);
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(avail, sizeof(*avail)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(avail, sizeof(*avail)));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2168,7 +2168,7 @@ int z_vrfy_zsock_getsockopt(int sock, int level, int optname,
|
||||||
void *kernel_optval;
|
void *kernel_optval;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (Z_SYSCALL_MEMORY_WRITE(optval, kernel_optlen)) {
|
if (K_SYSCALL_MEMORY_WRITE(optval, kernel_optlen)) {
|
||||||
errno = -EPERM;
|
errno = -EPERM;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -2594,7 +2594,7 @@ static inline int z_vrfy_zsock_getpeername(int sock, struct sockaddr *addr,
|
||||||
Z_OOPS(k_usermode_from_copy(&addrlen_copy, (void *)addrlen,
|
Z_OOPS(k_usermode_from_copy(&addrlen_copy, (void *)addrlen,
|
||||||
sizeof(socklen_t)));
|
sizeof(socklen_t)));
|
||||||
|
|
||||||
if (Z_SYSCALL_MEMORY_WRITE(addr, addrlen_copy)) {
|
if (K_SYSCALL_MEMORY_WRITE(addr, addrlen_copy)) {
|
||||||
errno = EFAULT;
|
errno = EFAULT;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -2673,7 +2673,7 @@ static inline int z_vrfy_zsock_getsockname(int sock, struct sockaddr *addr,
|
||||||
Z_OOPS(k_usermode_from_copy(&addrlen_copy, (void *)addrlen,
|
Z_OOPS(k_usermode_from_copy(&addrlen_copy, (void *)addrlen,
|
||||||
sizeof(socklen_t)));
|
sizeof(socklen_t)));
|
||||||
|
|
||||||
if (Z_SYSCALL_MEMORY_WRITE(addr, addrlen_copy)) {
|
if (K_SYSCALL_MEMORY_WRITE(addr, addrlen_copy)) {
|
||||||
errno = EFAULT;
|
errno = EFAULT;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ int z_impl_zsock_gethostname(char *buf, size_t len)
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline int z_vrfy_zsock_gethostname(char *buf, size_t len)
|
static inline int z_vrfy_zsock_gethostname(char *buf, size_t len)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(buf, len));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(buf, len));
|
||||||
return z_impl_zsock_gethostname(buf, len);
|
return z_impl_zsock_gethostname(buf, len);
|
||||||
}
|
}
|
||||||
#include <syscalls/zsock_gethostname_mrsh.c>
|
#include <syscalls/zsock_gethostname_mrsh.c>
|
||||||
|
|
|
@ -15,7 +15,7 @@ static inline uint32_t z_vrfy_sys_rand32_get(void)
|
||||||
|
|
||||||
static inline void z_vrfy_sys_rand_get(void *dst, size_t len)
|
static inline void z_vrfy_sys_rand_get(void *dst, size_t len)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(dst, len));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(dst, len));
|
||||||
|
|
||||||
z_impl_sys_rand_get(dst, len);
|
z_impl_sys_rand_get(dst, len);
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ static inline void z_vrfy_sys_rand_get(void *dst, size_t len)
|
||||||
#ifdef CONFIG_CSPRNG_ENABLED
|
#ifdef CONFIG_CSPRNG_ENABLED
|
||||||
static inline int z_vrfy_sys_csrand_get(void *dst, size_t len)
|
static inline int z_vrfy_sys_csrand_get(void *dst, size_t len)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(dst, len));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(dst, len));
|
||||||
|
|
||||||
return z_impl_sys_csrand_get(dst, len);
|
return z_impl_sys_csrand_get(dst, len);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
*/
|
*/
|
||||||
static inline bool rtio_vrfy_sqe(struct rtio_sqe *sqe)
|
static inline bool rtio_vrfy_sqe(struct rtio_sqe *sqe)
|
||||||
{
|
{
|
||||||
if (sqe->iodev != NULL && Z_SYSCALL_OBJ(sqe->iodev, K_OBJ_RTIO_IODEV)) {
|
if (sqe->iodev != NULL && K_SYSCALL_OBJ(sqe->iodev, K_OBJ_RTIO_IODEV)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,18 +29,18 @@ static inline bool rtio_vrfy_sqe(struct rtio_sqe *sqe)
|
||||||
case RTIO_OP_NOP:
|
case RTIO_OP_NOP:
|
||||||
break;
|
break;
|
||||||
case RTIO_OP_TX:
|
case RTIO_OP_TX:
|
||||||
valid_sqe &= Z_SYSCALL_MEMORY(sqe->buf, sqe->buf_len, false);
|
valid_sqe &= K_SYSCALL_MEMORY(sqe->buf, sqe->buf_len, false);
|
||||||
break;
|
break;
|
||||||
case RTIO_OP_RX:
|
case RTIO_OP_RX:
|
||||||
if ((sqe->flags & RTIO_SQE_MEMPOOL_BUFFER) == 0) {
|
if ((sqe->flags & RTIO_SQE_MEMPOOL_BUFFER) == 0) {
|
||||||
valid_sqe &= Z_SYSCALL_MEMORY(sqe->buf, sqe->buf_len, true);
|
valid_sqe &= K_SYSCALL_MEMORY(sqe->buf, sqe->buf_len, true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RTIO_OP_TINY_TX:
|
case RTIO_OP_TINY_TX:
|
||||||
break;
|
break;
|
||||||
case RTIO_OP_TXRX:
|
case RTIO_OP_TXRX:
|
||||||
valid_sqe &= Z_SYSCALL_MEMORY(sqe->tx_buf, sqe->txrx_buf_len, true);
|
valid_sqe &= K_SYSCALL_MEMORY(sqe->tx_buf, sqe->txrx_buf_len, true);
|
||||||
valid_sqe &= Z_SYSCALL_MEMORY(sqe->rx_buf, sqe->txrx_buf_len, true);
|
valid_sqe &= K_SYSCALL_MEMORY(sqe->rx_buf, sqe->txrx_buf_len, true);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* RTIO OP must be known and allowable from user mode
|
/* RTIO OP must be known and allowable from user mode
|
||||||
|
@ -54,7 +54,7 @@ static inline bool rtio_vrfy_sqe(struct rtio_sqe *sqe)
|
||||||
|
|
||||||
static inline void z_vrfy_rtio_release_buffer(struct rtio *r, void *buff, uint32_t buff_len)
|
static inline void z_vrfy_rtio_release_buffer(struct rtio *r, void *buff, uint32_t buff_len)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(r, K_OBJ_RTIO));
|
Z_OOPS(K_SYSCALL_OBJ(r, K_OBJ_RTIO));
|
||||||
z_impl_rtio_release_buffer(r, buff, buff_len);
|
z_impl_rtio_release_buffer(r, buff, buff_len);
|
||||||
}
|
}
|
||||||
#include <syscalls/rtio_release_buffer_mrsh.c>
|
#include <syscalls/rtio_release_buffer_mrsh.c>
|
||||||
|
@ -62,10 +62,10 @@ static inline void z_vrfy_rtio_release_buffer(struct rtio *r, void *buff, uint32
|
||||||
static inline int z_vrfy_rtio_cqe_get_mempool_buffer(const struct rtio *r, struct rtio_cqe *cqe,
|
static inline int z_vrfy_rtio_cqe_get_mempool_buffer(const struct rtio *r, struct rtio_cqe *cqe,
|
||||||
uint8_t **buff, uint32_t *buff_len)
|
uint8_t **buff, uint32_t *buff_len)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(r, K_OBJ_RTIO));
|
Z_OOPS(K_SYSCALL_OBJ(r, K_OBJ_RTIO));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(cqe, sizeof(struct rtio_cqe)));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(cqe, sizeof(struct rtio_cqe)));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(buff, sizeof(void *)));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(buff, sizeof(void *)));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_READ(buff_len, sizeof(uint32_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_READ(buff_len, sizeof(uint32_t)));
|
||||||
return z_impl_rtio_cqe_get_mempool_buffer(r, cqe, buff, buff_len);
|
return z_impl_rtio_cqe_get_mempool_buffer(r, cqe, buff, buff_len);
|
||||||
}
|
}
|
||||||
#include <syscalls/rtio_cqe_get_mempool_buffer_mrsh.c>
|
#include <syscalls/rtio_cqe_get_mempool_buffer_mrsh.c>
|
||||||
|
@ -79,7 +79,7 @@ static inline int z_vrfy_rtio_sqe_cancel(struct rtio_sqe *sqe)
|
||||||
static inline int z_vrfy_rtio_sqe_copy_in_get_handles(struct rtio *r, const struct rtio_sqe *sqes,
|
static inline int z_vrfy_rtio_sqe_copy_in_get_handles(struct rtio *r, const struct rtio_sqe *sqes,
|
||||||
struct rtio_sqe **handle, size_t sqe_count)
|
struct rtio_sqe **handle, size_t sqe_count)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(r, K_OBJ_RTIO));
|
Z_OOPS(K_SYSCALL_OBJ(r, K_OBJ_RTIO));
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(sqes, sqe_count, sizeof(struct rtio_sqe)));
|
Z_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(sqes, sqe_count, sizeof(struct rtio_sqe)));
|
||||||
struct rtio_sqe *sqe;
|
struct rtio_sqe *sqe;
|
||||||
|
@ -114,7 +114,7 @@ static inline int z_vrfy_rtio_cqe_copy_out(struct rtio *r,
|
||||||
size_t cqe_count,
|
size_t cqe_count,
|
||||||
k_timeout_t timeout)
|
k_timeout_t timeout)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(r, K_OBJ_RTIO));
|
Z_OOPS(K_SYSCALL_OBJ(r, K_OBJ_RTIO));
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_ARRAY_WRITE(cqes, cqe_count, sizeof(struct rtio_cqe)));
|
Z_OOPS(K_SYSCALL_MEMORY_ARRAY_WRITE(cqes, cqe_count, sizeof(struct rtio_cqe)));
|
||||||
|
|
||||||
|
@ -124,10 +124,10 @@ static inline int z_vrfy_rtio_cqe_copy_out(struct rtio *r,
|
||||||
|
|
||||||
static inline int z_vrfy_rtio_submit(struct rtio *r, uint32_t wait_count)
|
static inline int z_vrfy_rtio_submit(struct rtio *r, uint32_t wait_count)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(r, K_OBJ_RTIO));
|
Z_OOPS(K_SYSCALL_OBJ(r, K_OBJ_RTIO));
|
||||||
|
|
||||||
#ifdef CONFIG_RTIO_SUBMIT_SEM
|
#ifdef CONFIG_RTIO_SUBMIT_SEM
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(r->submit_sem, K_OBJ_SEM));
|
Z_OOPS(K_SYSCALL_OBJ(r->submit_sem, K_OBJ_SEM));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return z_impl_rtio_submit(r, wait_count);
|
return z_impl_rtio_submit(r, wait_count);
|
||||||
|
|
|
@ -41,9 +41,9 @@ int z_impl_validation_overhead_syscall(void)
|
||||||
|
|
||||||
static inline int z_vrfy_validation_overhead_syscall(void)
|
static inline int z_vrfy_validation_overhead_syscall(void)
|
||||||
{
|
{
|
||||||
bool status_0 = Z_SYSCALL_OBJ_INIT(&test_sema, K_OBJ_SEM);
|
bool status_0 = K_SYSCALL_OBJ_INIT(&test_sema, K_OBJ_SEM);
|
||||||
|
|
||||||
bool status_1 = Z_SYSCALL_OBJ(&test_sema, K_OBJ_SEM);
|
bool status_1 = K_SYSCALL_OBJ(&test_sema, K_OBJ_SEM);
|
||||||
|
|
||||||
return status_0 || status_1;
|
return status_0 || status_1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -492,7 +492,7 @@ ZTEST(mem_protect_kobj, test_kobject_access_grant_to_invalid_thread)
|
||||||
k_object_access_grant(&kobject_sem, &uninit_thread);
|
k_object_access_grant(&kobject_sem, &uninit_thread);
|
||||||
k_object_access_revoke(&kobject_sem, &uninit_thread);
|
k_object_access_revoke(&kobject_sem, &uninit_thread);
|
||||||
|
|
||||||
zassert_not_equal(Z_SYSCALL_OBJ(&uninit_thread, K_OBJ_THREAD), 0,
|
zassert_not_equal(K_SYSCALL_OBJ(&uninit_thread, K_OBJ_THREAD), 0,
|
||||||
"Access granted/revoked to invalid thread k_object");
|
"Access granted/revoked to invalid thread k_object");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ static inline size_t z_vrfy_string_nlen(char *src, size_t maxlen, int *err)
|
||||||
size_t ret;
|
size_t ret;
|
||||||
|
|
||||||
ret = z_impl_string_nlen((char *)src, maxlen, &err_copy);
|
ret = z_impl_string_nlen((char *)src, maxlen, &err_copy);
|
||||||
if (!err_copy && Z_SYSCALL_MEMORY_READ(src, ret + 1)) {
|
if (!err_copy && K_SYSCALL_MEMORY_READ(src, ret + 1)) {
|
||||||
err_copy = -1;
|
err_copy = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,8 +41,8 @@ void z_impl_stack_info_get(char **start_addr, size_t *size)
|
||||||
static inline void z_vrfy_stack_info_get(char **start_addr,
|
static inline void z_vrfy_stack_info_get(char **start_addr,
|
||||||
size_t *size)
|
size_t *size)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(start_addr, sizeof(uintptr_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(start_addr, sizeof(uintptr_t)));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(size, sizeof(size_t)));
|
Z_OOPS(K_SYSCALL_MEMORY_WRITE(size, sizeof(size_t)));
|
||||||
|
|
||||||
z_impl_stack_info_get(start_addr, size);
|
z_impl_stack_info_get(start_addr, size);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue