syscall: rename Z_OOPS -> K_OOPS
Rename internal API to not use z_/Z_. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
ee9f278323
commit
a08bfeb49c
|
@ -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(K_SYSCALL_SPECIFIC_DRIVER(dev, K_OBJ_DRIVER_GENERIC, &api));
|
K_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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -331,7 +331,7 @@ Several macros exist to validate arguments:
|
||||||
API structure.
|
API structure.
|
||||||
|
|
||||||
If any check fails, the macros will return a nonzero value. The macro
|
If any check fails, the macros will return a nonzero value. The macro
|
||||||
:c:macro:`Z_OOPS()` can be used to induce a kernel oops which will kill the
|
:c:macro:`K_OOPS()` can be used to induce a kernel oops which will kill the
|
||||||
calling thread. This is done instead of returning some error condition to
|
calling thread. This is done instead of returning some error condition to
|
||||||
keep the APIs the same when calling from supervisor mode.
|
keep the APIs the same when calling from supervisor mode.
|
||||||
|
|
||||||
|
@ -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(K_SYSCALL_OBJ(sem, K_OBJ_SEM));
|
K_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>
|
||||||
|
@ -397,7 +397,7 @@ for some integral value:
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = z_impl_some_syscall(&local_out_param);
|
ret = z_impl_some_syscall(&local_out_param);
|
||||||
Z_OOPS(k_usermode_to_copy(out_param, &local_out_param, sizeof(*out_param)));
|
K_OOPS(k_usermode_to_copy(out_param, &local_out_param, sizeof(*out_param)));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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(K_SYSCALL_MEMORY_WRITE(out_param, sizeof(*out_param)));
|
K_OOPS(K_SYSCALL_MEMORY_WRITE(out_param, sizeof(*out_param)));
|
||||||
return z_impl_some_syscall(out_param);
|
return z_impl_some_syscall(out_param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -433,9 +433,9 @@ bytes processed. This too should use a stack copy:
|
||||||
size_t size;
|
size_t size;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
Z_OOPS(k_usermode_from_copy(&size, size_ptr, sizeof(size));
|
K_OOPS(k_usermode_from_copy(&size, size_ptr, sizeof(size));
|
||||||
ret = z_impl_in_out_syscall(&size);
|
ret = z_impl_in_out_syscall(&size);
|
||||||
Z_OOPS(k_usermode_to_copy(size_ptr, &size, sizeof(size)));
|
K_OOPS(k_usermode_to_copy(size_ptr, &size, sizeof(size)));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -461,11 +461,11 @@ be copied. Typically this is done by allocating copies on the stack:
|
||||||
struct bar bar_right_copy;
|
struct bar bar_right_copy;
|
||||||
struct bar bar_left_copy;
|
struct bar bar_left_copy;
|
||||||
|
|
||||||
Z_OOPS(k_usermode_from_copy(&foo_copy, foo, sizeof(*foo)));
|
K_OOPS(k_usermode_from_copy(&foo_copy, foo, sizeof(*foo)));
|
||||||
Z_OOPS(k_usermode_from_copy(&bar_right_copy, foo_copy.bar_right,
|
K_OOPS(k_usermode_from_copy(&bar_right_copy, foo_copy.bar_right,
|
||||||
sizeof(struct bar)));
|
sizeof(struct bar)));
|
||||||
foo_copy.bar_right = &bar_right_copy;
|
foo_copy.bar_right = &bar_right_copy;
|
||||||
Z_OOPS(k_usermode_from_copy(&bar_left_copy, foo_copy.bar_left,
|
K_OOPS(k_usermode_from_copy(&bar_left_copy, foo_copy.bar_left,
|
||||||
sizeof(struct bar)));
|
sizeof(struct bar)));
|
||||||
foo_copy.bar_left = &bar_left_copy;
|
foo_copy.bar_left = &bar_left_copy;
|
||||||
|
|
||||||
|
@ -478,7 +478,7 @@ memory from the caller's resource pool via :c:func:`z_thread_malloc()`. This
|
||||||
should always be considered last resort. Functional safety programming
|
should always be considered last resort. Functional safety programming
|
||||||
guidelines heavily discourage usage of heap and the fact that a resource pool is
|
guidelines heavily discourage usage of heap and the fact that a resource pool is
|
||||||
used must be clearly documented. Any issues with allocation must be
|
used must be clearly documented. Any issues with allocation must be
|
||||||
reported, to a caller, with returning the ``-ENOMEM`` . The ``Z_OOPS()``
|
reported, to a caller, with returning the ``-ENOMEM`` . The ``K_OOPS()``
|
||||||
should never be used to verify if resource allocation has been successful.
|
should never be used to verify if resource allocation has been successful.
|
||||||
|
|
||||||
.. code-block:: c
|
.. code-block:: c
|
||||||
|
@ -500,7 +500,7 @@ should never be used to verify if resource allocation has been successful.
|
||||||
size_t bar_list_bytes;
|
size_t bar_list_bytes;
|
||||||
|
|
||||||
/* Safely copy foo into foo_copy */
|
/* Safely copy foo into foo_copy */
|
||||||
Z_OOPS(k_usermode_from_copy(&foo_copy, foo, sizeof(*foo)));
|
K_OOPS(k_usermode_from_copy(&foo_copy, foo, sizeof(*foo)));
|
||||||
|
|
||||||
/* Bounds check the count member, in the copy we made */
|
/* Bounds check the count member, in the copy we made */
|
||||||
if (foo_copy.count > 32) {
|
if (foo_copy.count > 32) {
|
||||||
|
@ -514,7 +514,7 @@ should never be used to verify if resource allocation has been successful.
|
||||||
if (bar_list_copy == NULL) {
|
if (bar_list_copy == NULL) {
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
Z_OOPS(k_usermode_from_copy(bar_list_copy, foo_copy.bar_list,
|
K_OOPS(k_usermode_from_copy(bar_list_copy, foo_copy.bar_list,
|
||||||
bar_list_bytes));
|
bar_list_bytes));
|
||||||
foo_copy.bar_list = bar_list_copy;
|
foo_copy.bar_list = bar_list_copy;
|
||||||
|
|
||||||
|
@ -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(K_SYSCALL_MEMORY_WRITE(buf, size));
|
K_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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -558,16 +558,16 @@ Verification Return Value Policies
|
||||||
|
|
||||||
When verifying system calls, it's important to note which kinds of verification
|
When verifying system calls, it's important to note which kinds of verification
|
||||||
failures should propagate a return value to the caller, and which should
|
failures should propagate a return value to the caller, and which should
|
||||||
simply invoke :c:macro:`Z_OOPS()` which kills the calling thread. The current
|
simply invoke :c:macro:`K_OOPS()` which kills the calling thread. The current
|
||||||
conventions are as follows:
|
conventions are as follows:
|
||||||
|
|
||||||
#. For system calls that are defined but not compiled, invocations of these
|
#. For system calls that are defined but not compiled, invocations of these
|
||||||
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:`K_OOPS()`.
|
||||||
|
|
||||||
#. Any invalid access to memory found by the set of ``K_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:`K_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.
|
||||||
|
|
||||||
|
@ -576,7 +576,7 @@ conventions are as follows:
|
||||||
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
|
||||||
invoke :c:macro:`Z_OOPS()`.
|
invoke :c:macro:`K_OOPS()`.
|
||||||
|
|
||||||
#. Any error resulting from a failed memory heap allocation, often from
|
#. Any error resulting from a failed memory heap allocation, often from
|
||||||
invoking :c:func:`z_thread_malloc()`, should propagate ``-ENOMEM`` to the
|
invoking :c:func:`z_thread_malloc()`, should propagate ``-ENOMEM`` to the
|
||||||
|
@ -594,7 +594,7 @@ conventions are as follows:
|
||||||
be registered from user mode. APIs which simply install callbacks shall not
|
be registered from user mode. APIs which simply install callbacks shall not
|
||||||
be exposed as system calls. Some driver subsystem APIs may take optional
|
be exposed as system calls. Some driver subsystem APIs may take optional
|
||||||
function callback pointers. User mode verification functions for these APIs
|
function callback pointers. User mode verification functions for these APIs
|
||||||
must enforce that these are NULL and should invoke :c:macro:`Z_OOPS()` if
|
must enforce that these are NULL and should invoke :c:macro:`K_OOPS()` if
|
||||||
not.
|
not.
|
||||||
|
|
||||||
#. Some parameter checks are enforced only from user mode. These should be
|
#. Some parameter checks are enforced only from user mode. These should be
|
||||||
|
@ -608,14 +608,14 @@ There are some known exceptions to these policies currently in Zephyr:
|
||||||
initialization bit pulls double-duty to indicate whether a thread is
|
initialization bit pulls double-duty to indicate whether a thread is
|
||||||
running, cleared upon exit. See #23030.
|
running, cleared upon exit. See #23030.
|
||||||
|
|
||||||
* :c:func:`k_thread_create()` invokes :c:macro:`Z_OOPS()` for parameter
|
* :c:func:`k_thread_create()` invokes :c:macro:`K_OOPS()` for parameter
|
||||||
checks, due to a great deal of existing code ignoring the return value.
|
checks, due to a great deal of existing code ignoring the return value.
|
||||||
This will also be addressed by #23030.
|
This will also be addressed by #23030.
|
||||||
|
|
||||||
* :c:func:`k_thread_abort()` invokes :c:macro:`Z_OOPS()` if an essential
|
* :c:func:`k_thread_abort()` invokes :c:macro:`K_OOPS()` if an essential
|
||||||
thread is aborted, as the function has no return value.
|
thread is aborted, as the function has no return value.
|
||||||
|
|
||||||
* Various system calls related to logging invoke :c:macro:`Z_OOPS()`
|
* Various system calls related to logging invoke :c:macro:`K_OOPS()`
|
||||||
when bad parameters are passed in as they do not propagate errors.
|
when bad parameters are passed in as they do not propagate errors.
|
||||||
|
|
||||||
Configuration Options
|
Configuration Options
|
||||||
|
@ -635,7 +635,7 @@ Helper macros for creating system call verification functions are provided in
|
||||||
* :c:macro:`K_SYSCALL_OBJ()`
|
* :c:macro:`K_SYSCALL_OBJ()`
|
||||||
* :c:macro:`K_SYSCALL_OBJ_INIT()`
|
* :c:macro:`K_SYSCALL_OBJ_INIT()`
|
||||||
* :c:macro:`K_SYSCALL_OBJ_NEVER_INIT()`
|
* :c:macro:`K_SYSCALL_OBJ_NEVER_INIT()`
|
||||||
* :c:macro:`Z_OOPS()`
|
* :c:macro:`K_OOPS()`
|
||||||
* :c:macro:`K_SYSCALL_MEMORY_READ()`
|
* :c:macro:`K_SYSCALL_MEMORY_READ()`
|
||||||
* :c:macro:`K_SYSCALL_MEMORY_WRITE()`
|
* :c:macro:`K_SYSCALL_MEMORY_WRITE()`
|
||||||
* :c:macro:`K_SYSCALL_MEMORY_ARRAY_READ()`
|
* :c:macro:`K_SYSCALL_MEMORY_ARRAY_READ()`
|
||||||
|
|
|
@ -13,8 +13,8 @@ static inline int z_vrfy_adc_channel_setup(const struct device *dev,
|
||||||
{
|
{
|
||||||
struct adc_channel_cfg channel_cfg;
|
struct adc_channel_cfg channel_cfg;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_ADC(dev, channel_setup));
|
K_OOPS(K_SYSCALL_DRIVER_ADC(dev, channel_setup));
|
||||||
Z_OOPS(k_usermode_from_copy(&channel_cfg,
|
K_OOPS(k_usermode_from_copy(&channel_cfg,
|
||||||
(struct adc_channel_cfg *)user_channel_cfg,
|
(struct adc_channel_cfg *)user_channel_cfg,
|
||||||
sizeof(struct adc_channel_cfg)));
|
sizeof(struct adc_channel_cfg)));
|
||||||
|
|
||||||
|
@ -55,12 +55,12 @@ static inline int z_vrfy_adc_read(const struct device *dev,
|
||||||
struct adc_sequence sequence;
|
struct adc_sequence sequence;
|
||||||
struct adc_sequence_options options;
|
struct adc_sequence_options options;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_ADC(dev, read));
|
K_OOPS(K_SYSCALL_DRIVER_ADC(dev, read));
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(copy_sequence(&sequence, &options,
|
K_OOPS(K_SYSCALL_VERIFY_MSG(copy_sequence(&sequence, &options,
|
||||||
(struct adc_sequence *)user_sequence),
|
(struct adc_sequence *)user_sequence),
|
||||||
"invalid ADC sequence"));
|
"invalid ADC sequence"));
|
||||||
if (sequence.options != NULL) {
|
if (sequence.options != NULL) {
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(sequence.options->callback == NULL,
|
K_OOPS(K_SYSCALL_VERIFY_MSG(sequence.options->callback == NULL,
|
||||||
"ADC sequence callbacks forbidden from user mode"));
|
"ADC sequence callbacks forbidden from user mode"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,15 +76,15 @@ static inline int z_vrfy_adc_read_async(const struct device *dev,
|
||||||
struct adc_sequence sequence;
|
struct adc_sequence sequence;
|
||||||
struct adc_sequence_options options;
|
struct adc_sequence_options options;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_ADC(dev, read_async));
|
K_OOPS(K_SYSCALL_DRIVER_ADC(dev, read_async));
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(copy_sequence(&sequence, &options,
|
K_OOPS(K_SYSCALL_VERIFY_MSG(copy_sequence(&sequence, &options,
|
||||||
(struct adc_sequence *)user_sequence),
|
(struct adc_sequence *)user_sequence),
|
||||||
"invalid ADC sequence"));
|
"invalid ADC sequence"));
|
||||||
if (sequence.options != NULL) {
|
if (sequence.options != NULL) {
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(sequence.options->callback == NULL,
|
K_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(K_SYSCALL_OBJ(async, K_OBJ_POLL_SIGNAL));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_AUXDISPLAY));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(size, sizeof(size_t)));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(data, size));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(data, size));
|
K_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(K_SYSCALL_MEMORY_WRITE(addr, size));
|
K_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(K_SYSCALL_MEMORY_WRITE(addr, size));
|
K_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(K_SYSCALL_MEMORY_WRITE(addr, size));
|
K_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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,11 +13,11 @@ static int z_vrfy_can_calc_timing(const struct device *dev, struct can_timing *r
|
||||||
struct can_timing res_copy;
|
struct can_timing res_copy;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_CAN(dev, get_core_clock));
|
K_OOPS(K_SYSCALL_DRIVER_CAN(dev, get_core_clock));
|
||||||
Z_OOPS(k_usermode_from_copy(&res_copy, res, sizeof(res_copy)));
|
K_OOPS(k_usermode_from_copy(&res_copy, res, sizeof(res_copy)));
|
||||||
|
|
||||||
err = z_impl_can_calc_timing(dev, &res_copy, bitrate, sample_pnt);
|
err = z_impl_can_calc_timing(dev, &res_copy, bitrate, sample_pnt);
|
||||||
Z_OOPS(k_usermode_to_copy(res, &res_copy, sizeof(*res)));
|
K_OOPS(k_usermode_to_copy(res, &res_copy, sizeof(*res)));
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
@ -28,8 +28,8 @@ static inline int z_vrfy_can_set_timing(const struct device *dev,
|
||||||
{
|
{
|
||||||
struct can_timing timing_copy;
|
struct can_timing timing_copy;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_CAN(dev, set_timing));
|
K_OOPS(K_SYSCALL_DRIVER_CAN(dev, set_timing));
|
||||||
Z_OOPS(k_usermode_from_copy(&timing_copy, timing, sizeof(timing_copy)));
|
K_OOPS(k_usermode_from_copy(&timing_copy, timing, sizeof(timing_copy)));
|
||||||
|
|
||||||
return z_impl_can_set_timing(dev, &timing_copy);
|
return z_impl_can_set_timing(dev, &timing_copy);
|
||||||
}
|
}
|
||||||
|
@ -38,8 +38,8 @@ static inline int z_vrfy_can_set_timing(const struct device *dev,
|
||||||
static inline int z_vrfy_can_get_core_clock(const struct device *dev,
|
static inline int z_vrfy_can_get_core_clock(const struct device *dev,
|
||||||
uint32_t *rate)
|
uint32_t *rate)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_CAN(dev, get_core_clock));
|
K_OOPS(K_SYSCALL_DRIVER_CAN(dev, get_core_clock));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(rate, sizeof(*rate)));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_CAN));
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_CAN));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(max_bitrate, sizeof(*max_bitrate)));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_CAN));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_CAN));
|
K_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);
|
||||||
}
|
}
|
||||||
|
@ -80,11 +80,11 @@ static int z_vrfy_can_calc_timing_data(const struct device *dev, struct can_timi
|
||||||
struct can_timing res_copy;
|
struct can_timing res_copy;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_CAN(dev, get_core_clock));
|
K_OOPS(K_SYSCALL_DRIVER_CAN(dev, get_core_clock));
|
||||||
Z_OOPS(k_usermode_from_copy(&res_copy, res, sizeof(res_copy)));
|
K_OOPS(k_usermode_from_copy(&res_copy, res, sizeof(res_copy)));
|
||||||
|
|
||||||
err = z_impl_can_calc_timing_data(dev, &res_copy, bitrate, sample_pnt);
|
err = z_impl_can_calc_timing_data(dev, &res_copy, bitrate, sample_pnt);
|
||||||
Z_OOPS(k_usermode_to_copy(res, &res_copy, sizeof(*res)));
|
K_OOPS(k_usermode_to_copy(res, &res_copy, sizeof(*res)));
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
@ -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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_CAN));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_CAN));
|
K_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);
|
||||||
}
|
}
|
||||||
|
@ -111,8 +111,8 @@ static inline int z_vrfy_can_set_timing_data(const struct device *dev,
|
||||||
{
|
{
|
||||||
struct can_timing timing_data_copy;
|
struct can_timing timing_data_copy;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_CAN(dev, set_timing_data));
|
K_OOPS(K_SYSCALL_DRIVER_CAN(dev, set_timing_data));
|
||||||
Z_OOPS(k_usermode_from_copy(&timing_data_copy, timing_data, sizeof(timing_data_copy)));
|
K_OOPS(k_usermode_from_copy(&timing_data_copy, timing_data, sizeof(timing_data_copy)));
|
||||||
|
|
||||||
return z_impl_can_set_timing_data(dev, &timing_data_copy);
|
return z_impl_can_set_timing_data(dev, &timing_data_copy);
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ static inline int z_vrfy_can_set_timing_data(const struct device *dev,
|
||||||
static inline int z_vrfy_can_set_bitrate_data(const struct device *dev,
|
static inline int z_vrfy_can_set_bitrate_data(const struct device *dev,
|
||||||
uint32_t bitrate_data)
|
uint32_t bitrate_data)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_CAN(dev, set_timing_data));
|
K_OOPS(K_SYSCALL_DRIVER_CAN(dev, set_timing_data));
|
||||||
|
|
||||||
return z_impl_can_set_bitrate_data(dev, bitrate_data);
|
return z_impl_can_set_bitrate_data(dev, bitrate_data);
|
||||||
}
|
}
|
||||||
|
@ -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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_CAN));
|
K_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);
|
||||||
}
|
}
|
||||||
|
@ -140,8 +140,8 @@ 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(K_SYSCALL_DRIVER_CAN(dev, get_capabilities));
|
K_OOPS(K_SYSCALL_DRIVER_CAN(dev, get_capabilities));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(cap, sizeof(*cap)));
|
K_OOPS(K_SYSCALL_MEMORY_WRITE(cap, sizeof(*cap)));
|
||||||
|
|
||||||
return z_impl_can_get_capabilities(dev, cap);
|
return z_impl_can_get_capabilities(dev, cap);
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,7 @@ static inline int z_vrfy_can_get_capabilities(const struct device *dev, can_mode
|
||||||
|
|
||||||
static inline int z_vrfy_can_start(const struct device *dev)
|
static inline int z_vrfy_can_start(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_CAN(dev, start));
|
K_OOPS(K_SYSCALL_DRIVER_CAN(dev, start));
|
||||||
|
|
||||||
return z_impl_can_start(dev);
|
return z_impl_can_start(dev);
|
||||||
}
|
}
|
||||||
|
@ -157,7 +157,7 @@ static inline int z_vrfy_can_start(const struct device *dev)
|
||||||
|
|
||||||
static inline int z_vrfy_can_stop(const struct device *dev)
|
static inline int z_vrfy_can_stop(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_CAN(dev, stop));
|
K_OOPS(K_SYSCALL_DRIVER_CAN(dev, stop));
|
||||||
|
|
||||||
return z_impl_can_stop(dev);
|
return z_impl_can_stop(dev);
|
||||||
}
|
}
|
||||||
|
@ -165,7 +165,7 @@ static inline int z_vrfy_can_stop(const struct device *dev)
|
||||||
|
|
||||||
static inline int z_vrfy_can_set_mode(const struct device *dev, can_mode_t mode)
|
static inline int z_vrfy_can_set_mode(const struct device *dev, can_mode_t mode)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_CAN(dev, set_mode));
|
K_OOPS(K_SYSCALL_DRIVER_CAN(dev, set_mode));
|
||||||
|
|
||||||
return z_impl_can_set_mode(dev, mode);
|
return z_impl_can_set_mode(dev, mode);
|
||||||
}
|
}
|
||||||
|
@ -173,7 +173,7 @@ static inline int z_vrfy_can_set_mode(const struct device *dev, can_mode_t mode)
|
||||||
|
|
||||||
static inline int z_vrfy_can_set_bitrate(const struct device *dev, uint32_t bitrate)
|
static inline int z_vrfy_can_set_bitrate(const struct device *dev, uint32_t bitrate)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_CAN(dev, set_timing));
|
K_OOPS(K_SYSCALL_DRIVER_CAN(dev, set_timing));
|
||||||
|
|
||||||
return z_impl_can_set_bitrate(dev, bitrate);
|
return z_impl_can_set_bitrate(dev, bitrate);
|
||||||
}
|
}
|
||||||
|
@ -187,9 +187,9 @@ static inline int z_vrfy_can_send(const struct device *dev,
|
||||||
{
|
{
|
||||||
struct can_frame frame_copy;
|
struct can_frame frame_copy;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_CAN(dev, send));
|
K_OOPS(K_SYSCALL_DRIVER_CAN(dev, send));
|
||||||
Z_OOPS(k_usermode_from_copy(&frame_copy, frame, sizeof(frame_copy)));
|
K_OOPS(k_usermode_from_copy(&frame_copy, frame, sizeof(frame_copy)));
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(callback == NULL, "callbacks may not be set from user mode"));
|
K_OOPS(K_SYSCALL_VERIFY_MSG(callback == NULL, "callbacks may not be set from user mode"));
|
||||||
|
|
||||||
return z_impl_can_send(dev, &frame_copy, timeout, callback, user_data);
|
return z_impl_can_send(dev, &frame_copy, timeout, callback, user_data);
|
||||||
}
|
}
|
||||||
|
@ -201,9 +201,9 @@ 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(K_SYSCALL_DRIVER_CAN(dev, add_rx_filter));
|
K_OOPS(K_SYSCALL_DRIVER_CAN(dev, add_rx_filter));
|
||||||
Z_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
K_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
||||||
Z_OOPS(k_usermode_from_copy(&filter_copy, filter, sizeof(filter_copy)));
|
K_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);
|
||||||
}
|
}
|
||||||
|
@ -211,7 +211,7 @@ static inline int z_vrfy_can_add_rx_filter_msgq(const struct device *dev,
|
||||||
|
|
||||||
static inline void z_vrfy_can_remove_rx_filter(const struct device *dev, int filter_id)
|
static inline void z_vrfy_can_remove_rx_filter(const struct device *dev, int filter_id)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_CAN(dev, remove_rx_filter));
|
K_OOPS(K_SYSCALL_DRIVER_CAN(dev, remove_rx_filter));
|
||||||
|
|
||||||
z_impl_can_remove_rx_filter(dev, filter_id);
|
z_impl_can_remove_rx_filter(dev, filter_id);
|
||||||
}
|
}
|
||||||
|
@ -220,14 +220,14 @@ static inline void z_vrfy_can_remove_rx_filter(const struct device *dev, int fil
|
||||||
static inline int z_vrfy_can_get_state(const struct device *dev, enum can_state *state,
|
static inline int z_vrfy_can_get_state(const struct device *dev, enum can_state *state,
|
||||||
struct can_bus_err_cnt *err_cnt)
|
struct can_bus_err_cnt *err_cnt)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_CAN(dev, get_state));
|
K_OOPS(K_SYSCALL_DRIVER_CAN(dev, get_state));
|
||||||
|
|
||||||
if (state != NULL) {
|
if (state != NULL) {
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(state, sizeof(*state)));
|
K_OOPS(K_SYSCALL_MEMORY_WRITE(state, sizeof(*state)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err_cnt != NULL) {
|
if (err_cnt != NULL) {
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(err_cnt, sizeof(*err_cnt)));
|
K_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);
|
||||||
|
@ -237,7 +237,7 @@ static inline int z_vrfy_can_get_state(const struct device *dev, enum can_state
|
||||||
#ifndef CONFIG_CAN_AUTO_BUS_OFF_RECOVERY
|
#ifndef CONFIG_CAN_AUTO_BUS_OFF_RECOVERY
|
||||||
static inline int z_vrfy_can_recover(const struct device *dev, k_timeout_t timeout)
|
static inline int z_vrfy_can_recover(const struct device *dev, k_timeout_t timeout)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_CAN(dev, recover));
|
K_OOPS(K_SYSCALL_DRIVER_CAN(dev, recover));
|
||||||
|
|
||||||
return z_impl_can_recover(dev, timeout);
|
return z_impl_can_recover(dev, timeout);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,11 +12,11 @@ static inline int z_vrfy_charger_get_prop(const struct device *dev, const charge
|
||||||
{
|
{
|
||||||
union charger_propval k_val;
|
union charger_propval k_val;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_CHARGER(dev, get_property));
|
K_OOPS(K_SYSCALL_DRIVER_CHARGER(dev, get_property));
|
||||||
|
|
||||||
int ret = z_impl_charger_get_prop(dev, prop, &k_val);
|
int ret = z_impl_charger_get_prop(dev, prop, &k_val);
|
||||||
|
|
||||||
Z_OOPS(k_usermode_to_copy(val, &k_val, sizeof(union charger_propval)));
|
K_OOPS(k_usermode_to_copy(val, &k_val, sizeof(union charger_propval)));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -28,9 +28,9 @@ static inline int z_vrfy_charger_set_prop(const struct device *dev, const charge
|
||||||
{
|
{
|
||||||
union charger_propval k_val;
|
union charger_propval k_val;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_CHARGER(dev, set_property));
|
K_OOPS(K_SYSCALL_DRIVER_CHARGER(dev, set_property));
|
||||||
|
|
||||||
Z_OOPS(k_usermode_from_copy(&k_val, val, sizeof(union charger_propval)));
|
K_OOPS(k_usermode_from_copy(&k_val, val, sizeof(union charger_propval)));
|
||||||
|
|
||||||
return z_impl_charger_set_prop(dev, prop, &k_val);
|
return z_impl_charger_set_prop(dev, prop, &k_val);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#define COUNTER_HANDLER(name) \
|
#define COUNTER_HANDLER(name) \
|
||||||
static inline int z_vrfy_counter_##name(const struct device *dev) \
|
static inline int z_vrfy_counter_##name(const struct device *dev) \
|
||||||
{ \
|
{ \
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_COUNTER(dev, name)); \
|
K_OOPS(K_SYSCALL_DRIVER_COUNTER(dev, name)); \
|
||||||
return z_impl_counter_ ## name((const struct device *)dev); \
|
return z_impl_counter_ ## name((const struct device *)dev); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_COUNTER));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_COUNTER));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_COUNTER));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_COUNTER));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_COUNTER));
|
K_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);
|
||||||
}
|
}
|
||||||
|
@ -67,16 +67,16 @@ static inline uint64_t z_vrfy_counter_ticks_to_us(const struct device *dev,
|
||||||
static inline int z_vrfy_counter_get_value(const struct device *dev,
|
static inline int z_vrfy_counter_get_value(const struct device *dev,
|
||||||
uint32_t *ticks)
|
uint32_t *ticks)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_COUNTER(dev, get_value));
|
K_OOPS(K_SYSCALL_DRIVER_COUNTER(dev, get_value));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(ticks, sizeof(*ticks)));
|
K_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);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int z_vrfy_counter_get_value_64(const struct device *dev,
|
static inline int z_vrfy_counter_get_value_64(const struct device *dev,
|
||||||
uint64_t *ticks)
|
uint64_t *ticks)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_COUNTER(dev, get_value_64));
|
K_OOPS(K_SYSCALL_DRIVER_COUNTER(dev, get_value_64));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(ticks, sizeof(*ticks)));
|
K_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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,9 +88,9 @@ static inline int z_vrfy_counter_set_channel_alarm(const struct device *dev,
|
||||||
{
|
{
|
||||||
struct counter_alarm_cfg cfg_copy;
|
struct counter_alarm_cfg cfg_copy;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_COUNTER(dev, set_alarm));
|
K_OOPS(K_SYSCALL_DRIVER_COUNTER(dev, set_alarm));
|
||||||
Z_OOPS(k_usermode_from_copy(&cfg_copy, alarm_cfg, sizeof(cfg_copy)));
|
K_OOPS(k_usermode_from_copy(&cfg_copy, alarm_cfg, sizeof(cfg_copy)));
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(cfg_copy.callback == NULL,
|
K_OOPS(K_SYSCALL_VERIFY_MSG(cfg_copy.callback == NULL,
|
||||||
"callbacks may not be set from user mode"));
|
"callbacks may not be set from user mode"));
|
||||||
return z_impl_counter_set_channel_alarm((const struct device *)dev,
|
return z_impl_counter_set_channel_alarm((const struct device *)dev,
|
||||||
(uint8_t)chan_id,
|
(uint8_t)chan_id,
|
||||||
|
@ -102,7 +102,7 @@ static inline int z_vrfy_counter_set_channel_alarm(const struct device *dev,
|
||||||
static inline int z_vrfy_counter_cancel_channel_alarm(const struct device *dev,
|
static inline int z_vrfy_counter_cancel_channel_alarm(const struct device *dev,
|
||||||
uint8_t chan_id)
|
uint8_t chan_id)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_COUNTER(dev, cancel_alarm));
|
K_OOPS(K_SYSCALL_DRIVER_COUNTER(dev, cancel_alarm));
|
||||||
return z_impl_counter_cancel_channel_alarm((const struct device *)dev,
|
return z_impl_counter_cancel_channel_alarm((const struct device *)dev,
|
||||||
(uint8_t)chan_id);
|
(uint8_t)chan_id);
|
||||||
}
|
}
|
||||||
|
@ -114,9 +114,9 @@ static inline int z_vrfy_counter_set_top_value(const struct device *dev,
|
||||||
{
|
{
|
||||||
struct counter_top_cfg cfg_copy;
|
struct counter_top_cfg cfg_copy;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_COUNTER(dev, set_top_value));
|
K_OOPS(K_SYSCALL_DRIVER_COUNTER(dev, set_top_value));
|
||||||
Z_OOPS(k_usermode_from_copy(&cfg_copy, cfg, sizeof(cfg_copy)));
|
K_OOPS(k_usermode_from_copy(&cfg_copy, cfg, sizeof(cfg_copy)));
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(cfg_copy.callback == NULL,
|
K_OOPS(K_SYSCALL_VERIFY_MSG(cfg_copy.callback == NULL,
|
||||||
"callbacks may not be set from user mode"));
|
"callbacks may not be set from user mode"));
|
||||||
return z_impl_counter_set_top_value((const struct device *)dev,
|
return z_impl_counter_set_top_value((const struct device *)dev,
|
||||||
(const struct counter_top_cfg *)
|
(const struct counter_top_cfg *)
|
||||||
|
@ -126,14 +126,14 @@ static inline int z_vrfy_counter_set_top_value(const struct device *dev,
|
||||||
|
|
||||||
static inline uint32_t z_vrfy_counter_get_top_value(const struct device *dev)
|
static inline uint32_t z_vrfy_counter_get_top_value(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_COUNTER(dev, get_top_value));
|
K_OOPS(K_SYSCALL_DRIVER_COUNTER(dev, get_top_value));
|
||||||
return z_impl_counter_get_top_value((const struct device *)dev);
|
return z_impl_counter_get_top_value((const struct device *)dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/counter_get_top_value_mrsh.c>
|
#include <syscalls/counter_get_top_value_mrsh.c>
|
||||||
|
|
||||||
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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_COUNTER));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_COUNTER));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_COUNTER));
|
K_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,13 +1308,13 @@ 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(K_SYSCALL_SPECIFIC_DRIVER(dev, K_OBJ_DRIVER_COUNTER, &ds3231_api));
|
K_OOPS(K_SYSCALL_SPECIFIC_DRIVER(dev, K_OBJ_DRIVER_COUNTER, &ds3231_api));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(syncpoint, sizeof(*syncpoint)));
|
K_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);
|
||||||
|
|
||||||
if (rv >= 0) {
|
if (rv >= 0) {
|
||||||
Z_OOPS(k_usermode_to_copy(syncpoint, &value, sizeof(*syncpoint)));
|
K_OOPS(k_usermode_to_copy(syncpoint, &value, sizeof(*syncpoint)));
|
||||||
}
|
}
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
|
@ -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(K_SYSCALL_SPECIFIC_DRIVER(dev, K_OBJ_DRIVER_COUNTER, &ds3231_api));
|
K_OOPS(K_SYSCALL_SPECIFIC_DRIVER(dev, K_OBJ_DRIVER_COUNTER, &ds3231_api));
|
||||||
if (sig != NULL) {
|
if (sig != NULL) {
|
||||||
Z_OOPS(K_SYSCALL_OBJ(sig, K_OBJ_POLL_SIGNAL));
|
K_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);
|
||||||
|
|
|
@ -13,8 +13,8 @@ static inline int z_vrfy_dac_channel_setup(const struct device *dev,
|
||||||
{
|
{
|
||||||
struct dac_channel_cfg channel_cfg;
|
struct dac_channel_cfg channel_cfg;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_DAC(dev, channel_setup));
|
K_OOPS(K_SYSCALL_DRIVER_DAC(dev, channel_setup));
|
||||||
Z_OOPS(k_usermode_from_copy(&channel_cfg,
|
K_OOPS(k_usermode_from_copy(&channel_cfg,
|
||||||
(struct dac_channel_cfg *)user_channel_cfg,
|
(struct dac_channel_cfg *)user_channel_cfg,
|
||||||
sizeof(struct dac_channel_cfg)));
|
sizeof(struct dac_channel_cfg)));
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ static inline int z_vrfy_dac_channel_setup(const struct device *dev,
|
||||||
static inline int z_vrfy_dac_write_value(const struct device *dev,
|
static inline int z_vrfy_dac_write_value(const struct device *dev,
|
||||||
uint8_t channel, uint32_t value)
|
uint8_t channel, uint32_t value)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_DAC(dev, write_value));
|
K_OOPS(K_SYSCALL_DRIVER_DAC(dev, write_value));
|
||||||
|
|
||||||
return z_impl_dac_write_value((const struct device *)dev, channel,
|
return z_impl_dac_write_value((const struct device *)dev, channel,
|
||||||
value);
|
value);
|
||||||
|
|
|
@ -13,14 +13,14 @@
|
||||||
|
|
||||||
static inline int z_vrfy_dma_start(const struct device *dev, uint32_t channel)
|
static inline int z_vrfy_dma_start(const struct device *dev, uint32_t channel)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_DMA(dev, start));
|
K_OOPS(K_SYSCALL_DRIVER_DMA(dev, start));
|
||||||
return z_impl_dma_start((const struct device *)dev, channel);
|
return z_impl_dma_start((const struct device *)dev, channel);
|
||||||
}
|
}
|
||||||
#include <syscalls/dma_start_mrsh.c>
|
#include <syscalls/dma_start_mrsh.c>
|
||||||
|
|
||||||
static inline int z_vrfy_dma_stop(const struct device *dev, uint32_t channel)
|
static inline int z_vrfy_dma_stop(const struct device *dev, uint32_t channel)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_DMA(dev, stop));
|
K_OOPS(K_SYSCALL_DRIVER_DMA(dev, stop));
|
||||||
return z_impl_dma_stop((const struct device *)dev, channel);
|
return z_impl_dma_stop((const struct device *)dev, channel);
|
||||||
}
|
}
|
||||||
#include <syscalls/dma_stop_mrsh.c>
|
#include <syscalls/dma_stop_mrsh.c>
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
static inline int z_vrfy_eeprom_read(const struct device *dev, off_t offset,
|
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(K_SYSCALL_DRIVER_EEPROM(dev, read));
|
K_OOPS(K_SYSCALL_DRIVER_EEPROM(dev, read));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(data, len));
|
K_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);
|
||||||
|
@ -21,8 +21,8 @@ static inline int z_vrfy_eeprom_read(const struct device *dev, off_t offset,
|
||||||
static inline int z_vrfy_eeprom_write(const struct device *dev, off_t offset,
|
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(K_SYSCALL_DRIVER_EEPROM(dev, write));
|
K_OOPS(K_SYSCALL_DRIVER_EEPROM(dev, write));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(data, len));
|
K_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);
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ static inline int z_vrfy_eeprom_write(const struct device *dev, off_t offset,
|
||||||
|
|
||||||
static inline size_t z_vrfy_eeprom_get_size(const struct device *dev)
|
static inline size_t z_vrfy_eeprom_get_size(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_EEPROM(dev, size));
|
K_OOPS(K_SYSCALL_DRIVER_EEPROM(dev, size));
|
||||||
return z_impl_eeprom_get_size((const struct device *)dev);
|
return z_impl_eeprom_get_size((const struct device *)dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/eeprom_get_size_mrsh.c>
|
#include <syscalls/eeprom_get_size_mrsh.c>
|
||||||
|
|
|
@ -11,8 +11,8 @@ static inline int z_vrfy_entropy_get_entropy(const struct device *dev,
|
||||||
uint8_t *buffer,
|
uint8_t *buffer,
|
||||||
uint16_t len)
|
uint16_t len)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_ENTROPY(dev, get_entropy));
|
K_OOPS(K_SYSCALL_DRIVER_ENTROPY(dev, get_entropy));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(buffer, len));
|
K_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);
|
||||||
|
|
|
@ -13,8 +13,8 @@ static inline int z_vrfy_espi_config(const struct device *dev,
|
||||||
{
|
{
|
||||||
struct espi_cfg cfg_copy;
|
struct espi_cfg cfg_copy;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_ESPI(dev, config));
|
K_OOPS(K_SYSCALL_DRIVER_ESPI(dev, config));
|
||||||
Z_OOPS(k_usermode_from_copy(&cfg_copy, cfg,
|
K_OOPS(k_usermode_from_copy(&cfg_copy, cfg,
|
||||||
sizeof(struct espi_cfg)));
|
sizeof(struct espi_cfg)));
|
||||||
|
|
||||||
return z_impl_espi_config(dev, &cfg_copy);
|
return z_impl_espi_config(dev, &cfg_copy);
|
||||||
|
@ -24,7 +24,7 @@ static inline int z_vrfy_espi_config(const struct device *dev,
|
||||||
static inline bool z_vrfy_espi_get_channel_status(const struct device *dev,
|
static inline bool z_vrfy_espi_get_channel_status(const struct device *dev,
|
||||||
enum espi_channel ch)
|
enum espi_channel ch)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_ESPI(dev, get_channel_status));
|
K_OOPS(K_SYSCALL_DRIVER_ESPI(dev, get_channel_status));
|
||||||
|
|
||||||
return z_impl_espi_get_channel_status(dev, ch);
|
return z_impl_espi_get_channel_status(dev, ch);
|
||||||
}
|
}
|
||||||
|
@ -37,10 +37,10 @@ static inline int z_vrfy_espi_read_lpc_request(const struct device *dev,
|
||||||
int ret;
|
int ret;
|
||||||
uint32_t data_copy;
|
uint32_t data_copy;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_ESPI(dev, read_lpc_request));
|
K_OOPS(K_SYSCALL_DRIVER_ESPI(dev, read_lpc_request));
|
||||||
|
|
||||||
ret = z_impl_espi_read_lpc_request(dev, op, &data_copy);
|
ret = z_impl_espi_read_lpc_request(dev, op, &data_copy);
|
||||||
Z_OOPS(k_usermode_to_copy(data, &data_copy, sizeof(uint8_t)));
|
K_OOPS(k_usermode_to_copy(data, &data_copy, sizeof(uint8_t)));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -52,8 +52,8 @@ static inline int z_vrfy_espi_write_lpc_request(const struct device *dev,
|
||||||
{
|
{
|
||||||
uint32_t data_copy;
|
uint32_t data_copy;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_ESPI(dev, write_lpc_request));
|
K_OOPS(K_SYSCALL_DRIVER_ESPI(dev, write_lpc_request));
|
||||||
Z_OOPS(k_usermode_from_copy(&data_copy, data, sizeof(*data)));
|
K_OOPS(k_usermode_from_copy(&data_copy, data, sizeof(*data)));
|
||||||
|
|
||||||
return z_impl_espi_write_lpc_request(dev, op, &data_copy);
|
return z_impl_espi_write_lpc_request(dev, op, &data_copy);
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ static inline int z_vrfy_espi_send_vwire(const struct device *dev,
|
||||||
enum espi_vwire_signal signal,
|
enum espi_vwire_signal signal,
|
||||||
uint8_t level)
|
uint8_t level)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_ESPI(dev, send_vwire));
|
K_OOPS(K_SYSCALL_DRIVER_ESPI(dev, send_vwire));
|
||||||
|
|
||||||
return z_impl_espi_send_vwire(dev, signal, level);
|
return z_impl_espi_send_vwire(dev, signal, level);
|
||||||
}
|
}
|
||||||
|
@ -76,10 +76,10 @@ static inline int z_vrfy_espi_receive_vwire(const struct device *dev,
|
||||||
int ret;
|
int ret;
|
||||||
uint8_t level_copy;
|
uint8_t level_copy;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_ESPI(dev, receive_vwire));
|
K_OOPS(K_SYSCALL_DRIVER_ESPI(dev, receive_vwire));
|
||||||
|
|
||||||
ret = z_impl_espi_receive_vwire(dev, signal, &level_copy);
|
ret = z_impl_espi_receive_vwire(dev, signal, &level_copy);
|
||||||
Z_OOPS(k_usermode_to_copy(level, &level_copy, sizeof(uint8_t)));
|
K_OOPS(k_usermode_to_copy(level, &level_copy, sizeof(uint8_t)));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -91,14 +91,14 @@ static inline int z_vrfy_espi_read_request(const struct device *dev,
|
||||||
int ret;
|
int ret;
|
||||||
struct espi_request_packet req_copy;
|
struct espi_request_packet req_copy;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_ESPI(dev, read_request));
|
K_OOPS(K_SYSCALL_DRIVER_ESPI(dev, read_request));
|
||||||
Z_OOPS(k_usermode_from_copy(&req_copy, req,
|
K_OOPS(k_usermode_from_copy(&req_copy, req,
|
||||||
sizeof(struct espi_request_packet)));
|
sizeof(struct espi_request_packet)));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(req_copy.data, req_copy.len));
|
K_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);
|
||||||
|
|
||||||
Z_OOPS(k_usermode_to_copy(req, &req_copy,
|
K_OOPS(k_usermode_to_copy(req, &req_copy,
|
||||||
sizeof(struct espi_request_packet)));
|
sizeof(struct espi_request_packet)));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -111,9 +111,9 @@ static inline int z_vrfy_espi_write_request(const struct device *dev,
|
||||||
int ret;
|
int ret;
|
||||||
struct espi_request_packet req_copy;
|
struct espi_request_packet req_copy;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_ESPI(dev, write_request));
|
K_OOPS(K_SYSCALL_DRIVER_ESPI(dev, write_request));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(req->data, req->len));
|
K_OOPS(K_SYSCALL_MEMORY_READ(req->data, req->len));
|
||||||
Z_OOPS(k_usermode_from_copy(&req_copy, req,
|
K_OOPS(k_usermode_from_copy(&req_copy, req,
|
||||||
sizeof(struct espi_request_packet)));
|
sizeof(struct espi_request_packet)));
|
||||||
|
|
||||||
ret = z_impl_espi_write_request(dev, &req_copy);
|
ret = z_impl_espi_write_request(dev, &req_copy);
|
||||||
|
@ -128,9 +128,9 @@ static inline int z_vrfy_espi_send_oob(const struct device *dev,
|
||||||
int ret;
|
int ret;
|
||||||
struct espi_oob_packet pckt_copy;
|
struct espi_oob_packet pckt_copy;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_ESPI(dev, send_oob));
|
K_OOPS(K_SYSCALL_DRIVER_ESPI(dev, send_oob));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(pckt->buf, pckt->len));
|
K_OOPS(K_SYSCALL_MEMORY_READ(pckt->buf, pckt->len));
|
||||||
Z_OOPS(k_usermode_from_copy(&pckt_copy, pckt,
|
K_OOPS(k_usermode_from_copy(&pckt_copy, pckt,
|
||||||
sizeof(struct espi_oob_packet)));
|
sizeof(struct espi_oob_packet)));
|
||||||
|
|
||||||
ret = z_impl_espi_send_oob(dev, &pckt_copy);
|
ret = z_impl_espi_send_oob(dev, &pckt_copy);
|
||||||
|
@ -145,13 +145,13 @@ static inline int z_vrfy_espi_receive_oob(const struct device *dev,
|
||||||
int ret;
|
int ret;
|
||||||
struct espi_oob_packet pckt_copy;
|
struct espi_oob_packet pckt_copy;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_ESPI(dev, receive_oob));
|
K_OOPS(K_SYSCALL_DRIVER_ESPI(dev, receive_oob));
|
||||||
Z_OOPS(k_usermode_from_copy(&pckt_copy, pckt,
|
K_OOPS(k_usermode_from_copy(&pckt_copy, pckt,
|
||||||
sizeof(struct espi_oob_packet)));
|
sizeof(struct espi_oob_packet)));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(pckt->buf, pckt->len));
|
K_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,
|
K_OOPS(k_usermode_to_copy(pckt, &pckt_copy,
|
||||||
sizeof(struct espi_oob_packet)));
|
sizeof(struct espi_oob_packet)));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -164,13 +164,13 @@ static inline int z_vrfy_espi_read_flash(const struct device *dev,
|
||||||
int ret;
|
int ret;
|
||||||
struct espi_flash_packet pckt_copy;
|
struct espi_flash_packet pckt_copy;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_ESPI(dev, flash_read));
|
K_OOPS(K_SYSCALL_DRIVER_ESPI(dev, flash_read));
|
||||||
Z_OOPS(k_usermode_from_copy(&pckt_copy, pckt,
|
K_OOPS(k_usermode_from_copy(&pckt_copy, pckt,
|
||||||
sizeof(struct espi_flash_packet)));
|
sizeof(struct espi_flash_packet)));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(pckt->buf, pckt->len));
|
K_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,
|
K_OOPS(k_usermode_to_copy(pckt, &pckt_copy,
|
||||||
sizeof(struct espi_flash_packet)));
|
sizeof(struct espi_flash_packet)));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -183,10 +183,10 @@ static inline int z_vrfy_espi_write_flash(const struct device *dev,
|
||||||
int ret;
|
int ret;
|
||||||
struct espi_flash_packet pckt_copy;
|
struct espi_flash_packet pckt_copy;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_ESPI(dev, flash_write));
|
K_OOPS(K_SYSCALL_DRIVER_ESPI(dev, flash_write));
|
||||||
Z_OOPS(k_usermode_from_copy(&pckt_copy, pckt,
|
K_OOPS(k_usermode_from_copy(&pckt_copy, pckt,
|
||||||
sizeof(struct espi_flash_packet)));
|
sizeof(struct espi_flash_packet)));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(pckt->buf, pckt->len));
|
K_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);
|
||||||
|
|
||||||
|
@ -200,10 +200,10 @@ static inline int z_vrfy_espi_flash_erase(const struct device *dev,
|
||||||
int ret;
|
int ret;
|
||||||
struct espi_flash_packet pckt_copy;
|
struct espi_flash_packet pckt_copy;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_ESPI(dev, flash_write));
|
K_OOPS(K_SYSCALL_DRIVER_ESPI(dev, flash_write));
|
||||||
Z_OOPS(k_usermode_from_copy(&pckt_copy, pckt,
|
K_OOPS(k_usermode_from_copy(&pckt_copy, pckt,
|
||||||
sizeof(struct espi_flash_packet)));
|
sizeof(struct espi_flash_packet)));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(pckt->buf, pckt->len));
|
K_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);
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
static inline int z_vrfy_flash_read(const struct device *dev, off_t offset,
|
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(K_SYSCALL_DRIVER_FLASH(dev, read));
|
K_OOPS(K_SYSCALL_DRIVER_FLASH(dev, read));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(data, len));
|
K_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);
|
||||||
|
@ -21,8 +21,8 @@ static inline int z_vrfy_flash_read(const struct device *dev, off_t offset,
|
||||||
static inline int z_vrfy_flash_write(const struct device *dev, off_t offset,
|
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(K_SYSCALL_DRIVER_FLASH(dev, write));
|
K_OOPS(K_SYSCALL_DRIVER_FLASH(dev, write));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(data, len));
|
K_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);
|
||||||
}
|
}
|
||||||
|
@ -31,21 +31,21 @@ static inline int z_vrfy_flash_write(const struct device *dev, off_t offset,
|
||||||
static inline int z_vrfy_flash_erase(const struct device *dev, off_t offset,
|
static inline int z_vrfy_flash_erase(const struct device *dev, off_t offset,
|
||||||
size_t size)
|
size_t size)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_FLASH(dev, erase));
|
K_OOPS(K_SYSCALL_DRIVER_FLASH(dev, erase));
|
||||||
return z_impl_flash_erase((const struct device *)dev, offset, size);
|
return z_impl_flash_erase((const struct device *)dev, offset, size);
|
||||||
}
|
}
|
||||||
#include <syscalls/flash_erase_mrsh.c>
|
#include <syscalls/flash_erase_mrsh.c>
|
||||||
|
|
||||||
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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_FLASH));
|
K_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>
|
||||||
|
|
||||||
static inline const struct flash_parameters *z_vrfy_flash_get_parameters(const struct device *dev)
|
static inline const struct flash_parameters *z_vrfy_flash_get_parameters(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_FLASH(dev, get_parameters));
|
K_OOPS(K_SYSCALL_DRIVER_FLASH(dev, get_parameters));
|
||||||
return z_impl_flash_get_parameters(dev);
|
return z_impl_flash_get_parameters(dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/flash_get_parameters_mrsh.c>
|
#include <syscalls/flash_get_parameters_mrsh.c>
|
||||||
|
@ -55,8 +55,8 @@ static inline int z_vrfy_flash_get_page_info_by_offs(const struct device *dev,
|
||||||
off_t offs,
|
off_t offs,
|
||||||
struct flash_pages_info *info)
|
struct flash_pages_info *info)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_FLASH(dev, page_layout));
|
K_OOPS(K_SYSCALL_DRIVER_FLASH(dev, page_layout));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(info, sizeof(struct flash_pages_info)));
|
K_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);
|
||||||
|
@ -67,8 +67,8 @@ static inline int z_vrfy_flash_get_page_info_by_idx(const struct device *dev,
|
||||||
uint32_t idx,
|
uint32_t idx,
|
||||||
struct flash_pages_info *info)
|
struct flash_pages_info *info)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_FLASH(dev, page_layout));
|
K_OOPS(K_SYSCALL_DRIVER_FLASH(dev, page_layout));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(info, sizeof(struct flash_pages_info)));
|
K_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);
|
||||||
|
@ -77,7 +77,7 @@ static inline int z_vrfy_flash_get_page_info_by_idx(const struct device *dev,
|
||||||
|
|
||||||
static inline size_t z_vrfy_flash_get_page_count(const struct device *dev)
|
static inline size_t z_vrfy_flash_get_page_count(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_FLASH(dev, page_layout));
|
K_OOPS(K_SYSCALL_DRIVER_FLASH(dev, page_layout));
|
||||||
return z_impl_flash_get_page_count((const struct device *)dev);
|
return z_impl_flash_get_page_count((const struct device *)dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/flash_get_page_count_mrsh.c>
|
#include <syscalls/flash_get_page_count_mrsh.c>
|
||||||
|
@ -90,8 +90,8 @@ static inline int z_vrfy_flash_sfdp_read(const struct device *dev,
|
||||||
off_t offset,
|
off_t offset,
|
||||||
void *data, size_t len)
|
void *data, size_t len)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_FLASH(dev, sfdp_read));
|
K_OOPS(K_SYSCALL_DRIVER_FLASH(dev, sfdp_read));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(data, len));
|
K_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>
|
||||||
|
@ -99,8 +99,8 @@ static inline int z_vrfy_flash_sfdp_read(const struct device *dev,
|
||||||
static inline int z_vrfy_flash_read_jedec_id(const struct device *dev,
|
static inline int z_vrfy_flash_read_jedec_id(const struct device *dev,
|
||||||
uint8_t *id)
|
uint8_t *id)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_FLASH(dev, read_jedec_id));
|
K_OOPS(K_SYSCALL_DRIVER_FLASH(dev, read_jedec_id));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(id, 3));
|
K_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>
|
||||||
|
@ -112,7 +112,7 @@ static inline int z_vrfy_flash_read_jedec_id(const struct device *dev,
|
||||||
static inline int z_vrfy_flash_ex_op(const struct device *dev, uint16_t code,
|
static inline int z_vrfy_flash_ex_op(const struct device *dev, uint16_t code,
|
||||||
const uintptr_t in, void *out)
|
const uintptr_t in, void *out)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_FLASH(dev, ex_op));
|
K_OOPS(K_SYSCALL_DRIVER_FLASH(dev, ex_op));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the code is a vendor code, then ex_op function have to perform
|
* If the code is a vendor code, then ex_op function have to perform
|
||||||
|
|
|
@ -453,7 +453,7 @@ static int flash_npcx_nor_ex_op(const struct device *dev, uint16_t code,
|
||||||
struct npcx_ex_ops_uma_out out_copy;
|
struct npcx_ex_ops_uma_out out_copy;
|
||||||
|
|
||||||
if (syscall_trap) {
|
if (syscall_trap) {
|
||||||
Z_OOPS(k_usermode_from_copy(&in_copy, op_in, sizeof(in_copy)));
|
K_OOPS(k_usermode_from_copy(&in_copy, op_in, sizeof(in_copy)));
|
||||||
op_in = &in_copy;
|
op_in = &in_copy;
|
||||||
op_out = &out_copy;
|
op_out = &out_copy;
|
||||||
}
|
}
|
||||||
|
@ -462,7 +462,7 @@ static int flash_npcx_nor_ex_op(const struct device *dev, uint16_t code,
|
||||||
ret = flash_npcx_nor_ex_exec_uma(dev, op_in, op_out);
|
ret = flash_npcx_nor_ex_exec_uma(dev, op_in, op_out);
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
if (ret == 0 && syscall_trap) {
|
if (ret == 0 && syscall_trap) {
|
||||||
Z_OOPS(k_usermode_to_copy(out, op_out, sizeof(out_copy)));
|
K_OOPS(k_usermode_to_copy(out, op_out, sizeof(out_copy)));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
@ -474,7 +474,7 @@ static int flash_npcx_nor_ex_op(const struct device *dev, uint16_t code,
|
||||||
struct npcx_ex_ops_qspi_oper_in in_copy;
|
struct npcx_ex_ops_qspi_oper_in in_copy;
|
||||||
|
|
||||||
if (syscall_trap) {
|
if (syscall_trap) {
|
||||||
Z_OOPS(k_usermode_from_copy(&in_copy, op_in, sizeof(in_copy)));
|
K_OOPS(k_usermode_from_copy(&in_copy, op_in, sizeof(in_copy)));
|
||||||
op_in = &in_copy;
|
op_in = &in_copy;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -495,7 +495,7 @@ static int flash_npcx_nor_ex_op(const struct device *dev, uint16_t code,
|
||||||
ret = flash_npcx_nor_ex_get_spi_spec(dev, op_out);
|
ret = flash_npcx_nor_ex_get_spi_spec(dev, op_out);
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
if (ret == 0 && syscall_trap) {
|
if (ret == 0 && syscall_trap) {
|
||||||
Z_OOPS(k_usermode_to_copy(out, op_out, sizeof(out_copy)));
|
K_OOPS(k_usermode_to_copy(out, op_out, sizeof(out_copy)));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -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(K_SYSCALL_SPECIFIC_DRIVER(dev, K_OBJ_DRIVER_FLASH, &flash_sim_api));
|
K_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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ int flash_stm32_ex_op_sector_wp(const struct device *dev, const uintptr_t in,
|
||||||
struct flash_stm32_ex_op_sector_wp_in in_copy;
|
struct flash_stm32_ex_op_sector_wp_in in_copy;
|
||||||
|
|
||||||
if (syscall_trap) {
|
if (syscall_trap) {
|
||||||
Z_OOPS(k_usermode_from_copy(&in_copy, request,
|
K_OOPS(k_usermode_from_copy(&in_copy, request,
|
||||||
sizeof(in_copy)));
|
sizeof(in_copy)));
|
||||||
request = &in_copy;
|
request = &in_copy;
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ int flash_stm32_ex_op_sector_wp(const struct device *dev, const uintptr_t in,
|
||||||
|
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
if (syscall_trap) {
|
if (syscall_trap) {
|
||||||
Z_OOPS(k_usermode_to_copy(out, result, sizeof(out_copy)));
|
K_OOPS(k_usermode_to_copy(out, result, sizeof(out_copy)));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ int flash_stm32_ex_op_rdp(const struct device *dev, const uintptr_t in,
|
||||||
if (request != NULL) {
|
if (request != NULL) {
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
if (syscall_trap) {
|
if (syscall_trap) {
|
||||||
Z_OOPS(k_usermode_from_copy(©, request, sizeof(copy)));
|
K_OOPS(k_usermode_from_copy(©, request, sizeof(copy)));
|
||||||
request = ©
|
request = ©
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -132,7 +132,7 @@ int flash_stm32_ex_op_rdp(const struct device *dev, const uintptr_t in,
|
||||||
|
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
if (syscall_trap) {
|
if (syscall_trap) {
|
||||||
Z_OOPS(k_usermode_to_copy(out, result, sizeof(copy)));
|
K_OOPS(k_usermode_to_copy(out, result, sizeof(copy)));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -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(K_SYSCALL_SPECIFIC_DRIVER(dev, K_OBJ_DRIVER_FLASH,
|
K_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);
|
||||||
|
|
|
@ -13,13 +13,13 @@ static inline int z_vrfy_fuel_gauge_get_prop(const struct device *dev, fuel_gaug
|
||||||
{
|
{
|
||||||
union fuel_gauge_prop_val k_val;
|
union fuel_gauge_prop_val k_val;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_FUEL_GAUGE(dev, get_property));
|
K_OOPS(K_SYSCALL_DRIVER_FUEL_GAUGE(dev, get_property));
|
||||||
|
|
||||||
Z_OOPS(k_usermode_from_copy(&k_val, val, sizeof(union fuel_gauge_prop_val)));
|
K_OOPS(k_usermode_from_copy(&k_val, val, sizeof(union fuel_gauge_prop_val)));
|
||||||
|
|
||||||
int ret = z_impl_fuel_gauge_get_prop(dev, prop, &k_val);
|
int ret = z_impl_fuel_gauge_get_prop(dev, prop, &k_val);
|
||||||
|
|
||||||
Z_OOPS(k_usermode_to_copy(val, &k_val, sizeof(union fuel_gauge_prop_val)));
|
K_OOPS(k_usermode_to_copy(val, &k_val, sizeof(union fuel_gauge_prop_val)));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -32,14 +32,14 @@ static inline int z_vrfy_fuel_gauge_get_props(const struct device *dev, fuel_gau
|
||||||
union fuel_gauge_prop_val k_vals[len];
|
union fuel_gauge_prop_val k_vals[len];
|
||||||
fuel_gauge_prop_t k_props[len];
|
fuel_gauge_prop_t k_props[len];
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_FUEL_GAUGE(dev, get_property));
|
K_OOPS(K_SYSCALL_DRIVER_FUEL_GAUGE(dev, get_property));
|
||||||
|
|
||||||
Z_OOPS(k_usermode_from_copy(k_vals, vals, len * sizeof(union fuel_gauge_prop_val)));
|
K_OOPS(k_usermode_from_copy(k_vals, vals, len * sizeof(union fuel_gauge_prop_val)));
|
||||||
Z_OOPS(k_usermode_from_copy(k_props, props, len * sizeof(fuel_gauge_prop_t)));
|
K_OOPS(k_usermode_from_copy(k_props, props, len * sizeof(fuel_gauge_prop_t)));
|
||||||
|
|
||||||
int ret = z_impl_fuel_gauge_get_props(dev, k_props, k_vals, len);
|
int ret = z_impl_fuel_gauge_get_props(dev, k_props, k_vals, len);
|
||||||
|
|
||||||
Z_OOPS(k_usermode_to_copy(vals, k_vals, len * sizeof(union fuel_gauge_prop_val)));
|
K_OOPS(k_usermode_to_copy(vals, k_vals, len * sizeof(union fuel_gauge_prop_val)));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ static inline int z_vrfy_fuel_gauge_get_props(const struct device *dev, fuel_gau
|
||||||
static inline int z_vrfy_fuel_gauge_set_prop(const struct device *dev, fuel_gauge_prop_t prop,
|
static inline int z_vrfy_fuel_gauge_set_prop(const struct device *dev, fuel_gauge_prop_t prop,
|
||||||
union fuel_gauge_prop_val val)
|
union fuel_gauge_prop_val val)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_FUEL_GAUGE(dev, set_property));
|
K_OOPS(K_SYSCALL_DRIVER_FUEL_GAUGE(dev, set_property));
|
||||||
|
|
||||||
int ret = z_impl_fuel_gauge_set_prop(dev, prop, val);
|
int ret = z_impl_fuel_gauge_set_prop(dev, prop, val);
|
||||||
|
|
||||||
|
@ -64,15 +64,15 @@ static inline int z_vrfy_fuel_gauge_set_props(const struct device *dev, fuel_gau
|
||||||
union fuel_gauge_prop_val k_vals[len];
|
union fuel_gauge_prop_val k_vals[len];
|
||||||
fuel_gauge_prop_t k_props[len];
|
fuel_gauge_prop_t k_props[len];
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_FUEL_GAUGE(dev, set_property));
|
K_OOPS(K_SYSCALL_DRIVER_FUEL_GAUGE(dev, set_property));
|
||||||
|
|
||||||
Z_OOPS(k_usermode_from_copy(k_vals, vals, len * sizeof(union fuel_gauge_prop_val)));
|
K_OOPS(k_usermode_from_copy(k_vals, vals, len * sizeof(union fuel_gauge_prop_val)));
|
||||||
Z_OOPS(k_usermode_from_copy(k_props, props, len * sizeof(fuel_gauge_prop_t)));
|
K_OOPS(k_usermode_from_copy(k_props, props, len * sizeof(fuel_gauge_prop_t)));
|
||||||
|
|
||||||
int ret = z_impl_fuel_gauge_set_props(dev, k_props, k_vals, len);
|
int ret = z_impl_fuel_gauge_set_props(dev, k_props, k_vals, len);
|
||||||
|
|
||||||
/* We only copy back vals because props will never be modified */
|
/* We only copy back vals because props will never be modified */
|
||||||
Z_OOPS(k_usermode_to_copy(vals, k_vals, len * sizeof(union fuel_gauge_prop_val)));
|
K_OOPS(k_usermode_to_copy(vals, k_vals, len * sizeof(union fuel_gauge_prop_val)));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -83,9 +83,9 @@ static inline int z_vrfy_fuel_gauge_get_buffer_prop(const struct device *dev,
|
||||||
fuel_gauge_prop_t prop, void *dst,
|
fuel_gauge_prop_t prop, void *dst,
|
||||||
size_t dst_len)
|
size_t dst_len)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_FUEL_GAUGE(dev, get_buffer_property));
|
K_OOPS(K_SYSCALL_DRIVER_FUEL_GAUGE(dev, get_buffer_property));
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(dst, dst_len));
|
K_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);
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ static inline int z_vrfy_fuel_gauge_get_buffer_prop(const struct device *dev,
|
||||||
|
|
||||||
static inline int z_vrfy_fuel_gauge_battery_cutoff(const struct device *dev)
|
static inline int z_vrfy_fuel_gauge_battery_cutoff(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_FUEL_GAUGE(dev, battery_cutoff));
|
K_OOPS(K_SYSCALL_DRIVER_FUEL_GAUGE(dev, battery_cutoff));
|
||||||
|
|
||||||
return z_impl_fuel_gauge_battery_cutoff(dev);
|
return z_impl_fuel_gauge_battery_cutoff(dev);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ static inline int z_vrfy_gpio_pin_configure(const struct device *port,
|
||||||
gpio_pin_t pin,
|
gpio_pin_t pin,
|
||||||
gpio_flags_t flags)
|
gpio_flags_t flags)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_GPIO(port, pin_configure));
|
K_OOPS(K_SYSCALL_DRIVER_GPIO(port, pin_configure));
|
||||||
return z_impl_gpio_pin_configure((const struct device *)port,
|
return z_impl_gpio_pin_configure((const struct device *)port,
|
||||||
pin,
|
pin,
|
||||||
flags);
|
flags);
|
||||||
|
@ -23,8 +23,8 @@ static inline int z_vrfy_gpio_pin_get_config(const struct device *port,
|
||||||
gpio_pin_t pin,
|
gpio_pin_t pin,
|
||||||
gpio_flags_t *flags)
|
gpio_flags_t *flags)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_GPIO(port, pin_get_config));
|
K_OOPS(K_SYSCALL_DRIVER_GPIO(port, pin_get_config));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(flags, sizeof(gpio_flags_t)));
|
K_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);
|
||||||
}
|
}
|
||||||
|
@ -34,8 +34,8 @@ static inline int z_vrfy_gpio_pin_get_config(const struct device *port,
|
||||||
static inline int z_vrfy_gpio_port_get_raw(const struct device *port,
|
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(K_SYSCALL_DRIVER_GPIO(port, port_get_raw));
|
K_OOPS(K_SYSCALL_DRIVER_GPIO(port, port_get_raw));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(value, sizeof(gpio_port_value_t)));
|
K_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);
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ static inline int z_vrfy_gpio_port_set_masked_raw(const struct device *port,
|
||||||
gpio_port_pins_t mask,
|
gpio_port_pins_t mask,
|
||||||
gpio_port_value_t value)
|
gpio_port_value_t value)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_GPIO(port, port_set_masked_raw));
|
K_OOPS(K_SYSCALL_DRIVER_GPIO(port, port_set_masked_raw));
|
||||||
return z_impl_gpio_port_set_masked_raw((const struct device *)port,
|
return z_impl_gpio_port_set_masked_raw((const struct device *)port,
|
||||||
mask,
|
mask,
|
||||||
value);
|
value);
|
||||||
|
@ -55,7 +55,7 @@ static inline int z_vrfy_gpio_port_set_masked_raw(const struct device *port,
|
||||||
static inline int z_vrfy_gpio_port_set_bits_raw(const struct device *port,
|
static inline int z_vrfy_gpio_port_set_bits_raw(const struct device *port,
|
||||||
gpio_port_pins_t pins)
|
gpio_port_pins_t pins)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_GPIO(port, port_set_bits_raw));
|
K_OOPS(K_SYSCALL_DRIVER_GPIO(port, port_set_bits_raw));
|
||||||
return z_impl_gpio_port_set_bits_raw((const struct device *)port,
|
return z_impl_gpio_port_set_bits_raw((const struct device *)port,
|
||||||
pins);
|
pins);
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ static inline int z_vrfy_gpio_port_set_bits_raw(const struct device *port,
|
||||||
static inline int z_vrfy_gpio_port_clear_bits_raw(const struct device *port,
|
static inline int z_vrfy_gpio_port_clear_bits_raw(const struct device *port,
|
||||||
gpio_port_pins_t pins)
|
gpio_port_pins_t pins)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_GPIO(port, port_clear_bits_raw));
|
K_OOPS(K_SYSCALL_DRIVER_GPIO(port, port_clear_bits_raw));
|
||||||
return z_impl_gpio_port_clear_bits_raw((const struct device *)port,
|
return z_impl_gpio_port_clear_bits_raw((const struct device *)port,
|
||||||
pins);
|
pins);
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ static inline int z_vrfy_gpio_port_clear_bits_raw(const struct device *port,
|
||||||
static inline int z_vrfy_gpio_port_toggle_bits(const struct device *port,
|
static inline int z_vrfy_gpio_port_toggle_bits(const struct device *port,
|
||||||
gpio_port_pins_t pins)
|
gpio_port_pins_t pins)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_GPIO(port, port_toggle_bits));
|
K_OOPS(K_SYSCALL_DRIVER_GPIO(port, port_toggle_bits));
|
||||||
return z_impl_gpio_port_toggle_bits((const struct device *)port, pins);
|
return z_impl_gpio_port_toggle_bits((const struct device *)port, pins);
|
||||||
}
|
}
|
||||||
#include <syscalls/gpio_port_toggle_bits_mrsh.c>
|
#include <syscalls/gpio_port_toggle_bits_mrsh.c>
|
||||||
|
@ -82,7 +82,7 @@ static inline int z_vrfy_gpio_pin_interrupt_configure(const struct device *port,
|
||||||
gpio_pin_t pin,
|
gpio_pin_t pin,
|
||||||
gpio_flags_t flags)
|
gpio_flags_t flags)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_GPIO(port, pin_interrupt_configure));
|
K_OOPS(K_SYSCALL_DRIVER_GPIO(port, pin_interrupt_configure));
|
||||||
return z_impl_gpio_pin_interrupt_configure((const struct device *)port,
|
return z_impl_gpio_pin_interrupt_configure((const struct device *)port,
|
||||||
pin,
|
pin,
|
||||||
flags);
|
flags);
|
||||||
|
@ -91,7 +91,7 @@ static inline int z_vrfy_gpio_pin_interrupt_configure(const struct device *port,
|
||||||
|
|
||||||
static inline int z_vrfy_gpio_get_pending_int(const struct device *dev)
|
static inline int z_vrfy_gpio_get_pending_int(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_GPIO(dev, get_pending_int));
|
K_OOPS(K_SYSCALL_DRIVER_GPIO(dev, get_pending_int));
|
||||||
|
|
||||||
return z_impl_gpio_get_pending_int((const struct device *)dev);
|
return z_impl_gpio_get_pending_int((const struct device *)dev);
|
||||||
}
|
}
|
||||||
|
@ -102,14 +102,14 @@ static inline int z_vrfy_gpio_port_get_direction(const struct device *dev, gpio_
|
||||||
gpio_port_pins_t *inputs,
|
gpio_port_pins_t *inputs,
|
||||||
gpio_port_pins_t *outputs)
|
gpio_port_pins_t *outputs)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_GPIO(dev, port_get_direction));
|
K_OOPS(K_SYSCALL_DRIVER_GPIO(dev, port_get_direction));
|
||||||
|
|
||||||
if (inputs != NULL) {
|
if (inputs != NULL) {
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(inputs, sizeof(gpio_port_pins_t)));
|
K_OOPS(K_SYSCALL_MEMORY_WRITE(inputs, sizeof(gpio_port_pins_t)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (outputs != NULL) {
|
if (outputs != NULL) {
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(outputs, sizeof(gpio_port_pins_t)));
|
K_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(K_SYSCALL_MEMORY_WRITE(buffer, length));
|
K_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);
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ int z_vrfy_hwinfo_get_reset_cause(uint32_t *cause)
|
||||||
uint32_t cause_copy;
|
uint32_t cause_copy;
|
||||||
|
|
||||||
ret = z_impl_hwinfo_get_reset_cause(&cause_copy);
|
ret = z_impl_hwinfo_get_reset_cause(&cause_copy);
|
||||||
Z_OOPS(k_usermode_to_copy(cause, &cause_copy, sizeof(uint32_t)));
|
K_OOPS(k_usermode_to_copy(cause, &cause_copy, sizeof(uint32_t)));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ int z_vrfy_hwinfo_get_supported_reset_cause(uint32_t *supported)
|
||||||
uint32_t supported_copy;
|
uint32_t supported_copy;
|
||||||
|
|
||||||
ret = z_impl_hwinfo_get_supported_reset_cause(&supported_copy);
|
ret = z_impl_hwinfo_get_supported_reset_cause(&supported_copy);
|
||||||
Z_OOPS(k_usermode_to_copy(supported, &supported_copy, sizeof(uint32_t)));
|
K_OOPS(k_usermode_to_copy(supported, &supported_copy, sizeof(uint32_t)));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
static inline int z_vrfy_hwspinlock_trylock(const struct device *dev, uint32_t id)
|
static inline int z_vrfy_hwspinlock_trylock(const struct device *dev, uint32_t id)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_HWSPINLOCK(dev, trylock));
|
K_OOPS(K_SYSCALL_DRIVER_HWSPINLOCK(dev, trylock));
|
||||||
return z_impl_hwspinlock_trylock(dev, id);
|
return z_impl_hwspinlock_trylock(dev, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ static inline int z_vrfy_hwspinlock_trylock(const struct device *dev, uint32_t i
|
||||||
|
|
||||||
static inline void z_vrfy_hwspinlock_lock(const struct device *dev, uint32_t id)
|
static inline void z_vrfy_hwspinlock_lock(const struct device *dev, uint32_t id)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_HWSPINLOCK(dev, lock));
|
K_OOPS(K_SYSCALL_DRIVER_HWSPINLOCK(dev, lock));
|
||||||
z_impl_hwspinlock_lock(dev, id);
|
z_impl_hwspinlock_lock(dev, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ static inline void z_vrfy_hwspinlock_lock(const struct device *dev, uint32_t id)
|
||||||
|
|
||||||
static inline void z_vrfy_hwspinlock_unlock(const struct device *dev, uint32_t id)
|
static inline void z_vrfy_hwspinlock_unlock(const struct device *dev, uint32_t id)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_HWSPINLOCK(dev, unlock));
|
K_OOPS(K_SYSCALL_DRIVER_HWSPINLOCK(dev, unlock));
|
||||||
z_impl_hwspinlock_unlock(dev, id);
|
z_impl_hwspinlock_unlock(dev, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ static inline void z_vrfy_hwspinlock_unlock(const struct device *dev, uint32_t i
|
||||||
|
|
||||||
static inline uint32_t z_vrfy_hwspinlock_get_max_id(const struct device *dev)
|
static inline uint32_t z_vrfy_hwspinlock_get_max_id(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_HWSPINLOCK(dev, get_max_id));
|
K_OOPS(K_SYSCALL_DRIVER_HWSPINLOCK(dev, get_max_id));
|
||||||
return z_impl_hwspinlock_get_max_id(dev);
|
return z_impl_hwspinlock_get_max_id(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
static inline int z_vrfy_i2c_configure(const struct device *dev,
|
static inline int z_vrfy_i2c_configure(const struct device *dev,
|
||||||
uint32_t dev_config)
|
uint32_t dev_config)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_I2C(dev, configure));
|
K_OOPS(K_SYSCALL_DRIVER_I2C(dev, configure));
|
||||||
return z_impl_i2c_configure((const struct device *)dev, dev_config);
|
return z_impl_i2c_configure((const struct device *)dev, dev_config);
|
||||||
}
|
}
|
||||||
#include <syscalls/i2c_configure_mrsh.c>
|
#include <syscalls/i2c_configure_mrsh.c>
|
||||||
|
@ -19,8 +19,8 @@ static inline int z_vrfy_i2c_configure(const struct device *dev,
|
||||||
static inline int z_vrfy_i2c_get_config(const struct device *dev,
|
static inline int z_vrfy_i2c_get_config(const struct device *dev,
|
||||||
uint32_t *dev_config)
|
uint32_t *dev_config)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_I2C(dev, get_config));
|
K_OOPS(K_SYSCALL_DRIVER_I2C(dev, get_config));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(dev_config, sizeof(uint32_t)));
|
K_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(K_SYSCALL_MEMORY(copy[i].buf, copy[i].len,
|
K_OOPS(K_SYSCALL_MEMORY(copy[i].buf, copy[i].len,
|
||||||
copy[i].flags & I2C_MSG_READ));
|
copy[i].flags & I2C_MSG_READ));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,17 +52,17 @@ 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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_I2C));
|
K_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
|
||||||
* in i2c.h use only a handful of messages, so up to 32 messages
|
* in i2c.h use only a handful of messages, so up to 32 messages
|
||||||
* should be more than sufficient.
|
* should be more than sufficient.
|
||||||
*/
|
*/
|
||||||
Z_OOPS(K_SYSCALL_VERIFY(num_msgs >= 1 && num_msgs < 32));
|
K_OOPS(K_SYSCALL_VERIFY(num_msgs >= 1 && num_msgs < 32));
|
||||||
|
|
||||||
/* We need to be able to read the overall array of messages */
|
/* We need to be able to read the overall array of messages */
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(msgs, num_msgs,
|
K_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(msgs, num_msgs,
|
||||||
sizeof(struct i2c_msg)));
|
sizeof(struct i2c_msg)));
|
||||||
|
|
||||||
return copy_msgs_and_transfer((const struct device *)dev,
|
return copy_msgs_and_transfer((const struct device *)dev,
|
||||||
|
@ -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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_I2C));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_I2C));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_I2C));
|
K_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>
|
||||||
|
|
|
@ -20,7 +20,7 @@ static inline int z_vrfy_i2s_configure(const struct device *dev,
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_OOPS(k_usermode_from_copy(&config, (const void *)cfg_ptr,
|
K_OOPS(k_usermode_from_copy(&config, (const void *)cfg_ptr,
|
||||||
sizeof(struct i2s_config)));
|
sizeof(struct i2s_config)));
|
||||||
|
|
||||||
/* 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
|
||||||
|
@ -50,7 +50,7 @@ static inline int z_vrfy_i2s_buf_read(const struct device *dev,
|
||||||
size_t data_size;
|
size_t data_size;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_I2S(dev, read));
|
K_OOPS(K_SYSCALL_DRIVER_I2S(dev, read));
|
||||||
|
|
||||||
ret = i2s_read((const struct device *)dev, &mem_block, &data_size);
|
ret = i2s_read((const struct device *)dev, &mem_block, &data_size);
|
||||||
|
|
||||||
|
@ -67,8 +67,8 @@ static inline int z_vrfy_i2s_buf_read(const struct device *dev,
|
||||||
data_size);
|
data_size);
|
||||||
|
|
||||||
k_mem_slab_free(rx_cfg->mem_slab, mem_block);
|
k_mem_slab_free(rx_cfg->mem_slab, mem_block);
|
||||||
Z_OOPS(copy_success);
|
K_OOPS(copy_success);
|
||||||
Z_OOPS(k_usermode_to_copy((void *)size, &data_size,
|
K_OOPS(k_usermode_to_copy((void *)size, &data_size,
|
||||||
sizeof(data_size)));
|
sizeof(data_size)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ static inline int z_vrfy_i2s_buf_write(const struct device *dev,
|
||||||
const struct i2s_config *tx_cfg;
|
const struct i2s_config *tx_cfg;
|
||||||
void *mem_block;
|
void *mem_block;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_I2S(dev, write));
|
K_OOPS(K_SYSCALL_DRIVER_I2S(dev, write));
|
||||||
tx_cfg = i2s_config_get((const struct device *)dev, I2S_DIR_TX);
|
tx_cfg = i2s_config_get((const struct device *)dev, I2S_DIR_TX);
|
||||||
if (!tx_cfg) {
|
if (!tx_cfg) {
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
@ -101,7 +101,7 @@ static inline int z_vrfy_i2s_buf_write(const struct device *dev,
|
||||||
ret = k_usermode_from_copy(mem_block, (void *)buf, size);
|
ret = k_usermode_from_copy(mem_block, (void *)buf, size);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
k_mem_slab_free(tx_cfg->mem_slab, mem_block);
|
k_mem_slab_free(tx_cfg->mem_slab, mem_block);
|
||||||
Z_OOPS(ret);
|
K_OOPS(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = i2s_write((const struct device *)dev, mem_block, size);
|
ret = i2s_write((const struct device *)dev, mem_block, size);
|
||||||
|
@ -117,7 +117,7 @@ static inline int z_vrfy_i2s_trigger(const struct device *dev,
|
||||||
enum i2s_dir dir,
|
enum i2s_dir dir,
|
||||||
enum i2s_trigger_cmd cmd)
|
enum i2s_trigger_cmd cmd)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_I2S(dev, trigger));
|
K_OOPS(K_SYSCALL_DRIVER_I2S(dev, trigger));
|
||||||
|
|
||||||
return z_impl_i2s_trigger((const struct device *)dev, dir, cmd);
|
return z_impl_i2s_trigger((const struct device *)dev, dir, cmd);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,24 +11,24 @@
|
||||||
static inline int z_vrfy_i3c_do_ccc(const struct device *dev,
|
static inline int z_vrfy_i3c_do_ccc(const struct device *dev,
|
||||||
struct i3c_ccc_payload *payload)
|
struct i3c_ccc_payload *payload)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_I3C(dev, do_ccc));
|
K_OOPS(K_SYSCALL_DRIVER_I3C(dev, do_ccc));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(payload, sizeof(*payload)));
|
K_OOPS(K_SYSCALL_MEMORY_READ(payload, sizeof(*payload)));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(payload, sizeof(*payload)));
|
K_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,
|
K_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(payload->ccc.data,
|
||||||
payload->ccc.data_len,
|
payload->ccc.data_len,
|
||||||
sizeof(*payload->ccc.data)));
|
sizeof(*payload->ccc.data)));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_ARRAY_WRITE(payload->ccc.data,
|
K_OOPS(K_SYSCALL_MEMORY_ARRAY_WRITE(payload->ccc.data,
|
||||||
payload->ccc.data_len,
|
payload->ccc.data_len,
|
||||||
sizeof(*payload->ccc.data)));
|
sizeof(*payload->ccc.data)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (payload->targets.payloads != NULL) {
|
if (payload->targets.payloads != NULL) {
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(payload->targets.payloads,
|
K_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(payload->targets.payloads,
|
||||||
payload->targets.num_targets,
|
payload->targets.num_targets,
|
||||||
sizeof(*payload->targets.payloads)));
|
sizeof(*payload->targets.payloads)));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_ARRAY_WRITE(payload->targets.payloads,
|
K_OOPS(K_SYSCALL_MEMORY_ARRAY_WRITE(payload->targets.payloads,
|
||||||
payload->targets.num_targets,
|
payload->targets.num_targets,
|
||||||
sizeof(*payload->targets.payloads)));
|
sizeof(*payload->targets.payloads)));
|
||||||
}
|
}
|
||||||
|
@ -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(K_SYSCALL_MEMORY(copy[i].buf, copy[i].len,
|
K_OOPS(K_SYSCALL_MEMORY(copy[i].buf, copy[i].len,
|
||||||
copy[i].flags & I3C_MSG_READ));
|
copy[i].flags & I3C_MSG_READ));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,18 +61,18 @@ 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(K_SYSCALL_MEMORY_READ(target, sizeof(*target)));
|
K_OOPS(K_SYSCALL_MEMORY_READ(target, sizeof(*target)));
|
||||||
Z_OOPS(K_SYSCALL_OBJ(target->bus, K_OBJ_DRIVER_I3C));
|
K_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
|
||||||
* in i2c.h use only a handful of messages, so up to 32 messages
|
* in i2c.h use only a handful of messages, so up to 32 messages
|
||||||
* should be more than sufficient.
|
* should be more than sufficient.
|
||||||
*/
|
*/
|
||||||
Z_OOPS(K_SYSCALL_VERIFY(num_msgs >= 1 && num_msgs < 32));
|
K_OOPS(K_SYSCALL_VERIFY(num_msgs >= 1 && num_msgs < 32));
|
||||||
|
|
||||||
/* We need to be able to read the overall array of messages */
|
/* We need to be able to read the overall array of messages */
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(msgs, num_msgs,
|
K_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(msgs, num_msgs,
|
||||||
sizeof(struct i3c_msg)));
|
sizeof(struct i3c_msg)));
|
||||||
|
|
||||||
return copy_i3c_msgs_and_transfer((struct i3c_device_desc *)target,
|
return copy_i3c_msgs_and_transfer((struct i3c_device_desc *)target,
|
||||||
|
|
|
@ -11,8 +11,8 @@ static inline int z_vrfy_ipm_send(const struct device *dev, int wait,
|
||||||
uint32_t id,
|
uint32_t id,
|
||||||
const void *data, int size)
|
const void *data, int size)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_IPM(dev, send));
|
K_OOPS(K_SYSCALL_DRIVER_IPM(dev, send));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(data, size));
|
K_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);
|
||||||
}
|
}
|
||||||
|
@ -20,21 +20,21 @@ static inline int z_vrfy_ipm_send(const struct device *dev, int wait,
|
||||||
|
|
||||||
static inline int z_vrfy_ipm_max_data_size_get(const struct device *dev)
|
static inline int z_vrfy_ipm_max_data_size_get(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_IPM(dev, max_data_size_get));
|
K_OOPS(K_SYSCALL_DRIVER_IPM(dev, max_data_size_get));
|
||||||
return z_impl_ipm_max_data_size_get((const struct device *)dev);
|
return z_impl_ipm_max_data_size_get((const struct device *)dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/ipm_max_data_size_get_mrsh.c>
|
#include <syscalls/ipm_max_data_size_get_mrsh.c>
|
||||||
|
|
||||||
static inline uint32_t z_vrfy_ipm_max_id_val_get(const struct device *dev)
|
static inline uint32_t z_vrfy_ipm_max_id_val_get(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_IPM(dev, max_id_val_get));
|
K_OOPS(K_SYSCALL_DRIVER_IPM(dev, max_id_val_get));
|
||||||
return z_impl_ipm_max_id_val_get((const struct device *)dev);
|
return z_impl_ipm_max_id_val_get((const struct device *)dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/ipm_max_id_val_get_mrsh.c>
|
#include <syscalls/ipm_max_id_val_get_mrsh.c>
|
||||||
|
|
||||||
static inline int z_vrfy_ipm_set_enabled(const struct device *dev, int enable)
|
static inline int z_vrfy_ipm_set_enabled(const struct device *dev, int enable)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_IPM(dev, set_enabled));
|
K_OOPS(K_SYSCALL_DRIVER_IPM(dev, set_enabled));
|
||||||
return z_impl_ipm_set_enabled((const struct device *)dev, enable);
|
return z_impl_ipm_set_enabled((const struct device *)dev, enable);
|
||||||
}
|
}
|
||||||
#include <syscalls/ipm_set_enabled_mrsh.c>
|
#include <syscalls/ipm_set_enabled_mrsh.c>
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
static inline int z_vrfy_kscan_config(const struct device *dev,
|
static inline int z_vrfy_kscan_config(const struct device *dev,
|
||||||
kscan_callback_t callback_isr)
|
kscan_callback_t callback_isr)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_KSCAN(dev, config));
|
K_OOPS(K_SYSCALL_DRIVER_KSCAN(dev, config));
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(callback_isr == 0,
|
K_OOPS(K_SYSCALL_VERIFY_MSG(callback_isr == 0,
|
||||||
"callback cannot be set from user mode"));
|
"callback cannot be set from user mode"));
|
||||||
return z_impl_kscan_config((const struct device *)dev, callback_isr);
|
return z_impl_kscan_config((const struct device *)dev, callback_isr);
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ static inline int z_vrfy_kscan_config(const struct device *dev,
|
||||||
|
|
||||||
static inline int z_vrfy_kscan_disable_callback(const struct device *dev)
|
static inline int z_vrfy_kscan_disable_callback(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_KSCAN(dev, disable_callback));
|
K_OOPS(K_SYSCALL_DRIVER_KSCAN(dev, disable_callback));
|
||||||
|
|
||||||
return z_impl_kscan_disable_callback((const struct device *)dev);
|
return z_impl_kscan_disable_callback((const struct device *)dev);
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ static inline int z_vrfy_kscan_disable_callback(const struct device *dev)
|
||||||
|
|
||||||
static int z_vrfy_kscan_enable_callback(const struct device *dev)
|
static int z_vrfy_kscan_enable_callback(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_KSCAN(dev, enable_callback));
|
K_OOPS(K_SYSCALL_DRIVER_KSCAN(dev, enable_callback));
|
||||||
|
|
||||||
return z_impl_kscan_enable_callback((const struct device *)dev);
|
return z_impl_kscan_enable_callback((const struct device *)dev);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
static inline int z_vrfy_led_blink(const struct device *dev, uint32_t led,
|
static inline int z_vrfy_led_blink(const struct device *dev, uint32_t led,
|
||||||
uint32_t delay_on, uint32_t delay_off)
|
uint32_t delay_on, uint32_t delay_off)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_LED(dev, blink));
|
K_OOPS(K_SYSCALL_DRIVER_LED(dev, blink));
|
||||||
return z_impl_led_blink((const struct device *)dev, led, delay_on,
|
return z_impl_led_blink((const struct device *)dev, led, delay_on,
|
||||||
delay_off);
|
delay_off);
|
||||||
}
|
}
|
||||||
|
@ -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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_LED));
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_LED));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(info, sizeof(*info)));
|
K_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>
|
||||||
|
@ -29,7 +29,7 @@ static inline int z_vrfy_led_set_brightness(const struct device *dev,
|
||||||
uint32_t led,
|
uint32_t led,
|
||||||
uint8_t value)
|
uint8_t value)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_LED(dev, set_brightness));
|
K_OOPS(K_SYSCALL_DRIVER_LED(dev, set_brightness));
|
||||||
return z_impl_led_set_brightness((const struct device *)dev, led,
|
return z_impl_led_set_brightness((const struct device *)dev, led,
|
||||||
value);
|
value);
|
||||||
}
|
}
|
||||||
|
@ -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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_LED));
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_LED));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(buf, num_channels));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_LED));
|
K_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,22 +56,22 @@ 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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_LED));
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_LED));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(color, num_colors));
|
K_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>
|
||||||
|
|
||||||
static inline int z_vrfy_led_on(const struct device *dev, uint32_t led)
|
static inline int z_vrfy_led_on(const struct device *dev, uint32_t led)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_LED(dev, on));
|
K_OOPS(K_SYSCALL_DRIVER_LED(dev, on));
|
||||||
return z_impl_led_on((const struct device *)dev, led);
|
return z_impl_led_on((const struct device *)dev, led);
|
||||||
}
|
}
|
||||||
#include <syscalls/led_on_mrsh.c>
|
#include <syscalls/led_on_mrsh.c>
|
||||||
|
|
||||||
static inline int z_vrfy_led_off(const struct device *dev, uint32_t led)
|
static inline int z_vrfy_led_off(const struct device *dev, uint32_t led)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_LED(dev, off));
|
K_OOPS(K_SYSCALL_DRIVER_LED(dev, off));
|
||||||
return z_impl_led_off((const struct device *)dev, led);
|
return z_impl_led_off((const struct device *)dev, led);
|
||||||
}
|
}
|
||||||
#include <syscalls/led_off_mrsh.c>
|
#include <syscalls/led_off_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(K_SYSCALL_MEMORY_READ(channel, sizeof(struct mbox_channel)));
|
K_OOPS(K_SYSCALL_MEMORY_READ(channel, sizeof(struct mbox_channel)));
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_MBOX(channel->dev, send));
|
K_OOPS(K_SYSCALL_DRIVER_MBOX(channel->dev, send));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(msg, sizeof(struct mbox_msg)));
|
K_OOPS(K_SYSCALL_MEMORY_READ(msg, sizeof(struct mbox_msg)));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(msg->data, msg->size));
|
K_OOPS(K_SYSCALL_MEMORY_READ(msg->data, msg->size));
|
||||||
|
|
||||||
return z_impl_mbox_send(channel, msg);
|
return z_impl_mbox_send(channel, msg);
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ static inline int z_vrfy_mbox_send(const struct mbox_channel *channel,
|
||||||
|
|
||||||
static inline int z_vrfy_mbox_mtu_get(const struct device *dev)
|
static inline int z_vrfy_mbox_mtu_get(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_MBOX(dev, mtu_get));
|
K_OOPS(K_SYSCALL_DRIVER_MBOX(dev, mtu_get));
|
||||||
|
|
||||||
return z_impl_mbox_mtu_get(dev);
|
return z_impl_mbox_mtu_get(dev);
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ static inline int z_vrfy_mbox_mtu_get(const struct device *dev)
|
||||||
|
|
||||||
static inline uint32_t z_vrfy_mbox_max_channels_get(const struct device *dev)
|
static inline uint32_t z_vrfy_mbox_max_channels_get(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_MBOX(dev, max_channels_get));
|
K_OOPS(K_SYSCALL_DRIVER_MBOX(dev, max_channels_get));
|
||||||
|
|
||||||
return z_impl_mbox_max_channels_get(dev);
|
return z_impl_mbox_max_channels_get(dev);
|
||||||
}
|
}
|
||||||
|
@ -37,8 +37,8 @@ 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(K_SYSCALL_MEMORY_READ(channel, sizeof(struct mbox_channel)));
|
K_OOPS(K_SYSCALL_MEMORY_READ(channel, sizeof(struct mbox_channel)));
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_MBOX(channel->dev, set_enabled));
|
K_OOPS(K_SYSCALL_DRIVER_MBOX(channel->dev, set_enabled));
|
||||||
|
|
||||||
return z_impl_mbox_set_enabled(channel, enable);
|
return z_impl_mbox_set_enabled(channel, enable);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
|
|
||||||
static inline int z_vrfy_tgpio_port_get_time(const struct device *port, uint64_t *current_time)
|
static inline int z_vrfy_tgpio_port_get_time(const struct device *port, uint64_t *current_time)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_TGPIO(port, get_time));
|
K_OOPS(Z_SYSCALL_DRIVER_TGPIO(port, get_time));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(current_time, sizeof(uint64_t)));
|
K_OOPS(Z_SYSCALL_MEMORY_WRITE(current_time, sizeof(uint64_t)));
|
||||||
return z_impl_tgpio_port_get_time((const struct device *)port, (uint64_t *)current_time);
|
return z_impl_tgpio_port_get_time((const struct device *)port, (uint64_t *)current_time);
|
||||||
}
|
}
|
||||||
#include <syscalls/tgpio_port_get_time_mrsh.c>
|
#include <syscalls/tgpio_port_get_time_mrsh.c>
|
||||||
|
@ -17,8 +17,8 @@ static inline int z_vrfy_tgpio_port_get_time(const struct device *port, uint64_t
|
||||||
static inline int z_vrfy_tgpio_port_get_cycles_per_second(const struct device *port,
|
static inline int z_vrfy_tgpio_port_get_cycles_per_second(const struct device *port,
|
||||||
uint32_t *cycles)
|
uint32_t *cycles)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_TGPIO(port, cyc_per_sec));
|
K_OOPS(Z_SYSCALL_DRIVER_TGPIO(port, cyc_per_sec));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(cycles, sizeof(uint32_t)));
|
K_OOPS(Z_SYSCALL_MEMORY_WRITE(cycles, sizeof(uint32_t)));
|
||||||
return z_impl_tgpio_port_get_cycles_per_second((const struct device *)port,
|
return z_impl_tgpio_port_get_cycles_per_second((const struct device *)port,
|
||||||
(uint32_t *)cycles);
|
(uint32_t *)cycles);
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ static inline int z_vrfy_tgpio_pin_periodic_output(const struct device *port, ui
|
||||||
uint64_t start_time, uint64_t repeat_interval,
|
uint64_t start_time, uint64_t repeat_interval,
|
||||||
bool periodic_enable)
|
bool periodic_enable)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_TGPIO(port, set_perout));
|
K_OOPS(Z_SYSCALL_DRIVER_TGPIO(port, set_perout));
|
||||||
return z_impl_tgpio_pin_periodic_output((const struct device *)port, pin, start_time,
|
return z_impl_tgpio_pin_periodic_output((const struct device *)port, pin, start_time,
|
||||||
repeat_interval, periodic_enable);
|
repeat_interval, periodic_enable);
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ static inline int z_vrfy_tgpio_pin_periodic_output(const struct device *port, ui
|
||||||
|
|
||||||
static inline int z_vrfy_tgpio_pin_disable(const struct device *port, uint32_t pin)
|
static inline int z_vrfy_tgpio_pin_disable(const struct device *port, uint32_t pin)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_TGPIO(port, pin_disable));
|
K_OOPS(Z_SYSCALL_DRIVER_TGPIO(port, pin_disable));
|
||||||
return z_impl_tgpio_pin_disable((const struct device *)port, pin);
|
return z_impl_tgpio_pin_disable((const struct device *)port, pin);
|
||||||
}
|
}
|
||||||
#include <syscalls/tgpio_pin_disable_mrsh.c>
|
#include <syscalls/tgpio_pin_disable_mrsh.c>
|
||||||
|
@ -44,7 +44,7 @@ static inline int z_vrfy_tgpio_pin_disable(const struct device *port, uint32_t p
|
||||||
static inline int z_vrfy_tgpio_pin_config_ext_timestamp(const struct device *port, uint32_t pin,
|
static inline int z_vrfy_tgpio_pin_config_ext_timestamp(const struct device *port, uint32_t pin,
|
||||||
uint32_t event_polarity)
|
uint32_t event_polarity)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_TGPIO(port, config_ext_ts));
|
K_OOPS(Z_SYSCALL_DRIVER_TGPIO(port, config_ext_ts));
|
||||||
return z_impl_tgpio_pin_config_ext_timestamp((const struct device *)port, pin,
|
return z_impl_tgpio_pin_config_ext_timestamp((const struct device *)port, pin,
|
||||||
event_polarity);
|
event_polarity);
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ static inline int z_vrfy_tgpio_pin_config_ext_timestamp(const struct device *por
|
||||||
static inline int z_vrfy_tgpio_pin_read_ts_ec(const struct device *port, uint32_t pin,
|
static inline int z_vrfy_tgpio_pin_read_ts_ec(const struct device *port, uint32_t pin,
|
||||||
uint64_t *timestamp, uint64_t *event_count)
|
uint64_t *timestamp, uint64_t *event_count)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_TGPIO(port, read_ts_ec));
|
K_OOPS(Z_SYSCALL_DRIVER_TGPIO(port, read_ts_ec));
|
||||||
return z_impl_tgpio_pin_read_ts_ec((const struct device *)port, pin, (uint64_t *)timestamp,
|
return z_impl_tgpio_pin_read_ts_ec((const struct device *)port, pin, (uint64_t *)timestamp,
|
||||||
(uint64_t *)event_count);
|
(uint64_t *)event_count);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
static inline int z_vrfy_peci_config(const struct device *dev,
|
static inline int z_vrfy_peci_config(const struct device *dev,
|
||||||
uint32_t bitrate)
|
uint32_t bitrate)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_PECI(dev, config));
|
K_OOPS(K_SYSCALL_DRIVER_PECI(dev, config));
|
||||||
|
|
||||||
return z_impl_peci_config(dev, bitrate);
|
return z_impl_peci_config(dev, bitrate);
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ static inline int z_vrfy_peci_config(const struct device *dev,
|
||||||
|
|
||||||
static inline int z_vrfy_peci_enable(const struct device *dev)
|
static inline int z_vrfy_peci_enable(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_PECI(dev, enable));
|
K_OOPS(K_SYSCALL_DRIVER_PECI(dev, enable));
|
||||||
|
|
||||||
return z_impl_peci_enable(dev);
|
return z_impl_peci_enable(dev);
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ static inline int z_vrfy_peci_enable(const struct device *dev)
|
||||||
|
|
||||||
static inline int z_vrfy_peci_disable(const struct device *dev)
|
static inline int z_vrfy_peci_disable(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_PECI(dev, disable));
|
K_OOPS(K_SYSCALL_DRIVER_PECI(dev, disable));
|
||||||
|
|
||||||
return z_impl_peci_disable(dev);
|
return z_impl_peci_disable(dev);
|
||||||
}
|
}
|
||||||
|
@ -38,8 +38,8 @@ static inline int z_vrfy_peci_transfer(const struct device *dev,
|
||||||
{
|
{
|
||||||
struct peci_msg msg_copy;
|
struct peci_msg msg_copy;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_PECI(dev, transfer));
|
K_OOPS(K_SYSCALL_DRIVER_PECI(dev, transfer));
|
||||||
Z_OOPS(k_usermode_from_copy(&msg_copy, msg, sizeof(*msg)));
|
K_OOPS(k_usermode_from_copy(&msg_copy, msg, sizeof(*msg)));
|
||||||
|
|
||||||
return z_impl_peci_transfer(dev, &msg_copy);
|
return z_impl_peci_transfer(dev, &msg_copy);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
static inline int z_vrfy_ps2_config(const struct device *dev,
|
static inline int z_vrfy_ps2_config(const struct device *dev,
|
||||||
ps2_callback_t callback_isr)
|
ps2_callback_t callback_isr)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_PS2(dev, config));
|
K_OOPS(K_SYSCALL_DRIVER_PS2(dev, config));
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(callback_isr == NULL,
|
K_OOPS(K_SYSCALL_VERIFY_MSG(callback_isr == NULL,
|
||||||
"callback not be set from user mode"));
|
"callback not be set from user mode"));
|
||||||
return z_impl_ps2_config(dev, callback_isr);
|
return z_impl_ps2_config(dev, callback_isr);
|
||||||
}
|
}
|
||||||
|
@ -19,29 +19,29 @@ static inline int z_vrfy_ps2_config(const struct device *dev,
|
||||||
|
|
||||||
static inline int z_vrfy_ps2_write(const struct device *dev, uint8_t value)
|
static inline int z_vrfy_ps2_write(const struct device *dev, uint8_t value)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_PS2(dev, write));
|
K_OOPS(K_SYSCALL_DRIVER_PS2(dev, write));
|
||||||
return z_impl_ps2_write(dev, value);
|
return z_impl_ps2_write(dev, value);
|
||||||
}
|
}
|
||||||
#include <syscalls/ps2_write_mrsh.c>
|
#include <syscalls/ps2_write_mrsh.c>
|
||||||
|
|
||||||
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(K_SYSCALL_DRIVER_PS2(dev, read));
|
K_OOPS(K_SYSCALL_DRIVER_PS2(dev, read));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(value, sizeof(uint8_t)));
|
K_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>
|
||||||
|
|
||||||
static inline int z_vrfy_ps2_enable_callback(const struct device *dev)
|
static inline int z_vrfy_ps2_enable_callback(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_PS2(dev, enable_callback));
|
K_OOPS(K_SYSCALL_DRIVER_PS2(dev, enable_callback));
|
||||||
return z_impl_ps2_enable_callback(dev);
|
return z_impl_ps2_enable_callback(dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/ps2_enable_callback_mrsh.c>
|
#include <syscalls/ps2_enable_callback_mrsh.c>
|
||||||
|
|
||||||
static inline int z_vrfy_ps2_disable_callback(const struct device *dev)
|
static inline int z_vrfy_ps2_disable_callback(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_PS2(dev, disable_callback));
|
K_OOPS(K_SYSCALL_DRIVER_PS2(dev, disable_callback));
|
||||||
return z_impl_ps2_disable_callback(dev);
|
return z_impl_ps2_disable_callback(dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/ps2_disable_callback_mrsh.c>
|
#include <syscalls/ps2_disable_callback_mrsh.c>
|
||||||
|
|
|
@ -14,8 +14,8 @@ int z_vrfy_ptp_clock_get(const struct device *dev,
|
||||||
struct net_ptp_time ptp_time;
|
struct net_ptp_time ptp_time;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_PTP_CLOCK(dev, get));
|
K_OOPS(K_SYSCALL_DRIVER_PTP_CLOCK(dev, get));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(tm, sizeof(struct net_ptp_time)));
|
K_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) {
|
||||||
|
|
|
@ -12,7 +12,7 @@ static inline int z_vrfy_pwm_set_cycles(const struct device *dev,
|
||||||
uint32_t channel, uint32_t period,
|
uint32_t channel, uint32_t period,
|
||||||
uint32_t pulse, pwm_flags_t flags)
|
uint32_t pulse, pwm_flags_t flags)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_PWM(dev, set_cycles));
|
K_OOPS(K_SYSCALL_DRIVER_PWM(dev, set_cycles));
|
||||||
return z_impl_pwm_set_cycles((const struct device *)dev, channel,
|
return z_impl_pwm_set_cycles((const struct device *)dev, channel,
|
||||||
period, pulse, flags);
|
period, pulse, flags);
|
||||||
}
|
}
|
||||||
|
@ -22,8 +22,8 @@ static inline int z_vrfy_pwm_get_cycles_per_sec(const struct device *dev,
|
||||||
uint32_t channel,
|
uint32_t channel,
|
||||||
uint64_t *cycles)
|
uint64_t *cycles)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_PWM(dev, get_cycles_per_sec));
|
K_OOPS(K_SYSCALL_DRIVER_PWM(dev, get_cycles_per_sec));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(cycles, sizeof(uint64_t)));
|
K_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);
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ static inline int z_vrfy_pwm_get_cycles_per_sec(const struct device *dev,
|
||||||
static inline int z_vrfy_pwm_enable_capture(const struct device *dev,
|
static inline int z_vrfy_pwm_enable_capture(const struct device *dev,
|
||||||
uint32_t channel)
|
uint32_t channel)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_PWM(dev, enable_capture));
|
K_OOPS(K_SYSCALL_DRIVER_PWM(dev, enable_capture));
|
||||||
return z_impl_pwm_enable_capture((const struct device *)dev, channel);
|
return z_impl_pwm_enable_capture((const struct device *)dev, channel);
|
||||||
}
|
}
|
||||||
#include <syscalls/pwm_enable_capture_mrsh.c>
|
#include <syscalls/pwm_enable_capture_mrsh.c>
|
||||||
|
@ -42,7 +42,7 @@ static inline int z_vrfy_pwm_enable_capture(const struct device *dev,
|
||||||
static inline int z_vrfy_pwm_disable_capture(const struct device *dev,
|
static inline int z_vrfy_pwm_disable_capture(const struct device *dev,
|
||||||
uint32_t channel)
|
uint32_t channel)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_PWM(dev, disable_capture));
|
K_OOPS(K_SYSCALL_DRIVER_PWM(dev, disable_capture));
|
||||||
return z_impl_pwm_disable_capture((const struct device *)dev, channel);
|
return z_impl_pwm_disable_capture((const struct device *)dev, channel);
|
||||||
}
|
}
|
||||||
#include <syscalls/pwm_disable_capture_mrsh.c>
|
#include <syscalls/pwm_disable_capture_mrsh.c>
|
||||||
|
@ -57,19 +57,19 @@ static inline int z_vrfy_pwm_capture_cycles(const struct device *dev,
|
||||||
uint32_t pulse;
|
uint32_t pulse;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_PWM(dev, configure_capture));
|
K_OOPS(K_SYSCALL_DRIVER_PWM(dev, configure_capture));
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_PWM(dev, enable_capture));
|
K_OOPS(K_SYSCALL_DRIVER_PWM(dev, enable_capture));
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_PWM(dev, disable_capture));
|
K_OOPS(K_SYSCALL_DRIVER_PWM(dev, disable_capture));
|
||||||
|
|
||||||
err = z_impl_pwm_capture_cycles((const struct device *)dev, channel,
|
err = z_impl_pwm_capture_cycles((const struct device *)dev, channel,
|
||||||
flags, &period, &pulse, timeout);
|
flags, &period, &pulse, timeout);
|
||||||
if (period_cycles != NULL) {
|
if (period_cycles != NULL) {
|
||||||
Z_OOPS(k_usermode_to_copy(period_cycles, &period,
|
K_OOPS(k_usermode_to_copy(period_cycles, &period,
|
||||||
sizeof(*period_cycles)));
|
sizeof(*period_cycles)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pulse_cycles != NULL) {
|
if (pulse_cycles != NULL) {
|
||||||
Z_OOPS(k_usermode_to_copy(pulse_cycles, &pulse,
|
K_OOPS(k_usermode_to_copy(pulse_cycles, &pulse,
|
||||||
sizeof(*pulse_cycles)));
|
sizeof(*pulse_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RETAINED_MEM));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RETAINED_MEM));
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RETAINED_MEM));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(buffer, size));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RETAINED_MEM));
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RETAINED_MEM));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(buffer, size));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RETAINED_MEM));
|
K_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>
|
||||||
|
|
|
@ -9,16 +9,16 @@
|
||||||
|
|
||||||
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(K_SYSCALL_DRIVER_RTC(dev, set_time));
|
K_OOPS(K_SYSCALL_DRIVER_RTC(dev, set_time));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(timeptr, sizeof(struct rtc_time)));
|
K_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>
|
||||||
|
|
||||||
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(K_SYSCALL_DRIVER_RTC(dev, get_time));
|
K_OOPS(K_SYSCALL_DRIVER_RTC(dev, get_time));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(timeptr, sizeof(struct rtc_time)));
|
K_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>
|
||||||
|
@ -27,8 +27,8 @@ static inline int z_vrfy_rtc_get_time(const struct device *dev, struct rtc_time
|
||||||
static inline int z_vrfy_rtc_alarm_get_supported_fields(const struct device *dev, uint16_t id,
|
static inline int z_vrfy_rtc_alarm_get_supported_fields(const struct device *dev, uint16_t id,
|
||||||
uint16_t *mask)
|
uint16_t *mask)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_RTC(dev, alarm_get_supported_fields));
|
K_OOPS(K_SYSCALL_DRIVER_RTC(dev, alarm_get_supported_fields));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(mask, sizeof(uint16_t)));
|
K_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>
|
||||||
|
@ -36,8 +36,8 @@ static inline int z_vrfy_rtc_alarm_get_supported_fields(const struct device *dev
|
||||||
static inline int z_vrfy_rtc_alarm_set_time(const struct device *dev, uint16_t id, uint16_t mask,
|
static inline int z_vrfy_rtc_alarm_set_time(const struct device *dev, uint16_t id, uint16_t mask,
|
||||||
const struct rtc_time *timeptr)
|
const struct rtc_time *timeptr)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_RTC(dev, alarm_set_time));
|
K_OOPS(K_SYSCALL_DRIVER_RTC(dev, alarm_set_time));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(timeptr, sizeof(struct rtc_time)));
|
K_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>
|
||||||
|
@ -45,16 +45,16 @@ static inline int z_vrfy_rtc_alarm_set_time(const struct device *dev, uint16_t i
|
||||||
static inline int z_vrfy_rtc_alarm_get_time(const struct device *dev, uint16_t id, uint16_t *mask,
|
static inline int z_vrfy_rtc_alarm_get_time(const struct device *dev, uint16_t id, uint16_t *mask,
|
||||||
struct rtc_time *timeptr)
|
struct rtc_time *timeptr)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_RTC(dev, alarm_get_time));
|
K_OOPS(K_SYSCALL_DRIVER_RTC(dev, alarm_get_time));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(mask, sizeof(uint16_t)));
|
K_OOPS(K_SYSCALL_MEMORY_WRITE(mask, sizeof(uint16_t)));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(timeptr, sizeof(struct rtc_time)));
|
K_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>
|
||||||
|
|
||||||
static inline int z_vrfy_rtc_alarm_is_pending(const struct device *dev, uint16_t id)
|
static inline int z_vrfy_rtc_alarm_is_pending(const struct device *dev, uint16_t id)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_RTC(dev, alarm_is_pending));
|
K_OOPS(K_SYSCALL_DRIVER_RTC(dev, alarm_is_pending));
|
||||||
return z_impl_rtc_alarm_is_pending(dev, id);
|
return z_impl_rtc_alarm_is_pending(dev, id);
|
||||||
}
|
}
|
||||||
#include <syscalls/rtc_alarm_is_pending_mrsh.c>
|
#include <syscalls/rtc_alarm_is_pending_mrsh.c>
|
||||||
|
@ -63,7 +63,7 @@ static inline int z_vrfy_rtc_alarm_is_pending(const struct device *dev, uint16_t
|
||||||
#ifdef CONFIG_RTC_CALIBRATION
|
#ifdef CONFIG_RTC_CALIBRATION
|
||||||
static inline int z_vrfy_rtc_set_calibration(const struct device *dev, int32_t calibration)
|
static inline int z_vrfy_rtc_set_calibration(const struct device *dev, int32_t calibration)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_RTC(dev, set_calibration));
|
K_OOPS(K_SYSCALL_DRIVER_RTC(dev, set_calibration));
|
||||||
return z_impl_rtc_set_calibration(dev, calibration);
|
return z_impl_rtc_set_calibration(dev, calibration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,8 +71,8 @@ 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(K_SYSCALL_DRIVER_RTC(dev, get_calibration));
|
K_OOPS(K_SYSCALL_DRIVER_RTC(dev, get_calibration));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(calibration, sizeof(int32_t)));
|
K_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>
|
||||||
|
|
|
@ -12,8 +12,8 @@ static inline int z_vrfy_sensor_attr_set(const struct device *dev,
|
||||||
enum sensor_attribute attr,
|
enum sensor_attribute attr,
|
||||||
const struct sensor_value *val)
|
const struct sensor_value *val)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_SENSOR(dev, attr_set));
|
K_OOPS(K_SYSCALL_DRIVER_SENSOR(dev, attr_set));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(val, sizeof(struct sensor_value)));
|
K_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);
|
||||||
}
|
}
|
||||||
|
@ -24,8 +24,8 @@ static inline int z_vrfy_sensor_attr_get(const struct device *dev,
|
||||||
enum sensor_attribute attr,
|
enum sensor_attribute attr,
|
||||||
struct sensor_value *val)
|
struct sensor_value *val)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_SENSOR(dev, attr_get));
|
K_OOPS(K_SYSCALL_DRIVER_SENSOR(dev, attr_get));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(val, sizeof(struct sensor_value)));
|
K_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);
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ static inline int z_vrfy_sensor_attr_get(const struct device *dev,
|
||||||
|
|
||||||
static inline int z_vrfy_sensor_sample_fetch(const struct device *dev)
|
static inline int z_vrfy_sensor_sample_fetch(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_SENSOR(dev, sample_fetch));
|
K_OOPS(K_SYSCALL_DRIVER_SENSOR(dev, sample_fetch));
|
||||||
return z_impl_sensor_sample_fetch((const struct device *)dev);
|
return z_impl_sensor_sample_fetch((const struct device *)dev);
|
||||||
}
|
}
|
||||||
#include <syscalls/sensor_sample_fetch_mrsh.c>
|
#include <syscalls/sensor_sample_fetch_mrsh.c>
|
||||||
|
@ -41,7 +41,7 @@ static inline int z_vrfy_sensor_sample_fetch(const struct device *dev)
|
||||||
static inline int z_vrfy_sensor_sample_fetch_chan(const struct device *dev,
|
static inline int z_vrfy_sensor_sample_fetch_chan(const struct device *dev,
|
||||||
enum sensor_channel type)
|
enum sensor_channel type)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_SENSOR(dev, sample_fetch));
|
K_OOPS(K_SYSCALL_DRIVER_SENSOR(dev, sample_fetch));
|
||||||
return z_impl_sensor_sample_fetch_chan((const struct device *)dev,
|
return z_impl_sensor_sample_fetch_chan((const struct device *)dev,
|
||||||
type);
|
type);
|
||||||
}
|
}
|
||||||
|
@ -51,8 +51,8 @@ static inline int z_vrfy_sensor_channel_get(const struct device *dev,
|
||||||
enum sensor_channel chan,
|
enum sensor_channel chan,
|
||||||
struct sensor_value *val)
|
struct sensor_value *val)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_SENSOR(dev, channel_get));
|
K_OOPS(K_SYSCALL_DRIVER_SENSOR(dev, channel_get));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(val, sizeof(struct sensor_value)));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SENSOR));
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SENSOR));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(decoder, sizeof(struct sensor_decoder_api)));
|
K_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(K_SYSCALL_OBJ(iodev, K_OBJ_RTIO_IODEV));
|
K_OOPS(K_SYSCALL_OBJ(iodev, K_OBJ_RTIO_IODEV));
|
||||||
Z_OOPS(K_SYSCALL_OBJ(sensor, K_OBJ_DRIVER_SENSOR));
|
K_OOPS(K_SYSCALL_OBJ(sensor, K_OBJ_DRIVER_SENSOR));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(channels, sizeof(enum sensor_channel) * num_channels));
|
K_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>
|
||||||
|
|
|
@ -10,14 +10,14 @@
|
||||||
#define UART_SIMPLE(op_) \
|
#define UART_SIMPLE(op_) \
|
||||||
static inline int z_vrfy_uart_##op_(const struct device *dev) \
|
static inline int z_vrfy_uart_##op_(const struct device *dev) \
|
||||||
{ \
|
{ \
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_UART(dev, op_)); \
|
K_OOPS(K_SYSCALL_DRIVER_UART(dev, op_)); \
|
||||||
return z_impl_uart_ ## op_(dev); \
|
return z_impl_uart_ ## op_(dev); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define UART_SIMPLE_VOID(op_) \
|
#define UART_SIMPLE_VOID(op_) \
|
||||||
static inline void z_vrfy_uart_##op_(const struct device *dev) \
|
static inline void z_vrfy_uart_##op_(const struct device *dev) \
|
||||||
{ \
|
{ \
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_UART(dev, op_)); \
|
K_OOPS(K_SYSCALL_DRIVER_UART(dev, op_)); \
|
||||||
z_impl_uart_ ## op_(dev); \
|
z_impl_uart_ ## op_(dev); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,8 +27,8 @@ UART_SIMPLE(err_check)
|
||||||
static inline int z_vrfy_uart_poll_in(const struct device *dev,
|
static inline int z_vrfy_uart_poll_in(const struct device *dev,
|
||||||
unsigned char *p_char)
|
unsigned char *p_char)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_UART(dev, poll_in));
|
K_OOPS(K_SYSCALL_DRIVER_UART(dev, poll_in));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(p_char, sizeof(unsigned char)));
|
K_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>
|
||||||
|
@ -36,8 +36,8 @@ static inline int z_vrfy_uart_poll_in(const struct device *dev,
|
||||||
static inline int z_vrfy_uart_poll_in_u16(const struct device *dev,
|
static inline int z_vrfy_uart_poll_in_u16(const struct device *dev,
|
||||||
uint16_t *p_u16)
|
uint16_t *p_u16)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_UART(dev, poll_in));
|
K_OOPS(K_SYSCALL_DRIVER_UART(dev, poll_in));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(p_u16, sizeof(uint16_t)));
|
K_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>
|
||||||
|
@ -45,7 +45,7 @@ static inline int z_vrfy_uart_poll_in_u16(const struct device *dev,
|
||||||
static inline void z_vrfy_uart_poll_out(const struct device *dev,
|
static inline void z_vrfy_uart_poll_out(const struct device *dev,
|
||||||
unsigned char out_char)
|
unsigned char out_char)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_UART(dev, poll_out));
|
K_OOPS(K_SYSCALL_DRIVER_UART(dev, poll_out));
|
||||||
z_impl_uart_poll_out((const struct device *)dev, out_char);
|
z_impl_uart_poll_out((const struct device *)dev, out_char);
|
||||||
}
|
}
|
||||||
#include <syscalls/uart_poll_out_mrsh.c>
|
#include <syscalls/uart_poll_out_mrsh.c>
|
||||||
|
@ -53,7 +53,7 @@ static inline void z_vrfy_uart_poll_out(const struct device *dev,
|
||||||
static inline void z_vrfy_uart_poll_out_u16(const struct device *dev,
|
static inline void z_vrfy_uart_poll_out_u16(const struct device *dev,
|
||||||
uint16_t out_u16)
|
uint16_t out_u16)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_UART(dev, poll_out));
|
K_OOPS(K_SYSCALL_DRIVER_UART(dev, poll_out));
|
||||||
z_impl_uart_poll_out_u16((const struct device *)dev, out_u16);
|
z_impl_uart_poll_out_u16((const struct device *)dev, out_u16);
|
||||||
}
|
}
|
||||||
#include <syscalls/uart_poll_out_u16_mrsh.c>
|
#include <syscalls/uart_poll_out_u16_mrsh.c>
|
||||||
|
@ -62,8 +62,8 @@ static inline void z_vrfy_uart_poll_out_u16(const struct device *dev,
|
||||||
static inline int z_vrfy_uart_config_get(const struct device *dev,
|
static inline int z_vrfy_uart_config_get(const struct device *dev,
|
||||||
struct uart_config *cfg)
|
struct uart_config *cfg)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_UART(dev, config_get));
|
K_OOPS(K_SYSCALL_DRIVER_UART(dev, config_get));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(cfg, sizeof(struct uart_config)));
|
K_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);
|
||||||
}
|
}
|
||||||
|
@ -72,8 +72,8 @@ static inline int z_vrfy_uart_config_get(const struct device *dev,
|
||||||
static inline int z_vrfy_uart_configure(const struct device *dev,
|
static inline int z_vrfy_uart_configure(const struct device *dev,
|
||||||
const struct uart_config *cfg)
|
const struct uart_config *cfg)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_UART(dev, config_get));
|
K_OOPS(K_SYSCALL_DRIVER_UART(dev, config_get));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(cfg, sizeof(struct uart_config)));
|
K_OOPS(K_SYSCALL_MEMORY_READ(cfg, sizeof(struct uart_config)));
|
||||||
|
|
||||||
return z_impl_uart_configure(dev, cfg);
|
return z_impl_uart_configure(dev, cfg);
|
||||||
}
|
}
|
||||||
|
@ -90,8 +90,8 @@ static inline int z_vrfy_uart_configure(const struct device *dev,
|
||||||
static inline int z_vrfy_uart_tx(const struct device *dev, const uint8_t *buf,
|
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(K_SYSCALL_DRIVER_UART(dev, tx));
|
K_OOPS(K_SYSCALL_DRIVER_UART(dev, tx));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(buf, len));
|
K_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>
|
||||||
|
@ -101,8 +101,8 @@ static inline int z_vrfy_uart_tx_u16(const struct device *dev,
|
||||||
const uint16_t *buf,
|
const uint16_t *buf,
|
||||||
size_t len, int32_t timeout)
|
size_t len, int32_t timeout)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_UART(dev, tx));
|
K_OOPS(K_SYSCALL_DRIVER_UART(dev, tx));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(buf, len, sizeof(uint16_t)));
|
K_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(buf, len, sizeof(uint16_t)));
|
||||||
return z_impl_uart_tx_u16(dev, buf, len, timeout);
|
return z_impl_uart_tx_u16(dev, buf, len, timeout);
|
||||||
}
|
}
|
||||||
#include <syscalls/uart_tx_u16_mrsh.c>
|
#include <syscalls/uart_tx_u16_mrsh.c>
|
||||||
|
@ -115,8 +115,8 @@ static inline int z_vrfy_uart_rx_enable(const struct device *dev,
|
||||||
uint8_t *buf,
|
uint8_t *buf,
|
||||||
size_t len, int32_t timeout)
|
size_t len, int32_t timeout)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_UART(dev, rx_enable));
|
K_OOPS(K_SYSCALL_DRIVER_UART(dev, rx_enable));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(buf, len));
|
K_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>
|
||||||
|
@ -126,8 +126,8 @@ static inline int z_vrfy_uart_rx_enable_u16(const struct device *dev,
|
||||||
uint16_t *buf,
|
uint16_t *buf,
|
||||||
size_t len, int32_t timeout)
|
size_t len, int32_t timeout)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_UART(dev, rx_enable));
|
K_OOPS(K_SYSCALL_DRIVER_UART(dev, rx_enable));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_ARRAY_WRITE(buf, len, sizeof(uint16_t)));
|
K_OOPS(K_SYSCALL_MEMORY_ARRAY_WRITE(buf, len, sizeof(uint16_t)));
|
||||||
return z_impl_uart_rx_enable_u16(dev, buf, len, timeout);
|
return z_impl_uart_rx_enable_u16(dev, buf, len, timeout);
|
||||||
}
|
}
|
||||||
#include <syscalls/uart_rx_enable_u16_mrsh.c>
|
#include <syscalls/uart_rx_enable_u16_mrsh.c>
|
||||||
|
@ -160,7 +160,7 @@ UART_SIMPLE(irq_update)
|
||||||
static inline int z_vrfy_uart_line_ctrl_set(const struct device *dev,
|
static inline int z_vrfy_uart_line_ctrl_set(const struct device *dev,
|
||||||
uint32_t ctrl, uint32_t val)
|
uint32_t ctrl, uint32_t val)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_UART(dev, line_ctrl_set));
|
K_OOPS(K_SYSCALL_DRIVER_UART(dev, line_ctrl_set));
|
||||||
return z_impl_uart_line_ctrl_set((const struct device *)dev, ctrl,
|
return z_impl_uart_line_ctrl_set((const struct device *)dev, ctrl,
|
||||||
val);
|
val);
|
||||||
}
|
}
|
||||||
|
@ -169,8 +169,8 @@ static inline int z_vrfy_uart_line_ctrl_set(const struct device *dev,
|
||||||
static inline int z_vrfy_uart_line_ctrl_get(const struct device *dev,
|
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(K_SYSCALL_DRIVER_UART(dev, line_ctrl_get));
|
K_OOPS(K_SYSCALL_DRIVER_UART(dev, line_ctrl_get));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(val, sizeof(uint32_t)));
|
K_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);
|
||||||
}
|
}
|
||||||
|
@ -181,7 +181,7 @@ static inline int z_vrfy_uart_line_ctrl_get(const struct device *dev,
|
||||||
static inline int z_vrfy_uart_drv_cmd(const struct device *dev, uint32_t cmd,
|
static inline int z_vrfy_uart_drv_cmd(const struct device *dev, uint32_t cmd,
|
||||||
uint32_t p)
|
uint32_t p)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_UART(dev, drv_cmd));
|
K_OOPS(K_SYSCALL_DRIVER_UART(dev, drv_cmd));
|
||||||
return z_impl_uart_drv_cmd((const struct device *)dev, cmd, p);
|
return z_impl_uart_drv_cmd((const struct device *)dev, cmd, p);
|
||||||
}
|
}
|
||||||
#include <syscalls/uart_drv_cmd_mrsh.c>
|
#include <syscalls/uart_drv_cmd_mrsh.c>
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
static inline int z_vrfy_smbus_configure(const struct device *dev,
|
static inline int z_vrfy_smbus_configure(const struct device *dev,
|
||||||
uint32_t dev_config)
|
uint32_t dev_config)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_SMBUS(dev, configure));
|
K_OOPS(K_SYSCALL_DRIVER_SMBUS(dev, configure));
|
||||||
|
|
||||||
return z_impl_smbus_configure(dev, dev_config);
|
return z_impl_smbus_configure(dev, dev_config);
|
||||||
}
|
}
|
||||||
|
@ -20,8 +20,8 @@ static inline int z_vrfy_smbus_configure(const struct device *dev,
|
||||||
static inline int z_vrfy_smbus_get_config(const struct device *dev,
|
static inline int z_vrfy_smbus_get_config(const struct device *dev,
|
||||||
uint32_t *dev_config)
|
uint32_t *dev_config)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_SMBUS(dev, get_config));
|
K_OOPS(K_SYSCALL_DRIVER_SMBUS(dev, get_config));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(dev_config, sizeof(uint32_t)));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(byte, sizeof(uint8_t)));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(byte, sizeof(uint8_t)));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(word, sizeof(uint16_t)));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(recv_word, sizeof(uint16_t)));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(buf, count));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(count, sizeof(uint8_t)));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(snd_buf, snd_count));
|
K_OOPS(K_SYSCALL_MEMORY_READ(snd_buf, snd_count));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(rcv_count, sizeof(uint8_t)));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS));
|
K_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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ static struct spi_buf_set *copy_and_check(struct spi_buf_set *bufs,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Validate the array of struct spi_buf instances */
|
/* Validate the array of struct spi_buf instances */
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(bufs->buffers,
|
K_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(bufs->buffers,
|
||||||
bufs->count,
|
bufs->count,
|
||||||
sizeof(struct spi_buf)));
|
sizeof(struct spi_buf)));
|
||||||
|
|
||||||
|
@ -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(K_SYSCALL_MEMORY(buf->buf, buf->len, writable));
|
K_OOPS(K_SYSCALL_MEMORY(buf->buf, buf->len, writable));
|
||||||
}
|
}
|
||||||
|
|
||||||
return bufs;
|
return bufs;
|
||||||
|
@ -76,17 +76,17 @@ 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(K_SYSCALL_MEMORY_READ(config, sizeof(*config)));
|
K_OOPS(K_SYSCALL_MEMORY_READ(config, sizeof(*config)));
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_SPI(dev, transceive));
|
K_OOPS(K_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(K_SYSCALL_MEMORY_READ(tx_bufs,
|
K_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(K_SYSCALL_VERIFY(tx_bufs_copy.count < 32));
|
K_OOPS(K_SYSCALL_VERIFY(tx_bufs_copy.count < 32));
|
||||||
} else {
|
} else {
|
||||||
memset(&tx_bufs_copy, 0, sizeof(tx_bufs_copy));
|
memset(&tx_bufs_copy, 0, sizeof(tx_bufs_copy));
|
||||||
}
|
}
|
||||||
|
@ -95,17 +95,17 @@ 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(K_SYSCALL_MEMORY_READ(rx_bufs,
|
K_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(K_SYSCALL_VERIFY(rx_bufs_copy.count < 32));
|
K_OOPS(K_SYSCALL_VERIFY(rx_bufs_copy.count < 32));
|
||||||
} else {
|
} else {
|
||||||
memset(&rx_bufs_copy, 0, sizeof(rx_bufs_copy));
|
memset(&rx_bufs_copy, 0, sizeof(rx_bufs_copy));
|
||||||
}
|
}
|
||||||
|
|
||||||
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(K_SYSCALL_OBJ(config_copy.cs.gpio.port,
|
K_OOPS(K_SYSCALL_OBJ(config_copy.cs.gpio.port,
|
||||||
K_OBJ_DRIVER_GPIO));
|
K_OBJ_DRIVER_GPIO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,8 +119,8 @@ 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(K_SYSCALL_MEMORY_READ(config, sizeof(*config)));
|
K_OOPS(K_SYSCALL_MEMORY_READ(config, sizeof(*config)));
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_SPI(dev, release));
|
K_OOPS(K_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);
|
||||||
}
|
}
|
||||||
#include <syscalls/spi_release_mrsh.c>
|
#include <syscalls/spi_release_mrsh.c>
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
static inline int z_vrfy_bc12_set_role(const struct device *dev, enum bc12_role role)
|
static inline int z_vrfy_bc12_set_role(const struct device *dev, enum bc12_role role)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_BC12(dev, set_role));
|
K_OOPS(K_SYSCALL_DRIVER_BC12(dev, set_role));
|
||||||
|
|
||||||
return z_impl_bc12_set_role(dev, role);
|
return z_impl_bc12_set_role(dev, role);
|
||||||
}
|
}
|
||||||
|
@ -17,8 +17,8 @@ static inline int z_vrfy_bc12_set_role(const struct device *dev, enum bc12_role
|
||||||
static inline int z_vrfy_bc12_set_result_cb(const struct device *dev, bc12_callback_t cb,
|
static inline int z_vrfy_bc12_set_result_cb(const struct device *dev, bc12_callback_t cb,
|
||||||
void *user_data)
|
void *user_data)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_BC12(dev, set_result_cb));
|
K_OOPS(K_SYSCALL_DRIVER_BC12(dev, set_result_cb));
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(cb == NULL, "callbacks may not be set from user mode"));
|
K_OOPS(K_SYSCALL_VERIFY_MSG(cb == NULL, "callbacks may not be set from user mode"));
|
||||||
|
|
||||||
return z_impl_bc12_set_result_cb(dev, cb, user_data);
|
return z_impl_bc12_set_result_cb(dev, cb, user_data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
static inline size_t z_vrfy_ivshmem_get_mem(const struct device *dev,
|
static inline size_t z_vrfy_ivshmem_get_mem(const struct device *dev,
|
||||||
uintptr_t *memmap)
|
uintptr_t *memmap)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, get_mem));
|
K_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, get_mem));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(memmap, sizeof(uintptr_t)));
|
K_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);
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ static inline size_t z_vrfy_ivshmem_get_mem(const struct device *dev,
|
||||||
|
|
||||||
static inline uint32_t z_vrfy_ivshmem_get_id(const struct device *dev)
|
static inline uint32_t z_vrfy_ivshmem_get_id(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, get_id));
|
K_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, get_id));
|
||||||
|
|
||||||
return z_impl_ivshmem_get_id(dev);
|
return z_impl_ivshmem_get_id(dev);
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ static inline uint32_t z_vrfy_ivshmem_get_id(const struct device *dev)
|
||||||
|
|
||||||
static inline uint16_t z_vrfy_ivshmem_get_vectors(const struct device *dev)
|
static inline uint16_t z_vrfy_ivshmem_get_vectors(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, get_vectors));
|
K_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, get_vectors));
|
||||||
|
|
||||||
return z_impl_ivshmem_get_vectors(dev);
|
return z_impl_ivshmem_get_vectors(dev);
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ static inline uint16_t z_vrfy_ivshmem_get_vectors(const struct device *dev)
|
||||||
static inline int z_vrfy_ivshmem_int_peer(const struct device *dev,
|
static inline int z_vrfy_ivshmem_int_peer(const struct device *dev,
|
||||||
uint32_t peer_id, uint16_t vector)
|
uint32_t peer_id, uint16_t vector)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, int_peer));
|
K_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, int_peer));
|
||||||
|
|
||||||
return z_impl_ivshmem_int_peer(dev, peer_id, vector);
|
return z_impl_ivshmem_int_peer(dev, peer_id, vector);
|
||||||
}
|
}
|
||||||
|
@ -47,8 +47,8 @@ static inline int z_vrfy_ivshmem_register_handler(const struct device *dev,
|
||||||
struct k_poll_signal *signal,
|
struct k_poll_signal *signal,
|
||||||
uint16_t vector)
|
uint16_t vector)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, register_handler));
|
K_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, register_handler));
|
||||||
Z_OOPS(K_SYSCALL_OBJ(signal, K_OBJ_POLL_SIGNAL));
|
K_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);
|
||||||
}
|
}
|
||||||
|
@ -59,8 +59,8 @@ static inline int z_vrfy_ivshmem_register_handler(const struct device *dev,
|
||||||
static inline size_t z_vrfy_ivshmem_get_rw_mem_section(const struct device *dev,
|
static inline size_t z_vrfy_ivshmem_get_rw_mem_section(const struct device *dev,
|
||||||
uintptr_t *memmap)
|
uintptr_t *memmap)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, get_rw_mem_section));
|
K_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, get_rw_mem_section));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(memmap, sizeof(uintptr_t)));
|
K_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);
|
||||||
}
|
}
|
||||||
|
@ -70,8 +70,8 @@ static inline size_t z_vrfy_ivshmem_get_output_mem_section(const struct device *
|
||||||
uint32_t peer_id,
|
uint32_t peer_id,
|
||||||
uintptr_t *memmap)
|
uintptr_t *memmap)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, get_output_mem_section));
|
K_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, get_output_mem_section));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(memmap, sizeof(uintptr_t)));
|
K_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);
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ static inline size_t z_vrfy_ivshmem_get_output_mem_section(const struct device *
|
||||||
static inline uint32_t z_vrfy_ivshmem_get_state(const struct device *dev,
|
static inline uint32_t z_vrfy_ivshmem_get_state(const struct device *dev,
|
||||||
uint32_t peer_id)
|
uint32_t peer_id)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, get_state));
|
K_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, get_state));
|
||||||
|
|
||||||
return z_impl_ivshmem_get_state(dev, peer_id);
|
return z_impl_ivshmem_get_state(dev, peer_id);
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ static inline uint32_t z_vrfy_ivshmem_get_state(const struct device *dev,
|
||||||
static inline int z_vrfy_ivshmem_set_state(const struct device *dev,
|
static inline int z_vrfy_ivshmem_set_state(const struct device *dev,
|
||||||
uint32_t state)
|
uint32_t state)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, set_state));
|
K_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, set_state));
|
||||||
|
|
||||||
return z_impl_ivshmem_set_state(dev, state);
|
return z_impl_ivshmem_set_state(dev, state);
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ static inline int z_vrfy_ivshmem_set_state(const struct device *dev,
|
||||||
|
|
||||||
static inline uint32_t z_vrfy_ivshmem_get_max_peers(const struct device *dev)
|
static inline uint32_t z_vrfy_ivshmem_get_max_peers(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, get_max_peers));
|
K_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, get_max_peers));
|
||||||
|
|
||||||
return z_impl_ivshmem_get_max_peers(dev);
|
return z_impl_ivshmem_get_max_peers(dev);
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ static inline uint32_t z_vrfy_ivshmem_get_max_peers(const struct device *dev)
|
||||||
|
|
||||||
static inline uint16_t z_vrfy_ivshmem_get_protocol(const struct device *dev)
|
static inline uint16_t z_vrfy_ivshmem_get_protocol(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, get_protocol));
|
K_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, get_protocol));
|
||||||
|
|
||||||
return z_impl_ivshmem_get_protocol(dev);
|
return z_impl_ivshmem_get_protocol(dev);
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ static inline uint16_t z_vrfy_ivshmem_get_protocol(const struct device *dev)
|
||||||
static inline int z_vrfy_ivshmem_enable_interrupts(const struct device *dev,
|
static inline int z_vrfy_ivshmem_enable_interrupts(const struct device *dev,
|
||||||
bool enable)
|
bool enable)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, enable_interrupts));
|
K_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, enable_interrupts));
|
||||||
|
|
||||||
return z_impl_ivshmem_enable_interrupts(dev, enable);
|
return z_impl_ivshmem_enable_interrupts(dev, enable);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
static inline int z_vrfy_w1_reset_bus(const struct device *dev)
|
static inline int z_vrfy_w1_reset_bus(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_W1(dev, reset_bus));
|
K_OOPS(K_SYSCALL_DRIVER_W1(dev, reset_bus));
|
||||||
|
|
||||||
return z_impl_w1_reset_bus((const struct device *)dev);
|
return z_impl_w1_reset_bus((const struct device *)dev);
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ static inline int z_vrfy_w1_reset_bus(const struct device *dev)
|
||||||
|
|
||||||
static inline int z_vrfy_w1_read_bit(const struct device *dev)
|
static inline int z_vrfy_w1_read_bit(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_W1(dev, read_bit));
|
K_OOPS(K_SYSCALL_DRIVER_W1(dev, read_bit));
|
||||||
|
|
||||||
return z_impl_w1_read_bit((const struct device *)dev);
|
return z_impl_w1_read_bit((const struct device *)dev);
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ static inline int z_vrfy_w1_read_bit(const struct device *dev)
|
||||||
|
|
||||||
static inline int z_vrfy_w1_write_bit(const struct device *dev, bool bit)
|
static inline int z_vrfy_w1_write_bit(const struct device *dev, bool bit)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_W1(dev, write_bit));
|
K_OOPS(K_SYSCALL_DRIVER_W1(dev, write_bit));
|
||||||
|
|
||||||
return z_impl_w1_write_bit((const struct device *)dev, bit);
|
return z_impl_w1_write_bit((const struct device *)dev, bit);
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ static inline int z_vrfy_w1_write_bit(const struct device *dev, bool bit)
|
||||||
|
|
||||||
static inline int z_vrfy_w1_read_byte(const struct device *dev)
|
static inline int z_vrfy_w1_read_byte(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_W1(dev, read_byte));
|
K_OOPS(K_SYSCALL_DRIVER_W1(dev, read_byte));
|
||||||
|
|
||||||
return z_impl_w1_read_byte((const struct device *)dev);
|
return z_impl_w1_read_byte((const struct device *)dev);
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ static inline int z_vrfy_w1_read_byte(const struct device *dev)
|
||||||
|
|
||||||
static inline int z_vrfy_w1_write_byte(const struct device *dev, uint8_t byte)
|
static inline int z_vrfy_w1_write_byte(const struct device *dev, uint8_t byte)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_W1(dev, write_byte));
|
K_OOPS(K_SYSCALL_DRIVER_W1(dev, write_byte));
|
||||||
|
|
||||||
return z_impl_w1_write_byte((const struct device *)dev, (uint8_t)byte);
|
return z_impl_w1_write_byte((const struct device *)dev, (uint8_t)byte);
|
||||||
}
|
}
|
||||||
|
@ -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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_W1));
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_W1));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(buffer, len));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_W1));
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_W1));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(buffer, len));
|
K_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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_W1));
|
K_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);
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ static inline int z_vrfy_w1_change_bus_lock(const struct device *dev, bool lock)
|
||||||
static inline int z_vrfy_w1_configure(const struct device *dev,
|
static inline int z_vrfy_w1_configure(const struct device *dev,
|
||||||
enum w1_settings_type type, uint32_t value)
|
enum w1_settings_type type, uint32_t value)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_W1(dev, configure));
|
K_OOPS(K_SYSCALL_DRIVER_W1(dev, configure));
|
||||||
|
|
||||||
return z_impl_w1_configure(dev, type, value);
|
return z_impl_w1_configure(dev, type, value);
|
||||||
}
|
}
|
||||||
|
@ -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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_W1));
|
K_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,9 +100,9 @@ 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(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_W1));
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_W1));
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(callback == 0,
|
K_OOPS(K_SYSCALL_VERIFY_MSG(callback == 0,
|
||||||
"callbacks may not be set from user mode"));
|
"callbacks may not be set from user mode"));
|
||||||
/* user_data is not dereferenced, no need to check parameter */
|
/* user_data is not dereferenced, no need to check parameter */
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
static inline int z_vrfy_wdt_setup(const struct device *dev, uint8_t options)
|
static inline int z_vrfy_wdt_setup(const struct device *dev, uint8_t options)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_WDT(dev, setup));
|
K_OOPS(K_SYSCALL_DRIVER_WDT(dev, setup));
|
||||||
return z_impl_wdt_setup(dev, options);
|
return z_impl_wdt_setup(dev, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ static inline int z_vrfy_wdt_setup(const struct device *dev, uint8_t options)
|
||||||
|
|
||||||
static inline int z_vrfy_wdt_disable(const struct device *dev)
|
static inline int z_vrfy_wdt_disable(const struct device *dev)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_WDT(dev, disable));
|
K_OOPS(K_SYSCALL_DRIVER_WDT(dev, disable));
|
||||||
return z_impl_wdt_disable(dev);
|
return z_impl_wdt_disable(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ static inline int z_vrfy_wdt_disable(const struct device *dev)
|
||||||
|
|
||||||
static inline int z_vrfy_wdt_feed(const struct device *dev, int channel_id)
|
static inline int z_vrfy_wdt_feed(const struct device *dev, int channel_id)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_DRIVER_WDT(dev, feed));
|
K_OOPS(K_SYSCALL_DRIVER_WDT(dev, feed));
|
||||||
return z_impl_wdt_feed(dev, channel_id);
|
return z_impl_wdt_feed(dev, channel_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -287,7 +287,7 @@ char *k_usermode_string_alloc_copy(const char *src, size_t maxlen);
|
||||||
*/
|
*/
|
||||||
int k_usermode_string_copy(char *dst, const char *src, size_t maxlen);
|
int k_usermode_string_copy(char *dst, const char *src, size_t maxlen);
|
||||||
|
|
||||||
#define Z_OOPS(expr) \
|
#define K_OOPS(expr) \
|
||||||
do { \
|
do { \
|
||||||
if (expr) { \
|
if (expr) { \
|
||||||
arch_syscall_oops(_current->syscall_frame); \
|
arch_syscall_oops(_current->syscall_frame); \
|
||||||
|
|
|
@ -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(K_SYSCALL_MEMORY_WRITE(target, sizeof(atomic_t))); \
|
K_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(K_SYSCALL_MEMORY_WRITE(target, sizeof(atomic_t))); \
|
K_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(K_SYSCALL_MEMORY_WRITE(target, sizeof(atomic_t)));
|
K_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(K_SYSCALL_MEMORY_WRITE(target, sizeof(atomic_ptr_t)));
|
K_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(K_SYSCALL_MEMORY_WRITE(target, sizeof(atomic_ptr_t)));
|
K_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(K_SYSCALL_OBJ_INIT(condvar, K_OBJ_CONDVAR));
|
K_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(K_SYSCALL_OBJ(condvar, K_OBJ_CONDVAR));
|
K_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(K_SYSCALL_OBJ(condvar, K_OBJ_CONDVAR));
|
K_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(K_SYSCALL_OBJ(condvar, K_OBJ_CONDVAR));
|
K_OOPS(K_SYSCALL_OBJ(condvar, K_OBJ_CONDVAR));
|
||||||
Z_OOPS(K_SYSCALL_OBJ(mutex, K_OBJ_MUTEX));
|
K_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(K_SYSCALL_OBJ_INIT(dev, K_OBJ_ANY));
|
K_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(K_SYSCALL_OBJ_NEVER_INIT(event, K_OBJ_EVENT));
|
K_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(K_SYSCALL_OBJ(event, K_OBJ_EVENT));
|
K_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(K_SYSCALL_OBJ(event, K_OBJ_EVENT));
|
K_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(K_SYSCALL_OBJ(event, K_OBJ_EVENT));
|
K_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(K_SYSCALL_OBJ(event, K_OBJ_EVENT));
|
K_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(K_SYSCALL_OBJ(event, K_OBJ_EVENT));
|
K_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(K_SYSCALL_OBJ(event, K_OBJ_EVENT));
|
K_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>
|
||||||
|
|
|
@ -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(K_SYSCALL_OBJ_NEVER_INIT(msgq, K_OBJ_MSGQ));
|
K_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(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
K_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(data, msgq->msg_size));
|
K_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(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
K_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(attrs, sizeof(struct k_msgq_attrs)));
|
K_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(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
K_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(data, msgq->msg_size));
|
K_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(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
K_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(data, msgq->msg_size));
|
K_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(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
K_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(data, msgq->msg_size));
|
K_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(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
K_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(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
K_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(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
K_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(K_SYSCALL_OBJ_INIT(mutex, K_OBJ_MUTEX));
|
K_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(K_SYSCALL_OBJ(mutex, K_OBJ_MUTEX));
|
K_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(K_SYSCALL_OBJ(mutex, K_OBJ_MUTEX));
|
K_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(K_SYSCALL_MEMORY_WRITE(stats, sizeof(*stats)));
|
K_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(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
K_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(stats, sizeof(*stats)));
|
K_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(K_SYSCALL_MEMORY_WRITE(hist, sizeof(*hist)));
|
K_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(K_SYSCALL_MEMORY_WRITE(hist, sizeof(*hist)));
|
K_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(K_SYSCALL_MEMORY_WRITE(hist, sizeof(*hist)));
|
K_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(K_SYSCALL_OBJ_NEVER_INIT(pipe, K_OBJ_PIPE));
|
K_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(K_SYSCALL_OBJ(pipe, K_OBJ_PIPE));
|
K_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(K_SYSCALL_OBJ(pipe, K_OBJ_PIPE));
|
K_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(K_SYSCALL_OBJ(pipe, K_OBJ_PIPE));
|
K_OOPS(K_SYSCALL_OBJ(pipe, K_OBJ_PIPE));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(bytes_written, sizeof(*bytes_written)));
|
K_OOPS(K_SYSCALL_MEMORY_WRITE(bytes_written, sizeof(*bytes_written)));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ((void *)data, bytes_to_write));
|
K_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(K_SYSCALL_OBJ(pipe, K_OBJ_PIPE));
|
K_OOPS(K_SYSCALL_OBJ(pipe, K_OBJ_PIPE));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(bytes_read, sizeof(*bytes_read)));
|
K_OOPS(K_SYSCALL_MEMORY_WRITE(bytes_read, sizeof(*bytes_read)));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE((void *)data, bytes_to_read));
|
K_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(K_SYSCALL_OBJ(pipe, K_OBJ_PIPE));
|
K_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(K_SYSCALL_OBJ(pipe, K_OBJ_PIPE));
|
K_OOPS(K_SYSCALL_OBJ(pipe, K_OBJ_PIPE));
|
||||||
|
|
||||||
return z_impl_k_pipe_write_avail(pipe);
|
return z_impl_k_pipe_write_avail(pipe);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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(K_SYSCALL_OBJ(e->signal, K_OBJ_POLL_SIGNAL));
|
K_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(K_SYSCALL_OBJ(e->sem, K_OBJ_SEM));
|
K_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(K_SYSCALL_OBJ(e->queue, K_OBJ_QUEUE));
|
K_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(K_SYSCALL_OBJ(e->msgq, K_OBJ_MSGQ));
|
K_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(K_SYSCALL_OBJ(e->pipe, K_OBJ_PIPE));
|
K_OOPS(K_SYSCALL_OBJ(e->pipe, K_OBJ_PIPE));
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
|
@ -432,7 +432,7 @@ out:
|
||||||
return ret;
|
return ret;
|
||||||
oops_free:
|
oops_free:
|
||||||
k_free(events_copy);
|
k_free(events_copy);
|
||||||
Z_OOPS(1);
|
K_OOPS(1);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_poll_mrsh.c>
|
#include <syscalls/k_poll_mrsh.c>
|
||||||
#endif
|
#endif
|
||||||
|
@ -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(K_SYSCALL_OBJ_INIT(sig, K_OBJ_POLL_SIGNAL));
|
K_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(K_SYSCALL_OBJ(sig, K_OBJ_POLL_SIGNAL));
|
K_OOPS(K_SYSCALL_OBJ(sig, K_OBJ_POLL_SIGNAL));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(signaled, sizeof(unsigned int)));
|
K_OOPS(K_SYSCALL_MEMORY_WRITE(signaled, sizeof(unsigned int)));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(result, sizeof(int)));
|
K_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(K_SYSCALL_OBJ(sig, K_OBJ_POLL_SIGNAL));
|
K_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(K_SYSCALL_OBJ(sig, K_OBJ_POLL_SIGNAL));
|
K_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(K_SYSCALL_OBJ_NEVER_INIT(queue, K_OBJ_QUEUE));
|
K_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(K_SYSCALL_OBJ(queue, K_OBJ_QUEUE));
|
K_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(K_SYSCALL_OBJ(queue, K_OBJ_QUEUE));
|
K_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(K_SYSCALL_OBJ(queue, K_OBJ_QUEUE));
|
K_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(K_SYSCALL_OBJ(queue, K_OBJ_QUEUE));
|
K_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(K_SYSCALL_OBJ(queue, K_OBJ_QUEUE));
|
K_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(K_SYSCALL_OBJ(queue, K_OBJ_QUEUE));
|
K_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(K_SYSCALL_OBJ(queue, K_OBJ_QUEUE));
|
K_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(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
K_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(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
K_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(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
K_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,10 +1358,10 @@ 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(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
K_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(_is_valid_prio(prio, NULL),
|
K_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,
|
K_OOPS(K_SYSCALL_VERIFY_MSG((int8_t)prio >= thread->base.prio,
|
||||||
"thread priority may only be downgraded (%d < %d)",
|
"thread priority may only be downgraded (%d < %d)",
|
||||||
prio, thread->base.prio));
|
prio, thread->base.prio));
|
||||||
|
|
||||||
|
@ -1389,8 +1389,8 @@ 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(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
K_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(deadline > 0,
|
K_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(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
K_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>
|
||||||
|
@ -1890,7 +1890,7 @@ static bool thread_obj_validate(struct k_thread *thread)
|
||||||
#ifdef CONFIG_LOG
|
#ifdef CONFIG_LOG
|
||||||
k_object_dump_error(ret, thread, ko, K_OBJ_THREAD);
|
k_object_dump_error(ret, thread, ko, K_OBJ_THREAD);
|
||||||
#endif
|
#endif
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(ret, "access denied"));
|
K_OOPS(K_SYSCALL_VERIFY_MSG(ret, "access denied"));
|
||||||
}
|
}
|
||||||
CODE_UNREACHABLE; /* LCOV_EXCL_LINE */
|
CODE_UNREACHABLE; /* LCOV_EXCL_LINE */
|
||||||
}
|
}
|
||||||
|
@ -1912,7 +1912,7 @@ static inline void z_vrfy_k_thread_abort(k_tid_t thread)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(!(thread->base.user_options & K_ESSENTIAL),
|
K_OOPS(K_SYSCALL_VERIFY_MSG(!(thread->base.user_options & K_ESSENTIAL),
|
||||||
"aborting essential thread %p", thread));
|
"aborting essential thread %p", thread));
|
||||||
|
|
||||||
z_impl_k_thread_abort((struct k_thread *)thread);
|
z_impl_k_thread_abort((struct k_thread *)thread);
|
||||||
|
|
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(K_SYSCALL_OBJ_INIT(sem, K_OBJ_SEM));
|
K_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(K_SYSCALL_OBJ(sem, K_OBJ_SEM));
|
K_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(K_SYSCALL_OBJ(sem, K_OBJ_SEM));
|
K_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(K_SYSCALL_OBJ(sem, K_OBJ_SEM));
|
K_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(K_SYSCALL_OBJ(sem, K_OBJ_SEM));
|
K_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,8 +64,8 @@ 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(K_SYSCALL_OBJ_NEVER_INIT(stack, K_OBJ_STACK));
|
K_OOPS(K_SYSCALL_OBJ_NEVER_INIT(stack, K_OBJ_STACK));
|
||||||
Z_OOPS(K_SYSCALL_VERIFY(num_entries > 0));
|
K_OOPS(K_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);
|
||||||
}
|
}
|
||||||
#include <syscalls/k_stack_alloc_init_mrsh.c>
|
#include <syscalls/k_stack_alloc_init_mrsh.c>
|
||||||
|
@ -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(K_SYSCALL_OBJ(stack, K_OBJ_STACK));
|
K_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(K_SYSCALL_OBJ(stack, K_OBJ_STACK));
|
K_OOPS(K_SYSCALL_OBJ(stack, K_OBJ_STACK));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(data, sizeof(stack_data_t)));
|
K_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>
|
||||||
|
|
|
@ -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(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
K_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,13 +728,13 @@ 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(K_SYSCALL_OBJ_NEVER_INIT(new_thread, K_OBJ_THREAD));
|
K_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
|
||||||
*/
|
*/
|
||||||
stack_object = k_object_find(stack);
|
stack_object = k_object_find(stack);
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(k_object_validation_check(stack_object, stack,
|
K_OOPS(K_SYSCALL_VERIFY_MSG(k_object_validation_check(stack_object, stack,
|
||||||
K_OBJ_THREAD_STACK_ELEMENT,
|
K_OBJ_THREAD_STACK_ELEMENT,
|
||||||
_OBJ_INIT_FALSE) == 0,
|
_OBJ_INIT_FALSE) == 0,
|
||||||
"bad stack object"));
|
"bad stack object"));
|
||||||
|
@ -742,7 +742,7 @@ k_tid_t z_vrfy_k_thread_create(struct k_thread *new_thread,
|
||||||
/* Verify that the stack size passed in is OK by computing the total
|
/* Verify that the stack size passed in is OK by computing the total
|
||||||
* size and comparing it with the size value in the object metadata
|
* size and comparing it with the size value in the object metadata
|
||||||
*/
|
*/
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(!size_add_overflow(K_THREAD_STACK_RESERVED,
|
K_OOPS(K_SYSCALL_VERIFY_MSG(!size_add_overflow(K_THREAD_STACK_RESERVED,
|
||||||
stack_size, &total_size),
|
stack_size, &total_size),
|
||||||
"stack size overflow (%zu+%zu)",
|
"stack size overflow (%zu+%zu)",
|
||||||
stack_size,
|
stack_size,
|
||||||
|
@ -756,21 +756,21 @@ k_tid_t z_vrfy_k_thread_create(struct k_thread *new_thread,
|
||||||
#else
|
#else
|
||||||
stack_obj_size = stack_object->data.stack_size;
|
stack_obj_size = stack_object->data.stack_size;
|
||||||
#endif
|
#endif
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(total_size <= stack_obj_size,
|
K_OOPS(K_SYSCALL_VERIFY_MSG(total_size <= stack_obj_size,
|
||||||
"stack size %zu is too big, max is %zu",
|
"stack size %zu is too big, max is %zu",
|
||||||
total_size, stack_obj_size));
|
total_size, stack_obj_size));
|
||||||
|
|
||||||
/* User threads may only create other user threads and they can't
|
/* User threads may only create other user threads and they can't
|
||||||
* be marked as essential
|
* be marked as essential
|
||||||
*/
|
*/
|
||||||
Z_OOPS(K_SYSCALL_VERIFY(options & K_USER));
|
K_OOPS(K_SYSCALL_VERIFY(options & K_USER));
|
||||||
Z_OOPS(K_SYSCALL_VERIFY(!(options & K_ESSENTIAL)));
|
K_OOPS(K_SYSCALL_VERIFY(!(options & K_ESSENTIAL)));
|
||||||
|
|
||||||
/* Check validity of prio argument; must be the same or worse priority
|
/* Check validity of prio argument; must be the same or worse priority
|
||||||
* than the caller
|
* than the caller
|
||||||
*/
|
*/
|
||||||
Z_OOPS(K_SYSCALL_VERIFY(_is_valid_prio(prio, NULL)));
|
K_OOPS(K_SYSCALL_VERIFY(_is_valid_prio(prio, NULL)));
|
||||||
Z_OOPS(K_SYSCALL_VERIFY(z_is_prio_lower_or_equal(prio,
|
K_OOPS(K_SYSCALL_VERIFY(z_is_prio_lower_or_equal(prio,
|
||||||
_current->base.prio)));
|
_current->base.prio)));
|
||||||
|
|
||||||
z_setup_new_thread(new_thread, stack, stack_size,
|
z_setup_new_thread(new_thread, stack, stack_size,
|
||||||
|
@ -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(K_SYSCALL_OBJ(thread, K_OBJ_THREAD));
|
K_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>
|
||||||
|
@ -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(K_SYSCALL_OBJ(t, K_OBJ_THREAD));
|
K_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(K_SYSCALL_OBJ(t, K_OBJ_THREAD));
|
K_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(K_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
K_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(K_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
K_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(K_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
K_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(K_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
K_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(K_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
K_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(K_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
K_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(K_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
K_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(K_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
K_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>
|
||||||
|
|
|
@ -58,9 +58,9 @@ static inline void z_vrfy_k_object_access_grant(const void *object,
|
||||||
{
|
{
|
||||||
struct k_object *ko;
|
struct k_object *ko;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_OBJ_INIT(thread, K_OBJ_THREAD));
|
K_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",
|
K_OOPS(K_SYSCALL_VERIFY_MSG(ko != NULL, "object %p access denied",
|
||||||
object));
|
object));
|
||||||
k_thread_perms_set(ko, thread);
|
k_thread_perms_set(ko, thread);
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ static inline void z_vrfy_k_object_release(const void *object)
|
||||||
struct k_object *ko;
|
struct k_object *ko;
|
||||||
|
|
||||||
ko = validate_any_object((void *)object);
|
ko = validate_any_object((void *)object);
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(ko != NULL, "object %p access denied",
|
K_OOPS(K_SYSCALL_VERIFY_MSG(ko != NULL, "object %p access denied",
|
||||||
(void *)object));
|
(void *)object));
|
||||||
k_thread_perms_clear(ko, _current);
|
k_thread_perms_clear(ko, _current);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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(K_SYSCALL_MEMORY_READ(buf, nbytes));
|
K_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>
|
||||||
|
|
|
@ -101,7 +101,7 @@ static inline size_t z_vrfy_zephyr_fwrite(const void *ZRESTRICT ptr,
|
||||||
FILE *ZRESTRICT stream)
|
FILE *ZRESTRICT stream)
|
||||||
{
|
{
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(ptr, nitems, size));
|
K_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(ptr, nitems, size));
|
||||||
return z_impl_zephyr_fwrite((const void *ZRESTRICT)ptr, size,
|
return z_impl_zephyr_fwrite((const void *ZRESTRICT)ptr, size,
|
||||||
nitems, (FILE *ZRESTRICT)stream);
|
nitems, (FILE *ZRESTRICT)stream);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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(K_SYSCALL_MEMORY_WRITE(buf, nbytes));
|
K_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(K_SYSCALL_MEMORY_READ(buf, nbytes));
|
K_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>
|
||||||
|
|
|
@ -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(K_SYSCALL_MEMORY_READ(c, n));
|
K_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(K_SYSCALL_MEMORY_WRITE(ts, sizeof(*ts)));
|
K_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>
|
||||||
|
|
|
@ -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(K_SYSCALL_MEMORY_READ(more, "
|
mrsh += ("\tK_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(K_SYSCALL_MEMORY_WRITE(%s, 8));\n" % ptr
|
mrsh += "\t" + "K_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"
|
||||||
|
|
|
@ -449,13 +449,13 @@ uint32_t z_vrfy_log_filter_set(struct log_backend const *const backend,
|
||||||
int16_t src_id,
|
int16_t src_id,
|
||||||
uint32_t level)
|
uint32_t level)
|
||||||
{
|
{
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(backend == NULL,
|
K_OOPS(K_SYSCALL_VERIFY_MSG(backend == NULL,
|
||||||
"Setting per-backend filters from user mode is not supported"));
|
"Setting per-backend filters from user mode is not supported"));
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(domain_id == Z_LOG_LOCAL_DOMAIN_ID,
|
K_OOPS(K_SYSCALL_VERIFY_MSG(domain_id == Z_LOG_LOCAL_DOMAIN_ID,
|
||||||
"Invalid log domain_id"));
|
"Invalid log domain_id"));
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(src_id < (int16_t)log_src_cnt_get(domain_id),
|
K_OOPS(K_SYSCALL_VERIFY_MSG(src_id < (int16_t)log_src_cnt_get(domain_id),
|
||||||
"Invalid log source id"));
|
"Invalid log source id"));
|
||||||
Z_OOPS(K_SYSCALL_VERIFY_MSG(
|
K_OOPS(K_SYSCALL_VERIFY_MSG(
|
||||||
(level <= LOG_LEVEL_DBG),
|
(level <= LOG_LEVEL_DBG),
|
||||||
"Invalid log level"));
|
"Invalid log level"));
|
||||||
|
|
||||||
|
|
|
@ -1589,7 +1589,7 @@ static inline int z_vrfy_net_if_ipv6_addr_lookup_by_index(
|
||||||
{
|
{
|
||||||
struct in6_addr addr_v6;
|
struct in6_addr addr_v6;
|
||||||
|
|
||||||
Z_OOPS(k_usermode_from_copy(&addr_v6, (void *)addr, sizeof(addr_v6)));
|
K_OOPS(k_usermode_from_copy(&addr_v6, (void *)addr, sizeof(addr_v6)));
|
||||||
|
|
||||||
return z_impl_net_if_ipv6_addr_lookup_by_index(&addr_v6);
|
return z_impl_net_if_ipv6_addr_lookup_by_index(&addr_v6);
|
||||||
}
|
}
|
||||||
|
@ -1929,7 +1929,7 @@ bool z_vrfy_net_if_ipv6_addr_add_by_index(int index,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_OOPS(k_usermode_from_copy(&addr_v6, (void *)addr, sizeof(addr_v6)));
|
K_OOPS(k_usermode_from_copy(&addr_v6, (void *)addr, sizeof(addr_v6)));
|
||||||
|
|
||||||
return z_impl_net_if_ipv6_addr_add_by_index(index,
|
return z_impl_net_if_ipv6_addr_add_by_index(index,
|
||||||
&addr_v6,
|
&addr_v6,
|
||||||
|
@ -1965,7 +1965,7 @@ bool z_vrfy_net_if_ipv6_addr_rm_by_index(int index,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_OOPS(k_usermode_from_copy(&addr_v6, (void *)addr, sizeof(addr_v6)));
|
K_OOPS(k_usermode_from_copy(&addr_v6, (void *)addr, sizeof(addr_v6)));
|
||||||
|
|
||||||
return z_impl_net_if_ipv6_addr_rm_by_index(index, &addr_v6);
|
return z_impl_net_if_ipv6_addr_rm_by_index(index, &addr_v6);
|
||||||
}
|
}
|
||||||
|
@ -3526,7 +3526,7 @@ static inline int z_vrfy_net_if_ipv4_addr_lookup_by_index(
|
||||||
{
|
{
|
||||||
struct in_addr addr_v4;
|
struct in_addr addr_v4;
|
||||||
|
|
||||||
Z_OOPS(k_usermode_from_copy(&addr_v4, (void *)addr, sizeof(addr_v4)));
|
K_OOPS(k_usermode_from_copy(&addr_v4, (void *)addr, sizeof(addr_v4)));
|
||||||
|
|
||||||
return z_impl_net_if_ipv4_addr_lookup_by_index(&addr_v4);
|
return z_impl_net_if_ipv4_addr_lookup_by_index(&addr_v4);
|
||||||
}
|
}
|
||||||
|
@ -3578,7 +3578,7 @@ bool z_vrfy_net_if_ipv4_set_netmask_by_index(int index,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_OOPS(k_usermode_from_copy(&netmask_addr, (void *)netmask,
|
K_OOPS(k_usermode_from_copy(&netmask_addr, (void *)netmask,
|
||||||
sizeof(netmask_addr)));
|
sizeof(netmask_addr)));
|
||||||
|
|
||||||
return z_impl_net_if_ipv4_set_netmask_by_index(index, &netmask_addr);
|
return z_impl_net_if_ipv4_set_netmask_by_index(index, &netmask_addr);
|
||||||
|
@ -3631,7 +3631,7 @@ bool z_vrfy_net_if_ipv4_set_gw_by_index(int index,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_OOPS(k_usermode_from_copy(&gw_addr, (void *)gw, sizeof(gw_addr)));
|
K_OOPS(k_usermode_from_copy(&gw_addr, (void *)gw, sizeof(gw_addr)));
|
||||||
|
|
||||||
return z_impl_net_if_ipv4_set_gw_by_index(index, &gw_addr);
|
return z_impl_net_if_ipv4_set_gw_by_index(index, &gw_addr);
|
||||||
}
|
}
|
||||||
|
@ -3805,7 +3805,7 @@ bool z_vrfy_net_if_ipv4_addr_add_by_index(int index,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_OOPS(k_usermode_from_copy(&addr_v4, (void *)addr, sizeof(addr_v4)));
|
K_OOPS(k_usermode_from_copy(&addr_v4, (void *)addr, sizeof(addr_v4)));
|
||||||
|
|
||||||
return z_impl_net_if_ipv4_addr_add_by_index(index,
|
return z_impl_net_if_ipv4_addr_add_by_index(index,
|
||||||
&addr_v4,
|
&addr_v4,
|
||||||
|
@ -3841,7 +3841,7 @@ bool z_vrfy_net_if_ipv4_addr_rm_by_index(int index,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_OOPS(k_usermode_from_copy(&addr_v4, (void *)addr, sizeof(addr_v4)));
|
K_OOPS(k_usermode_from_copy(&addr_v4, (void *)addr, sizeof(addr_v4)));
|
||||||
|
|
||||||
return (uint32_t)z_impl_net_if_ipv4_addr_rm_by_index(index, &addr_v4);
|
return (uint32_t)z_impl_net_if_ipv4_addr_rm_by_index(index, &addr_v4);
|
||||||
}
|
}
|
||||||
|
|
|
@ -304,14 +304,14 @@ 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(K_SYSCALL_MEMORY_WRITE(dst, size));
|
K_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,
|
K_OOPS(k_usermode_from_copy(&addr4, (const void *)src,
|
||||||
sizeof(addr4)));
|
sizeof(addr4)));
|
||||||
addr = &addr4;
|
addr = &addr4;
|
||||||
} else if (family == AF_INET6) {
|
} else if (family == AF_INET6) {
|
||||||
Z_OOPS(k_usermode_from_copy(&addr6, (const void *)src,
|
K_OOPS(k_usermode_from_copy(&addr6, (const void *)src,
|
||||||
sizeof(addr6)));
|
sizeof(addr6)));
|
||||||
addr = &addr6;
|
addr = &addr6;
|
||||||
} else {
|
} else {
|
||||||
|
@ -323,7 +323,7 @@ char *z_vrfy_net_addr_ntop(sa_family_t family, const void *src,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_OOPS(k_usermode_to_copy((void *)dst, str, MIN(size, sizeof(str))));
|
K_OOPS(k_usermode_to_copy((void *)dst, str, MIN(size, sizeof(str))));
|
||||||
|
|
||||||
return dst;
|
return dst;
|
||||||
}
|
}
|
||||||
|
@ -488,14 +488,14 @@ int z_vrfy_net_addr_pton(sa_family_t family, const char *src,
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(dst, size));
|
K_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) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_OOPS(k_usermode_to_copy((void *)dst, addr, size));
|
K_OOPS(k_usermode_to_copy((void *)dst, addr, size));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -281,10 +281,10 @@ static inline int z_vrfy_z_zsock_getaddrinfo_internal(const char *host,
|
||||||
uint32_t ret;
|
uint32_t ret;
|
||||||
|
|
||||||
if (hints) {
|
if (hints) {
|
||||||
Z_OOPS(k_usermode_from_copy(&hints_copy, (void *)hints,
|
K_OOPS(k_usermode_from_copy(&hints_copy, (void *)hints,
|
||||||
sizeof(hints_copy)));
|
sizeof(hints_copy)));
|
||||||
}
|
}
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_ARRAY_WRITE(res, AI_ARR_MAX, sizeof(struct zsock_addrinfo)));
|
K_OOPS(K_SYSCALL_MEMORY_ARRAY_WRITE(res, AI_ARR_MAX, sizeof(struct zsock_addrinfo)));
|
||||||
|
|
||||||
if (service) {
|
if (service) {
|
||||||
service_copy = k_usermode_string_alloc_copy((char *)service, 64);
|
service_copy = k_usermode_string_alloc_copy((char *)service, 64);
|
||||||
|
|
|
@ -350,7 +350,7 @@ int z_vrfy_zsock_socketpair(int family, int type, int proto, int *sv)
|
||||||
|
|
||||||
ret = z_impl_zsock_socketpair(family, type, proto, tmp);
|
ret = z_impl_zsock_socketpair(family, type, proto, tmp);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
Z_OOPS(k_usermode_to_copy(sv, tmp, sizeof(tmp)));
|
K_OOPS(k_usermode_to_copy(sv, tmp, sizeof(tmp)));
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
|
|
@ -482,8 +482,8 @@ static inline int z_vrfy_zsock_bind(int sock, const struct sockaddr *addr,
|
||||||
{
|
{
|
||||||
struct sockaddr_storage dest_addr_copy;
|
struct sockaddr_storage dest_addr_copy;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_VERIFY(addrlen <= sizeof(dest_addr_copy)));
|
K_OOPS(K_SYSCALL_VERIFY(addrlen <= sizeof(dest_addr_copy)));
|
||||||
Z_OOPS(k_usermode_from_copy(&dest_addr_copy, (void *)addr, addrlen));
|
K_OOPS(k_usermode_from_copy(&dest_addr_copy, (void *)addr, addrlen));
|
||||||
|
|
||||||
return z_impl_zsock_bind(sock, (struct sockaddr *)&dest_addr_copy,
|
return z_impl_zsock_bind(sock, (struct sockaddr *)&dest_addr_copy,
|
||||||
addrlen);
|
addrlen);
|
||||||
|
@ -561,8 +561,8 @@ int z_vrfy_zsock_connect(int sock, const struct sockaddr *addr,
|
||||||
{
|
{
|
||||||
struct sockaddr_storage dest_addr_copy;
|
struct sockaddr_storage dest_addr_copy;
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_VERIFY(addrlen <= sizeof(dest_addr_copy)));
|
K_OOPS(K_SYSCALL_VERIFY(addrlen <= sizeof(dest_addr_copy)));
|
||||||
Z_OOPS(k_usermode_from_copy(&dest_addr_copy, (void *)addr, addrlen));
|
K_OOPS(k_usermode_from_copy(&dest_addr_copy, (void *)addr, addrlen));
|
||||||
|
|
||||||
return z_impl_zsock_connect(sock, (struct sockaddr *)&dest_addr_copy,
|
return z_impl_zsock_connect(sock, (struct sockaddr *)&dest_addr_copy,
|
||||||
addrlen);
|
addrlen);
|
||||||
|
@ -693,14 +693,14 @@ static inline int z_vrfy_zsock_accept(int sock, struct sockaddr *addr,
|
||||||
socklen_t addrlen_copy;
|
socklen_t addrlen_copy;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
Z_OOPS(addrlen && k_usermode_from_copy(&addrlen_copy, addrlen,
|
K_OOPS(addrlen && k_usermode_from_copy(&addrlen_copy, addrlen,
|
||||||
sizeof(socklen_t)));
|
sizeof(socklen_t)));
|
||||||
Z_OOPS(addr && K_SYSCALL_MEMORY_WRITE(addr, addrlen ? addrlen_copy : 0));
|
K_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);
|
||||||
|
|
||||||
Z_OOPS(ret >= 0 && addrlen && k_usermode_to_copy(addrlen, &addrlen_copy,
|
K_OOPS(ret >= 0 && addrlen && k_usermode_to_copy(addrlen, &addrlen_copy,
|
||||||
sizeof(socklen_t)));
|
sizeof(socklen_t)));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -862,10 +862,10 @@ 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(K_SYSCALL_MEMORY_READ(buf, len));
|
K_OOPS(K_SYSCALL_MEMORY_READ(buf, len));
|
||||||
if (dest_addr) {
|
if (dest_addr) {
|
||||||
Z_OOPS(K_SYSCALL_VERIFY(addrlen <= sizeof(dest_addr_copy)));
|
K_OOPS(K_SYSCALL_VERIFY(addrlen <= sizeof(dest_addr_copy)));
|
||||||
Z_OOPS(k_usermode_from_copy(&dest_addr_copy, (void *)dest_addr,
|
K_OOPS(k_usermode_from_copy(&dest_addr_copy, (void *)dest_addr,
|
||||||
addrlen));
|
addrlen));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -950,7 +950,7 @@ static inline ssize_t z_vrfy_zsock_sendmsg(int sock,
|
||||||
size_t i;
|
size_t i;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
Z_OOPS(k_usermode_from_copy(&msg_copy, (void *)msg, sizeof(msg_copy)));
|
K_OOPS(k_usermode_from_copy(&msg_copy, (void *)msg, sizeof(msg_copy)));
|
||||||
|
|
||||||
msg_copy.msg_name = NULL;
|
msg_copy.msg_name = NULL;
|
||||||
msg_copy.msg_control = NULL;
|
msg_copy.msg_control = NULL;
|
||||||
|
@ -1520,17 +1520,17 @@ ssize_t z_vrfy_zsock_recvfrom(int sock, void *buf, size_t max_len, int flags,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (addrlen) {
|
if (addrlen) {
|
||||||
Z_OOPS(k_usermode_from_copy(&addrlen_copy, addrlen,
|
K_OOPS(k_usermode_from_copy(&addrlen_copy, addrlen,
|
||||||
sizeof(socklen_t)));
|
sizeof(socklen_t)));
|
||||||
}
|
}
|
||||||
Z_OOPS(src_addr && K_SYSCALL_MEMORY_WRITE(src_addr, addrlen_copy));
|
K_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,
|
||||||
addrlen ? &addrlen_copy : NULL);
|
addrlen ? &addrlen_copy : NULL);
|
||||||
|
|
||||||
if (addrlen) {
|
if (addrlen) {
|
||||||
Z_OOPS(k_usermode_to_copy(addrlen, &addrlen_copy,
|
K_OOPS(k_usermode_to_copy(addrlen, &addrlen_copy,
|
||||||
sizeof(socklen_t)));
|
sizeof(socklen_t)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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(K_SYSCALL_MEMORY_WRITE(avail, sizeof(*avail)));
|
K_OOPS(K_SYSCALL_MEMORY_WRITE(avail, sizeof(*avail)));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1954,9 +1954,9 @@ static inline int z_vrfy_zsock_inet_pton(sa_family_t family,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_OOPS(k_usermode_string_copy(src_copy, (char *)src, sizeof(src_copy)));
|
K_OOPS(k_usermode_string_copy(src_copy, (char *)src, sizeof(src_copy)));
|
||||||
ret = z_impl_zsock_inet_pton(family, src_copy, dst_copy);
|
ret = z_impl_zsock_inet_pton(family, src_copy, dst_copy);
|
||||||
Z_OOPS(k_usermode_to_copy(dst, dst_copy, dst_size));
|
K_OOPS(k_usermode_to_copy(dst, dst_copy, dst_size));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -2175,13 +2175,13 @@ int z_vrfy_zsock_getsockopt(int sock, int level, int optname,
|
||||||
|
|
||||||
kernel_optval = k_usermode_alloc_from_copy((const void *)optval,
|
kernel_optval = k_usermode_alloc_from_copy((const void *)optval,
|
||||||
kernel_optlen);
|
kernel_optlen);
|
||||||
Z_OOPS(!kernel_optval);
|
K_OOPS(!kernel_optval);
|
||||||
|
|
||||||
ret = z_impl_zsock_getsockopt(sock, level, optname,
|
ret = z_impl_zsock_getsockopt(sock, level, optname,
|
||||||
kernel_optval, &kernel_optlen);
|
kernel_optval, &kernel_optlen);
|
||||||
|
|
||||||
Z_OOPS(k_usermode_to_copy((void *)optval, kernel_optval, kernel_optlen));
|
K_OOPS(k_usermode_to_copy((void *)optval, kernel_optval, kernel_optlen));
|
||||||
Z_OOPS(k_usermode_to_copy((void *)optlen, &kernel_optlen,
|
K_OOPS(k_usermode_to_copy((void *)optlen, &kernel_optlen,
|
||||||
sizeof(socklen_t)));
|
sizeof(socklen_t)));
|
||||||
|
|
||||||
k_free(kernel_optval);
|
k_free(kernel_optval);
|
||||||
|
@ -2518,7 +2518,7 @@ int z_vrfy_zsock_setsockopt(int sock, int level, int optname,
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
kernel_optval = k_usermode_alloc_from_copy((const void *)optval, optlen);
|
kernel_optval = k_usermode_alloc_from_copy((const void *)optval, optlen);
|
||||||
Z_OOPS(!kernel_optval);
|
K_OOPS(!kernel_optval);
|
||||||
|
|
||||||
ret = z_impl_zsock_setsockopt(sock, level, optname,
|
ret = z_impl_zsock_setsockopt(sock, level, optname,
|
||||||
kernel_optval, optlen);
|
kernel_optval, optlen);
|
||||||
|
@ -2591,7 +2591,7 @@ static inline int z_vrfy_zsock_getpeername(int sock, struct sockaddr *addr,
|
||||||
socklen_t addrlen_copy;
|
socklen_t addrlen_copy;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
Z_OOPS(k_usermode_from_copy(&addrlen_copy, (void *)addrlen,
|
K_OOPS(k_usermode_from_copy(&addrlen_copy, (void *)addrlen,
|
||||||
sizeof(socklen_t)));
|
sizeof(socklen_t)));
|
||||||
|
|
||||||
if (K_SYSCALL_MEMORY_WRITE(addr, addrlen_copy)) {
|
if (K_SYSCALL_MEMORY_WRITE(addr, addrlen_copy)) {
|
||||||
|
@ -2670,7 +2670,7 @@ static inline int z_vrfy_zsock_getsockname(int sock, struct sockaddr *addr,
|
||||||
socklen_t addrlen_copy;
|
socklen_t addrlen_copy;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
Z_OOPS(k_usermode_from_copy(&addrlen_copy, (void *)addrlen,
|
K_OOPS(k_usermode_from_copy(&addrlen_copy, (void *)addrlen,
|
||||||
sizeof(socklen_t)));
|
sizeof(socklen_t)));
|
||||||
|
|
||||||
if (K_SYSCALL_MEMORY_WRITE(addr, addrlen_copy)) {
|
if (K_SYSCALL_MEMORY_WRITE(addr, addrlen_copy)) {
|
||||||
|
|
|
@ -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(K_SYSCALL_MEMORY_WRITE(buf, len));
|
K_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(K_SYSCALL_MEMORY_WRITE(dst, len));
|
K_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(K_SYSCALL_MEMORY_WRITE(dst, len));
|
K_OOPS(K_SYSCALL_MEMORY_WRITE(dst, len));
|
||||||
|
|
||||||
return z_impl_sys_csrand_get(dst, len);
|
return z_impl_sys_csrand_get(dst, len);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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(K_SYSCALL_OBJ(r, K_OBJ_RTIO));
|
K_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(K_SYSCALL_OBJ(r, K_OBJ_RTIO));
|
K_OOPS(K_SYSCALL_OBJ(r, K_OBJ_RTIO));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(cqe, sizeof(struct rtio_cqe)));
|
K_OOPS(K_SYSCALL_MEMORY_READ(cqe, sizeof(struct rtio_cqe)));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(buff, sizeof(void *)));
|
K_OOPS(K_SYSCALL_MEMORY_READ(buff, sizeof(void *)));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_READ(buff_len, sizeof(uint32_t)));
|
K_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,9 +79,9 @@ 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(K_SYSCALL_OBJ(r, K_OBJ_RTIO));
|
K_OOPS(K_SYSCALL_OBJ(r, K_OBJ_RTIO));
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(sqes, sqe_count, sizeof(struct rtio_sqe)));
|
K_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(sqes, sqe_count, sizeof(struct rtio_sqe)));
|
||||||
struct rtio_sqe *sqe;
|
struct rtio_sqe *sqe;
|
||||||
uint32_t acquirable = rtio_sqe_acquirable(r);
|
uint32_t acquirable = rtio_sqe_acquirable(r);
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ static inline int z_vrfy_rtio_sqe_copy_in_get_handles(struct rtio *r, const stru
|
||||||
|
|
||||||
if (!rtio_vrfy_sqe(sqe)) {
|
if (!rtio_vrfy_sqe(sqe)) {
|
||||||
rtio_sqe_drop_all(r);
|
rtio_sqe_drop_all(r);
|
||||||
Z_OOPS(true);
|
K_OOPS(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,9 +114,9 @@ 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(K_SYSCALL_OBJ(r, K_OBJ_RTIO));
|
K_OOPS(K_SYSCALL_OBJ(r, K_OBJ_RTIO));
|
||||||
|
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_ARRAY_WRITE(cqes, cqe_count, sizeof(struct rtio_cqe)));
|
K_OOPS(K_SYSCALL_MEMORY_ARRAY_WRITE(cqes, cqe_count, sizeof(struct rtio_cqe)));
|
||||||
|
|
||||||
return z_impl_rtio_cqe_copy_out(r, cqes, cqe_count, timeout);
|
return z_impl_rtio_cqe_copy_out(r, cqes, cqe_count, timeout);
|
||||||
}
|
}
|
||||||
|
@ -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(K_SYSCALL_OBJ(r, K_OBJ_RTIO));
|
K_OOPS(K_SYSCALL_OBJ(r, K_OBJ_RTIO));
|
||||||
|
|
||||||
#ifdef CONFIG_RTIO_SUBMIT_SEM
|
#ifdef CONFIG_RTIO_SUBMIT_SEM
|
||||||
Z_OOPS(K_SYSCALL_OBJ(r->submit_sem, K_OBJ_SEM));
|
K_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);
|
||||||
|
|
|
@ -59,7 +59,7 @@ static inline size_t z_vrfy_string_nlen(char *src, size_t maxlen, int *err)
|
||||||
err_copy = -1;
|
err_copy = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_OOPS(k_usermode_to_copy((int *)err, &err_copy, sizeof(err_copy)));
|
K_OOPS(k_usermode_to_copy((int *)err, &err_copy, sizeof(err_copy)));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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(K_SYSCALL_MEMORY_WRITE(start_addr, sizeof(uintptr_t)));
|
K_OOPS(K_SYSCALL_MEMORY_WRITE(start_addr, sizeof(uintptr_t)));
|
||||||
Z_OOPS(K_SYSCALL_MEMORY_WRITE(size, sizeof(size_t)));
|
K_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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ test_catch_assert_in_isr
|
||||||
|
|
||||||
test_catch_z_oops
|
test_catch_z_oops
|
||||||
- Pass illegal address by syscall, then inside the syscall handler, the
|
- Pass illegal address by syscall, then inside the syscall handler, the
|
||||||
Z_OOPS macro will trigger a fatal error that will get caught (as expected).
|
K_OOPS macro will trigger a fatal error that will get caught (as expected).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ enum {
|
||||||
ZTEST_CATCH_FATAL_IN_ISR,
|
ZTEST_CATCH_FATAL_IN_ISR,
|
||||||
ZTEST_CATCH_ASSERT_FAIL,
|
ZTEST_CATCH_ASSERT_FAIL,
|
||||||
ZTEST_CATCH_ASSERT_IN_ISR,
|
ZTEST_CATCH_ASSERT_IN_ISR,
|
||||||
ZTEST_CATCH_USER_FATAL_Z_OOPS,
|
ZTEST_CATCH_USER_FATAL_K_OOPS,
|
||||||
ZTEST_ERROR_MAX
|
ZTEST_ERROR_MAX
|
||||||
} error_case_type;
|
} error_case_type;
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ void ztest_post_fatal_error_hook(unsigned int reason,
|
||||||
case ZTEST_CATCH_FATAL_DIVIDE_ZERO:
|
case ZTEST_CATCH_FATAL_DIVIDE_ZERO:
|
||||||
case ZTEST_CATCH_FATAL_K_PANIC:
|
case ZTEST_CATCH_FATAL_K_PANIC:
|
||||||
case ZTEST_CATCH_FATAL_K_OOPS:
|
case ZTEST_CATCH_FATAL_K_OOPS:
|
||||||
case ZTEST_CATCH_USER_FATAL_Z_OOPS:
|
case ZTEST_CATCH_USER_FATAL_K_OOPS:
|
||||||
zassert_true(true);
|
zassert_true(true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -338,7 +338,7 @@ static void trigger_z_oops(void)
|
||||||
/* Set up a dummy syscall frame, pointing to a valid area in memory. */
|
/* Set up a dummy syscall frame, pointing to a valid area in memory. */
|
||||||
_current->syscall_frame = _image_ram_start;
|
_current->syscall_frame = _image_ram_start;
|
||||||
|
|
||||||
Z_OOPS(true);
|
K_OOPS(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -351,7 +351,7 @@ static void trigger_z_oops(void)
|
||||||
*/
|
*/
|
||||||
ZTEST(error_hook_tests, test_catch_z_oops)
|
ZTEST(error_hook_tests, test_catch_z_oops)
|
||||||
{
|
{
|
||||||
case_type = ZTEST_CATCH_USER_FATAL_Z_OOPS;
|
case_type = ZTEST_CATCH_USER_FATAL_K_OOPS;
|
||||||
|
|
||||||
ztest_set_fault_valid(true);
|
ztest_set_fault_valid(true);
|
||||||
trigger_z_oops();
|
trigger_z_oops();
|
||||||
|
|
Loading…
Reference in a new issue