From a08bfeb49cc6f030fdd731d9254ac073e18cfee5 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Wed, 27 Sep 2023 11:20:28 +0000 Subject: [PATCH] syscall: rename Z_OOPS -> K_OOPS Rename internal API to not use z_/Z_. Signed-off-by: Anas Nashif --- doc/kernel/drivers/index.rst | 2 +- doc/kernel/usermode/syscalls.rst | 44 +++++------ drivers/adc/adc_handlers.c | 18 ++--- drivers/auxdisplay/auxdisplay_handlers.c | 38 +++++----- drivers/bbram/bbram_handlers.c | 18 ++--- drivers/cache/cache_handlers.c | 6 +- drivers/can/can_handlers.c | 74 +++++++++---------- drivers/charger/charger_handlers.c | 8 +- drivers/counter/counter_handlers.c | 42 +++++------ drivers/counter/maxim_ds3231.c | 10 +-- drivers/dac/dac_handlers.c | 6 +- drivers/dma/dma_handlers.c | 4 +- drivers/eeprom/eeprom_handlers.c | 10 +-- drivers/entropy/entropy_handlers.c | 4 +- drivers/espi/espi_handlers.c | 68 ++++++++--------- drivers/flash/flash_handlers.c | 34 ++++----- drivers/flash/flash_npcx_fiu_nor.c | 8 +- drivers/flash/flash_simulator.c | 2 +- drivers/flash/flash_stm32_ex_op.c | 8 +- drivers/flash/nrf_qspi_nor.c | 2 +- .../fuel_gauge/fuel_gauge_syscall_handlers.c | 30 ++++---- drivers/gpio/gpio_handlers.c | 28 +++---- drivers/hwinfo/hwinfo_handlers.c | 6 +- drivers/hwspinlock/hwspinlock_handlers.c | 8 +- drivers/i2c/i2c_handlers.c | 20 ++--- drivers/i2s/i2s_handlers.c | 14 ++-- drivers/i3c/i3c_handlers.c | 24 +++--- drivers/ipm/ipm_handlers.c | 10 +-- drivers/kscan/kscan_handlers.c | 8 +- drivers/led/led_handlers.c | 22 +++--- drivers/mbox/mbox_handlers.c | 16 ++-- .../timeaware_gpio/timeaware_gpio_handlers.c | 16 ++-- drivers/peci/peci_handlers.c | 10 +-- drivers/ps2/ps2_handlers.c | 14 ++-- drivers/ptp_clock/ptp_clock.c | 4 +- drivers/pwm/pwm_handlers.c | 20 ++--- drivers/retained_mem/retained_mem_handlers.c | 12 +-- drivers/rtc/rtc_handlers.c | 30 ++++---- drivers/sensor/sensor_handlers.c | 26 +++---- drivers/serial/uart_handlers.c | 48 ++++++------ drivers/smbus/smbus_handlers.c | 52 ++++++------- drivers/spi/spi_handlers.c | 22 +++--- drivers/usb/bc12/bc12_handlers.c | 6 +- .../virtualization/virt_ivshmem_handlers.c | 32 ++++---- drivers/w1/w1_handlers.c | 28 +++---- drivers/watchdog/wdt_handlers.c | 6 +- include/zephyr/internal/syscall_handler.h | 2 +- kernel/atomic_c.c | 10 +-- kernel/condvar.c | 10 +-- kernel/device.c | 2 +- kernel/events.c | 14 ++-- kernel/msg_q.c | 28 +++---- kernel/mutex.c | 6 +- kernel/paging/statistics.c | 12 +-- kernel/pipes.c | 22 +++--- kernel/poll.c | 24 +++--- kernel/queue.c | 16 ++-- kernel/sched.c | 22 +++--- kernel/sem.c | 10 +-- kernel/stack.c | 10 +-- kernel/thread.c | 24 +++--- kernel/timer.c | 16 ++-- kernel/userspace_handler.c | 6 +- lib/libc/arcmwdt/libc-hooks.c | 2 +- .../minimal/source/stdout/stdout_console.c | 2 +- lib/libc/newlib/libc-hooks.c | 4 +- lib/os/printk.c | 2 +- lib/posix/clock.c | 2 +- scripts/build/gen_syscalls.py | 4 +- subsys/logging/log_mgmt.c | 8 +- subsys/net/ip/net_if.c | 16 ++-- subsys/net/ip/utils.c | 12 +-- subsys/net/lib/sockets/getaddrinfo.c | 4 +- subsys/net/lib/sockets/socketpair.c | 2 +- subsys/net/lib/sockets/sockets.c | 46 ++++++------ subsys/net/lib/sockets/sockets_misc.c | 2 +- subsys/random/rand32_handlers.c | 4 +- subsys/rtio/rtio_handlers.c | 24 +++--- tests/kernel/mem_protect/syscalls/src/main.c | 2 +- tests/kernel/threads/thread_stack/src/main.c | 4 +- tests/ztest/error_hook/README.txt | 2 +- tests/ztest/error_hook/src/main.c | 8 +- 82 files changed, 651 insertions(+), 651 deletions(-) diff --git a/doc/kernel/drivers/index.rst b/doc/kernel/drivers/index.rst index 63500f1d5a0..3d3c1715b9f 100644 --- a/doc/kernel/drivers/index.rst +++ b/doc/kernel/drivers/index.rst @@ -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) { - 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) } diff --git a/doc/kernel/usermode/syscalls.rst b/doc/kernel/usermode/syscalls.rst index 60f0b481030..f751697d9a3 100644 --- a/doc/kernel/usermode/syscalls.rst +++ b/doc/kernel/usermode/syscalls.rst @@ -331,7 +331,7 @@ Several macros exist to validate arguments: API structure. 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 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) { - 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); } #include @@ -397,7 +397,7 @@ for some integral value: int ret; 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; } @@ -411,7 +411,7 @@ It might be tempting to do something more concise: 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); } @@ -433,9 +433,9 @@ bytes processed. This too should use a stack copy: size_t size; 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); - Z_OOPS(k_usermode_to_copy(size_ptr, &size, sizeof(size))); + K_OOPS(k_usermode_to_copy(size_ptr, &size, sizeof(size))); 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_left_copy; - Z_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(&foo_copy, foo, sizeof(*foo))); + K_OOPS(k_usermode_from_copy(&bar_right_copy, foo_copy.bar_right, sizeof(struct bar))); 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))); 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 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 -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. .. code-block:: c @@ -500,7 +500,7 @@ should never be used to verify if resource allocation has been successful. size_t bar_list_bytes; /* 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 */ 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) { 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)); 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) { - 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); } @@ -558,16 +558,16 @@ Verification Return Value Policies 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 -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: #. For system calls that are defined but not compiled, invocations of these 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, :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 overflowed. @@ -576,7 +576,7 @@ conventions are as follows: manually using :c:func:`k_object_validate()`. These can fail for a variety of reasons: missing driver API, bad kernel object pointer, wrong kernel 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 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 exposed as system calls. Some driver subsystem APIs may take optional 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. #. 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 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. 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. -* 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. 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_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_WRITE()` * :c:macro:`K_SYSCALL_MEMORY_ARRAY_READ()` diff --git a/drivers/adc/adc_handlers.c b/drivers/adc/adc_handlers.c index 156415f1e5f..2b00c2d95a9 100644 --- a/drivers/adc/adc_handlers.c +++ b/drivers/adc/adc_handlers.c @@ -13,8 +13,8 @@ static inline int z_vrfy_adc_channel_setup(const struct device *dev, { struct adc_channel_cfg channel_cfg; - Z_OOPS(K_SYSCALL_DRIVER_ADC(dev, channel_setup)); - Z_OOPS(k_usermode_from_copy(&channel_cfg, + K_OOPS(K_SYSCALL_DRIVER_ADC(dev, channel_setup)); + K_OOPS(k_usermode_from_copy(&channel_cfg, (struct adc_channel_cfg *)user_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_options options; - Z_OOPS(K_SYSCALL_DRIVER_ADC(dev, read)); - Z_OOPS(K_SYSCALL_VERIFY_MSG(copy_sequence(&sequence, &options, + K_OOPS(K_SYSCALL_DRIVER_ADC(dev, read)); + K_OOPS(K_SYSCALL_VERIFY_MSG(copy_sequence(&sequence, &options, (struct adc_sequence *)user_sequence), "invalid ADC sequence")); 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")); } @@ -76,15 +76,15 @@ static inline int z_vrfy_adc_read_async(const struct device *dev, struct adc_sequence sequence; struct adc_sequence_options options; - Z_OOPS(K_SYSCALL_DRIVER_ADC(dev, read_async)); - Z_OOPS(K_SYSCALL_VERIFY_MSG(copy_sequence(&sequence, &options, + K_OOPS(K_SYSCALL_DRIVER_ADC(dev, read_async)); + K_OOPS(K_SYSCALL_VERIFY_MSG(copy_sequence(&sequence, &options, (struct adc_sequence *)user_sequence), "invalid ADC sequence")); 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")); } - 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, (struct k_poll_signal *)async); diff --git a/drivers/auxdisplay/auxdisplay_handlers.c b/drivers/auxdisplay/auxdisplay_handlers.c index a7ea694a65a..5c88e7afa09 100644 --- a/drivers/auxdisplay/auxdisplay_handlers.c +++ b/drivers/auxdisplay/auxdisplay_handlers.c @@ -9,21 +9,21 @@ 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); } #include 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); } #include 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); } #include @@ -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, 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); } #include @@ -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, 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); } #include @@ -48,7 +48,7 @@ static inline int z_vrfy_auxdisplay_cursor_position_set(const struct device *dev enum auxdisplay_position type, 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); } #include @@ -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, 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); } #include @@ -65,7 +65,7 @@ static inline int z_vrfy_auxdisplay_display_position_set(const struct device *de enum auxdisplay_position type, 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); } #include @@ -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, 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); } #include @@ -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, 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); } #include 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); } #include @@ -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, 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); } #include @@ -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, 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); } #include @@ -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, 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); } #include @@ -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, 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); } #include 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); } #include @@ -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, 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); } #include @@ -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, 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); } #include @@ -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, 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); } #include diff --git a/drivers/bbram/bbram_handlers.c b/drivers/bbram/bbram_handlers.c index 799262f69f4..14e4abe21b3 100644 --- a/drivers/bbram/bbram_handlers.c +++ b/drivers/bbram/bbram_handlers.c @@ -9,29 +9,29 @@ 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); } #include 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); } #include 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); } #include 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)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(size, sizeof(size_t))); + K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(size, sizeof(size_t))); return z_impl_bbram_get_size(dev, size); } #include @@ -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, size_t size, uint8_t *data) { - Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(data, size)); + K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(data, size)); return z_impl_bbram_read(dev, offset, size, data); } #include @@ -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, size_t size, const uint8_t *data) { - Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM)); - Z_OOPS(K_SYSCALL_MEMORY_READ(data, size)); + K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM)); + K_OOPS(K_SYSCALL_MEMORY_READ(data, size)); return z_impl_bbram_write(dev, offset, size, data); } #include diff --git a/drivers/cache/cache_handlers.c b/drivers/cache/cache_handlers.c index 472e8f0ff58..2005124136f 100644 --- a/drivers/cache/cache_handlers.c +++ b/drivers/cache/cache_handlers.c @@ -9,7 +9,7 @@ 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); } @@ -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) { - 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); } @@ -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) { - 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); } diff --git a/drivers/can/can_handlers.c b/drivers/can/can_handlers.c index 5b3eecd489f..1e10baf79ca 100644 --- a/drivers/can/can_handlers.c +++ b/drivers/can/can_handlers.c @@ -13,11 +13,11 @@ static int z_vrfy_can_calc_timing(const struct device *dev, struct can_timing *r struct can_timing res_copy; int err; - Z_OOPS(K_SYSCALL_DRIVER_CAN(dev, get_core_clock)); - Z_OOPS(k_usermode_from_copy(&res_copy, res, sizeof(res_copy))); + K_OOPS(K_SYSCALL_DRIVER_CAN(dev, get_core_clock)); + K_OOPS(k_usermode_from_copy(&res_copy, res, sizeof(res_copy))); 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; } @@ -28,8 +28,8 @@ static inline int z_vrfy_can_set_timing(const struct device *dev, { struct can_timing timing_copy; - Z_OOPS(K_SYSCALL_DRIVER_CAN(dev, set_timing)); - Z_OOPS(k_usermode_from_copy(&timing_copy, timing, sizeof(timing_copy))); + K_OOPS(K_SYSCALL_DRIVER_CAN(dev, set_timing)); + K_OOPS(k_usermode_from_copy(&timing_copy, timing, sizeof(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, uint32_t *rate) { - Z_OOPS(K_SYSCALL_DRIVER_CAN(dev, get_core_clock)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(rate, sizeof(*rate))); + K_OOPS(K_SYSCALL_DRIVER_CAN(dev, get_core_clock)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(rate, sizeof(*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) { /* Optional API function */ - Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_CAN)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(max_bitrate, sizeof(*max_bitrate))); + K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_CAN)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(max_bitrate, sizeof(*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) { - 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); } @@ -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) { - 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); } @@ -80,11 +80,11 @@ static int z_vrfy_can_calc_timing_data(const struct device *dev, struct can_timi struct can_timing res_copy; int err; - Z_OOPS(K_SYSCALL_DRIVER_CAN(dev, get_core_clock)); - Z_OOPS(k_usermode_from_copy(&res_copy, res, sizeof(res_copy))); + K_OOPS(K_SYSCALL_DRIVER_CAN(dev, get_core_clock)); + 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); - Z_OOPS(k_usermode_to_copy(res, &res_copy, sizeof(*res))); + K_OOPS(k_usermode_to_copy(res, &res_copy, sizeof(*res))); 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) { - 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); } @@ -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) { - 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); } @@ -111,8 +111,8 @@ static inline int z_vrfy_can_set_timing_data(const struct device *dev, { struct can_timing timing_data_copy; - Z_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_SYSCALL_DRIVER_CAN(dev, set_timing_data)); + 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); } @@ -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, 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); } @@ -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) { /* 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); } @@ -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) { - Z_OOPS(K_SYSCALL_DRIVER_CAN(dev, get_capabilities)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(cap, sizeof(*cap))); + K_OOPS(K_SYSCALL_DRIVER_CAN(dev, get_capabilities)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(cap, sizeof(*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) { - Z_OOPS(K_SYSCALL_DRIVER_CAN(dev, start)); + K_OOPS(K_SYSCALL_DRIVER_CAN(dev, start)); 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) { - Z_OOPS(K_SYSCALL_DRIVER_CAN(dev, stop)); + K_OOPS(K_SYSCALL_DRIVER_CAN(dev, stop)); 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) { - 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); } @@ -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) { - 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); } @@ -187,9 +187,9 @@ static inline int z_vrfy_can_send(const struct device *dev, { struct can_frame frame_copy; - Z_OOPS(K_SYSCALL_DRIVER_CAN(dev, send)); - Z_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_DRIVER_CAN(dev, send)); + K_OOPS(k_usermode_from_copy(&frame_copy, frame, sizeof(frame_copy))); + 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); } @@ -201,9 +201,9 @@ static inline int z_vrfy_can_add_rx_filter_msgq(const struct device *dev, { struct can_filter filter_copy; - Z_OOPS(K_SYSCALL_DRIVER_CAN(dev, add_rx_filter)); - Z_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ)); - Z_OOPS(k_usermode_from_copy(&filter_copy, filter, sizeof(filter_copy))); + K_OOPS(K_SYSCALL_DRIVER_CAN(dev, add_rx_filter)); + K_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ)); + K_OOPS(k_usermode_from_copy(&filter_copy, filter, sizeof(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) { - 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); } @@ -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, 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) { - Z_OOPS(K_SYSCALL_MEMORY_WRITE(state, sizeof(*state))); + K_OOPS(K_SYSCALL_MEMORY_WRITE(state, sizeof(*state))); } 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); @@ -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 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); } diff --git a/drivers/charger/charger_handlers.c b/drivers/charger/charger_handlers.c index 6f17002aac7..417991f9f5f 100644 --- a/drivers/charger/charger_handlers.c +++ b/drivers/charger/charger_handlers.c @@ -12,11 +12,11 @@ static inline int z_vrfy_charger_get_prop(const struct device *dev, const charge { 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); - 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; } @@ -28,9 +28,9 @@ static inline int z_vrfy_charger_set_prop(const struct device *dev, const charge { 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); } diff --git a/drivers/counter/counter_handlers.c b/drivers/counter/counter_handlers.c index 191d12d49b5..15cd0cb5881 100644 --- a/drivers/counter/counter_handlers.c +++ b/drivers/counter/counter_handlers.c @@ -13,7 +13,7 @@ #define COUNTER_HANDLER(name) \ 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); \ } @@ -27,21 +27,21 @@ COUNTER_HANDLER(start) 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); } #include 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); } #include 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); } #include @@ -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, 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, (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, 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, (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, uint32_t *ticks) { - Z_OOPS(K_SYSCALL_DRIVER_COUNTER(dev, get_value)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(ticks, sizeof(*ticks))); + K_OOPS(K_SYSCALL_DRIVER_COUNTER(dev, get_value)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(ticks, sizeof(*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, uint64_t *ticks) { - Z_OOPS(K_SYSCALL_DRIVER_COUNTER(dev, get_value_64)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(ticks, sizeof(*ticks))); + K_OOPS(K_SYSCALL_DRIVER_COUNTER(dev, get_value_64)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(ticks, sizeof(*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; - Z_OOPS(K_SYSCALL_DRIVER_COUNTER(dev, set_alarm)); - Z_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_DRIVER_COUNTER(dev, set_alarm)); + K_OOPS(k_usermode_from_copy(&cfg_copy, alarm_cfg, sizeof(cfg_copy))); + K_OOPS(K_SYSCALL_VERIFY_MSG(cfg_copy.callback == NULL, "callbacks may not be set from user mode")); return z_impl_counter_set_channel_alarm((const struct device *)dev, (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, 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, (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; - Z_OOPS(K_SYSCALL_DRIVER_COUNTER(dev, set_top_value)); - Z_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_DRIVER_COUNTER(dev, set_top_value)); + K_OOPS(k_usermode_from_copy(&cfg_copy, cfg, sizeof(cfg_copy))); + K_OOPS(K_SYSCALL_VERIFY_MSG(cfg_copy.callback == NULL, "callbacks may not be set from user mode")); return z_impl_counter_set_top_value((const struct device *)dev, (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) { - 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); } #include 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); } #include @@ -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, 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, 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, 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, ticks, flags); diff --git a/drivers/counter/maxim_ds3231.c b/drivers/counter/maxim_ds3231.c index 19241a22990..93d20639ecd 100644 --- a/drivers/counter/maxim_ds3231.c +++ b/drivers/counter/maxim_ds3231.c @@ -1308,13 +1308,13 @@ int z_vrfy_maxim_ds3231_get_syncpoint(const struct device *dev, struct maxim_ds3231_syncpoint value; int rv; - Z_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_SPECIFIC_DRIVER(dev, K_OBJ_DRIVER_COUNTER, &ds3231_api)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(syncpoint, sizeof(*syncpoint))); rv = z_impl_maxim_ds3231_get_syncpoint(dev, &value); 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; @@ -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, 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) { - 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); diff --git a/drivers/dac/dac_handlers.c b/drivers/dac/dac_handlers.c index c1cc24c3685..bd9ee0bc7e0 100644 --- a/drivers/dac/dac_handlers.c +++ b/drivers/dac/dac_handlers.c @@ -13,8 +13,8 @@ static inline int z_vrfy_dac_channel_setup(const struct device *dev, { struct dac_channel_cfg channel_cfg; - Z_OOPS(K_SYSCALL_DRIVER_DAC(dev, channel_setup)); - Z_OOPS(k_usermode_from_copy(&channel_cfg, + K_OOPS(K_SYSCALL_DRIVER_DAC(dev, channel_setup)); + K_OOPS(k_usermode_from_copy(&channel_cfg, (struct dac_channel_cfg *)user_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, 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, value); diff --git a/drivers/dma/dma_handlers.c b/drivers/dma/dma_handlers.c index 10c542d8380..d84c1510152 100644 --- a/drivers/dma/dma_handlers.c +++ b/drivers/dma/dma_handlers.c @@ -13,14 +13,14 @@ 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); } #include 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); } #include diff --git a/drivers/eeprom/eeprom_handlers.c b/drivers/eeprom/eeprom_handlers.c index 7534e67d865..9b1406a6004 100644 --- a/drivers/eeprom/eeprom_handlers.c +++ b/drivers/eeprom/eeprom_handlers.c @@ -10,8 +10,8 @@ static inline int z_vrfy_eeprom_read(const struct device *dev, off_t offset, void *data, size_t len) { - Z_OOPS(K_SYSCALL_DRIVER_EEPROM(dev, read)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(data, len)); + K_OOPS(K_SYSCALL_DRIVER_EEPROM(dev, read)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(data, len)); return z_impl_eeprom_read((const struct device *)dev, offset, (void *)data, 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, const void *data, size_t len) { - Z_OOPS(K_SYSCALL_DRIVER_EEPROM(dev, write)); - Z_OOPS(K_SYSCALL_MEMORY_READ(data, len)); + K_OOPS(K_SYSCALL_DRIVER_EEPROM(dev, write)); + K_OOPS(K_SYSCALL_MEMORY_READ(data, len)); return z_impl_eeprom_write((const struct device *)dev, offset, (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) { - 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); } #include diff --git a/drivers/entropy/entropy_handlers.c b/drivers/entropy/entropy_handlers.c index 269d3412608..76b7df3d0bd 100644 --- a/drivers/entropy/entropy_handlers.c +++ b/drivers/entropy/entropy_handlers.c @@ -11,8 +11,8 @@ static inline int z_vrfy_entropy_get_entropy(const struct device *dev, uint8_t *buffer, uint16_t len) { - Z_OOPS(K_SYSCALL_DRIVER_ENTROPY(dev, get_entropy)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(buffer, len)); + K_OOPS(K_SYSCALL_DRIVER_ENTROPY(dev, get_entropy)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(buffer, len)); return z_impl_entropy_get_entropy((const struct device *)dev, (uint8_t *)buffer, len); diff --git a/drivers/espi/espi_handlers.c b/drivers/espi/espi_handlers.c index 1bb023a7a58..c215838fd79 100644 --- a/drivers/espi/espi_handlers.c +++ b/drivers/espi/espi_handlers.c @@ -13,8 +13,8 @@ static inline int z_vrfy_espi_config(const struct device *dev, { struct espi_cfg cfg_copy; - Z_OOPS(K_SYSCALL_DRIVER_ESPI(dev, config)); - Z_OOPS(k_usermode_from_copy(&cfg_copy, cfg, + K_OOPS(K_SYSCALL_DRIVER_ESPI(dev, config)); + K_OOPS(k_usermode_from_copy(&cfg_copy, cfg, sizeof(struct espi_cfg))); 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, 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); } @@ -37,10 +37,10 @@ static inline int z_vrfy_espi_read_lpc_request(const struct device *dev, int ret; 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); - 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; } @@ -52,8 +52,8 @@ static inline int z_vrfy_espi_write_lpc_request(const struct device *dev, { uint32_t data_copy; - Z_OOPS(K_SYSCALL_DRIVER_ESPI(dev, write_lpc_request)); - Z_OOPS(k_usermode_from_copy(&data_copy, data, sizeof(*data))); + K_OOPS(K_SYSCALL_DRIVER_ESPI(dev, write_lpc_request)); + K_OOPS(k_usermode_from_copy(&data_copy, data, sizeof(*data))); 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, 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); } @@ -76,10 +76,10 @@ static inline int z_vrfy_espi_receive_vwire(const struct device *dev, int ret; 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); - 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; } @@ -91,14 +91,14 @@ static inline int z_vrfy_espi_read_request(const struct device *dev, int ret; struct espi_request_packet req_copy; - Z_OOPS(K_SYSCALL_DRIVER_ESPI(dev, read_request)); - Z_OOPS(k_usermode_from_copy(&req_copy, req, + K_OOPS(K_SYSCALL_DRIVER_ESPI(dev, read_request)); + K_OOPS(k_usermode_from_copy(&req_copy, req, 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); - Z_OOPS(k_usermode_to_copy(req, &req_copy, + K_OOPS(k_usermode_to_copy(req, &req_copy, sizeof(struct espi_request_packet))); return ret; @@ -111,9 +111,9 @@ static inline int z_vrfy_espi_write_request(const struct device *dev, int ret; struct espi_request_packet req_copy; - Z_OOPS(K_SYSCALL_DRIVER_ESPI(dev, write_request)); - Z_OOPS(K_SYSCALL_MEMORY_READ(req->data, req->len)); - Z_OOPS(k_usermode_from_copy(&req_copy, req, + K_OOPS(K_SYSCALL_DRIVER_ESPI(dev, write_request)); + K_OOPS(K_SYSCALL_MEMORY_READ(req->data, req->len)); + K_OOPS(k_usermode_from_copy(&req_copy, req, sizeof(struct espi_request_packet))); 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; struct espi_oob_packet pckt_copy; - Z_OOPS(K_SYSCALL_DRIVER_ESPI(dev, send_oob)); - Z_OOPS(K_SYSCALL_MEMORY_READ(pckt->buf, pckt->len)); - Z_OOPS(k_usermode_from_copy(&pckt_copy, pckt, + K_OOPS(K_SYSCALL_DRIVER_ESPI(dev, send_oob)); + K_OOPS(K_SYSCALL_MEMORY_READ(pckt->buf, pckt->len)); + K_OOPS(k_usermode_from_copy(&pckt_copy, pckt, sizeof(struct espi_oob_packet))); 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; struct espi_oob_packet pckt_copy; - Z_OOPS(K_SYSCALL_DRIVER_ESPI(dev, receive_oob)); - Z_OOPS(k_usermode_from_copy(&pckt_copy, pckt, + K_OOPS(K_SYSCALL_DRIVER_ESPI(dev, receive_oob)); + K_OOPS(k_usermode_from_copy(&pckt_copy, pckt, 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); - Z_OOPS(k_usermode_to_copy(pckt, &pckt_copy, + K_OOPS(k_usermode_to_copy(pckt, &pckt_copy, sizeof(struct espi_oob_packet))); return ret; @@ -164,13 +164,13 @@ static inline int z_vrfy_espi_read_flash(const struct device *dev, int ret; struct espi_flash_packet pckt_copy; - Z_OOPS(K_SYSCALL_DRIVER_ESPI(dev, flash_read)); - Z_OOPS(k_usermode_from_copy(&pckt_copy, pckt, + K_OOPS(K_SYSCALL_DRIVER_ESPI(dev, flash_read)); + K_OOPS(k_usermode_from_copy(&pckt_copy, pckt, 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); - Z_OOPS(k_usermode_to_copy(pckt, &pckt_copy, + K_OOPS(k_usermode_to_copy(pckt, &pckt_copy, sizeof(struct espi_flash_packet))); return ret; @@ -183,10 +183,10 @@ static inline int z_vrfy_espi_write_flash(const struct device *dev, int ret; struct espi_flash_packet pckt_copy; - Z_OOPS(K_SYSCALL_DRIVER_ESPI(dev, flash_write)); - Z_OOPS(k_usermode_from_copy(&pckt_copy, pckt, + K_OOPS(K_SYSCALL_DRIVER_ESPI(dev, flash_write)); + K_OOPS(k_usermode_from_copy(&pckt_copy, pckt, 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); @@ -200,10 +200,10 @@ static inline int z_vrfy_espi_flash_erase(const struct device *dev, int ret; struct espi_flash_packet pckt_copy; - Z_OOPS(K_SYSCALL_DRIVER_ESPI(dev, flash_write)); - Z_OOPS(k_usermode_from_copy(&pckt_copy, pckt, + K_OOPS(K_SYSCALL_DRIVER_ESPI(dev, flash_write)); + K_OOPS(k_usermode_from_copy(&pckt_copy, pckt, 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); diff --git a/drivers/flash/flash_handlers.c b/drivers/flash/flash_handlers.c index d8b5dc377c3..ac727b109e7 100644 --- a/drivers/flash/flash_handlers.c +++ b/drivers/flash/flash_handlers.c @@ -10,8 +10,8 @@ static inline int z_vrfy_flash_read(const struct device *dev, off_t offset, void *data, size_t len) { - Z_OOPS(K_SYSCALL_DRIVER_FLASH(dev, read)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(data, len)); + K_OOPS(K_SYSCALL_DRIVER_FLASH(dev, read)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(data, len)); return z_impl_flash_read((const struct device *)dev, offset, (void *)data, 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, const void *data, size_t len) { - Z_OOPS(K_SYSCALL_DRIVER_FLASH(dev, write)); - Z_OOPS(K_SYSCALL_MEMORY_READ(data, len)); + K_OOPS(K_SYSCALL_DRIVER_FLASH(dev, write)); + K_OOPS(K_SYSCALL_MEMORY_READ(data, len)); return z_impl_flash_write((const struct device *)dev, offset, (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, 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); } #include 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); } #include 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); } #include @@ -55,8 +55,8 @@ static inline int z_vrfy_flash_get_page_info_by_offs(const struct device *dev, off_t offs, struct flash_pages_info *info) { - Z_OOPS(K_SYSCALL_DRIVER_FLASH(dev, page_layout)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(info, sizeof(struct flash_pages_info))); + K_OOPS(K_SYSCALL_DRIVER_FLASH(dev, page_layout)); + 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, offs, (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, struct flash_pages_info *info) { - Z_OOPS(K_SYSCALL_DRIVER_FLASH(dev, page_layout)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(info, sizeof(struct flash_pages_info))); + K_OOPS(K_SYSCALL_DRIVER_FLASH(dev, page_layout)); + 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, idx, (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) { - 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); } #include @@ -90,8 +90,8 @@ static inline int z_vrfy_flash_sfdp_read(const struct device *dev, off_t offset, void *data, size_t len) { - Z_OOPS(K_SYSCALL_DRIVER_FLASH(dev, sfdp_read)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(data, len)); + K_OOPS(K_SYSCALL_DRIVER_FLASH(dev, sfdp_read)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(data, len)); return z_impl_flash_sfdp_read(dev, offset, data, len); } #include @@ -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, uint8_t *id) { - Z_OOPS(K_SYSCALL_DRIVER_FLASH(dev, read_jedec_id)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(id, 3)); + K_OOPS(K_SYSCALL_DRIVER_FLASH(dev, read_jedec_id)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(id, 3)); return z_impl_flash_read_jedec_id(dev, id); } #include @@ -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, 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 diff --git a/drivers/flash/flash_npcx_fiu_nor.c b/drivers/flash/flash_npcx_fiu_nor.c index 4fcac59c027..e42aa82f896 100644 --- a/drivers/flash/flash_npcx_fiu_nor.c +++ b/drivers/flash/flash_npcx_fiu_nor.c @@ -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; 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_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); #ifdef CONFIG_USERSPACE 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 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; 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; } #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); #ifdef CONFIG_USERSPACE 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 break; diff --git a/drivers/flash/flash_simulator.c b/drivers/flash/flash_simulator.c index f06f0e69750..ccbc28edfe4 100644 --- a/drivers/flash/flash_simulator.c +++ b/drivers/flash/flash_simulator.c @@ -486,7 +486,7 @@ void *z_impl_flash_simulator_get_memory(const struct device *dev, void *z_vrfy_flash_simulator_get_memory(const struct device *dev, 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); } diff --git a/drivers/flash/flash_stm32_ex_op.c b/drivers/flash/flash_stm32_ex_op.c index 02e5d11279d..623d4e23d6d 100644 --- a/drivers/flash/flash_stm32_ex_op.c +++ b/drivers/flash/flash_stm32_ex_op.c @@ -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; if (syscall_trap) { - Z_OOPS(k_usermode_from_copy(&in_copy, request, + K_OOPS(k_usermode_from_copy(&in_copy, request, sizeof(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 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 } @@ -102,7 +102,7 @@ int flash_stm32_ex_op_rdp(const struct device *dev, const uintptr_t in, if (request != NULL) { #ifdef CONFIG_USERSPACE if (syscall_trap) { - Z_OOPS(k_usermode_from_copy(©, request, sizeof(copy))); + K_OOPS(k_usermode_from_copy(©, request, sizeof(copy))); request = © } #endif @@ -132,7 +132,7 @@ int flash_stm32_ex_op_rdp(const struct device *dev, const uintptr_t in, #ifdef CONFIG_USERSPACE if (syscall_trap) { - Z_OOPS(k_usermode_to_copy(out, result, sizeof(copy))); + K_OOPS(k_usermode_to_copy(out, result, sizeof(copy))); } #endif } diff --git a/drivers/flash/nrf_qspi_nor.c b/drivers/flash/nrf_qspi_nor.c index 0540ef2360a..6dd305e9430 100644 --- a/drivers/flash/nrf_qspi_nor.c +++ b/drivers/flash/nrf_qspi_nor.c @@ -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) { - 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)); z_impl_nrf_qspi_nor_xip_enable(dev, enable); diff --git a/drivers/fuel_gauge/fuel_gauge_syscall_handlers.c b/drivers/fuel_gauge/fuel_gauge_syscall_handlers.c index 5fe1e45a35a..312564c35a6 100644 --- a/drivers/fuel_gauge/fuel_gauge_syscall_handlers.c +++ b/drivers/fuel_gauge/fuel_gauge_syscall_handlers.c @@ -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; - 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); - 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; } @@ -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]; 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))); - Z_OOPS(k_usermode_from_copy(k_props, props, len * sizeof(fuel_gauge_prop_t))); + K_OOPS(k_usermode_from_copy(k_vals, vals, len * sizeof(union fuel_gauge_prop_val))); + 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); - 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; } @@ -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, 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); @@ -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]; 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))); - Z_OOPS(k_usermode_from_copy(k_props, props, len * sizeof(fuel_gauge_prop_t))); + K_OOPS(k_usermode_from_copy(k_vals, vals, len * sizeof(union fuel_gauge_prop_val))); + 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); /* 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; } @@ -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, 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); @@ -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) { - 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); } diff --git a/drivers/gpio/gpio_handlers.c b/drivers/gpio/gpio_handlers.c index 57cec40c56e..99fbc6f45d9 100644 --- a/drivers/gpio/gpio_handlers.c +++ b/drivers/gpio/gpio_handlers.c @@ -11,7 +11,7 @@ static inline int z_vrfy_gpio_pin_configure(const struct device *port, gpio_pin_t pin, 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, pin, flags); @@ -23,8 +23,8 @@ static inline int z_vrfy_gpio_pin_get_config(const struct device *port, gpio_pin_t pin, gpio_flags_t *flags) { - Z_OOPS(K_SYSCALL_DRIVER_GPIO(port, pin_get_config)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(flags, sizeof(gpio_flags_t))); + K_OOPS(K_SYSCALL_DRIVER_GPIO(port, pin_get_config)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(flags, sizeof(gpio_flags_t))); 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, gpio_port_value_t *value) { - Z_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_DRIVER_GPIO(port, port_get_raw)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(value, sizeof(gpio_port_value_t))); return z_impl_gpio_port_get_raw((const struct device *)port, (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_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, mask, 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, 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, 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, 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, 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, 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); } #include @@ -82,7 +82,7 @@ static inline int z_vrfy_gpio_pin_interrupt_configure(const struct device *port, gpio_pin_t pin, 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, pin, 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) { - 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); } @@ -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 *outputs) { - Z_OOPS(K_SYSCALL_DRIVER_GPIO(dev, port_get_direction)); + K_OOPS(K_SYSCALL_DRIVER_GPIO(dev, port_get_direction)); 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) { - 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); diff --git a/drivers/hwinfo/hwinfo_handlers.c b/drivers/hwinfo/hwinfo_handlers.c index b9727bd4ab7..02058f9b955 100644 --- a/drivers/hwinfo/hwinfo_handlers.c +++ b/drivers/hwinfo/hwinfo_handlers.c @@ -9,7 +9,7 @@ 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); } @@ -21,7 +21,7 @@ int z_vrfy_hwinfo_get_reset_cause(uint32_t *cause) uint32_t 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; } @@ -40,7 +40,7 @@ int z_vrfy_hwinfo_get_supported_reset_cause(uint32_t *supported) uint32_t 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; } diff --git a/drivers/hwspinlock/hwspinlock_handlers.c b/drivers/hwspinlock/hwspinlock_handlers.c index 9b7726d09cf..7064293be4b 100644 --- a/drivers/hwspinlock/hwspinlock_handlers.c +++ b/drivers/hwspinlock/hwspinlock_handlers.c @@ -9,7 +9,7 @@ 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); } @@ -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) { - Z_OOPS(K_SYSCALL_DRIVER_HWSPINLOCK(dev, lock)); + K_OOPS(K_SYSCALL_DRIVER_HWSPINLOCK(dev, lock)); 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) { - Z_OOPS(K_SYSCALL_DRIVER_HWSPINLOCK(dev, unlock)); + K_OOPS(K_SYSCALL_DRIVER_HWSPINLOCK(dev, unlock)); 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) { - 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); } diff --git a/drivers/i2c/i2c_handlers.c b/drivers/i2c/i2c_handlers.c index 99c3e60fa72..20ec2a6f578 100644 --- a/drivers/i2c/i2c_handlers.c +++ b/drivers/i2c/i2c_handlers.c @@ -11,7 +11,7 @@ static inline int z_vrfy_i2c_configure(const struct device *dev, 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); } #include @@ -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, uint32_t *dev_config) { - Z_OOPS(K_SYSCALL_DRIVER_I2C(dev, get_config)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(dev_config, sizeof(uint32_t))); + K_OOPS(K_SYSCALL_DRIVER_I2C(dev, get_config)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(dev_config, sizeof(uint32_t))); 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 */ 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)); } @@ -52,17 +52,17 @@ static inline int z_vrfy_i2c_transfer(const struct device *dev, struct i2c_msg *msgs, uint8_t num_msgs, 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 * 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 * 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 */ - Z_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(msgs, num_msgs, + K_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(msgs, num_msgs, sizeof(struct i2c_msg))); 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) { - 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); } #include 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); } #include 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); } #include diff --git a/drivers/i2s/i2s_handlers.c b/drivers/i2s/i2s_handlers.c index 0f5c0db8f48..0ef1f6e6cd5 100644 --- a/drivers/i2s/i2s_handlers.c +++ b/drivers/i2s/i2s_handlers.c @@ -20,7 +20,7 @@ static inline int z_vrfy_i2s_configure(const struct device *dev, 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))); /* 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; 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); @@ -67,8 +67,8 @@ static inline int z_vrfy_i2s_buf_read(const struct device *dev, data_size); k_mem_slab_free(rx_cfg->mem_slab, mem_block); - Z_OOPS(copy_success); - Z_OOPS(k_usermode_to_copy((void *)size, &data_size, + K_OOPS(copy_success); + K_OOPS(k_usermode_to_copy((void *)size, &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; 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); if (!tx_cfg) { 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); if (ret) { 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); @@ -117,7 +117,7 @@ static inline int z_vrfy_i2s_trigger(const struct device *dev, enum i2s_dir dir, 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); } diff --git a/drivers/i3c/i3c_handlers.c b/drivers/i3c/i3c_handlers.c index b9aaaa7191f..a5d218992a3 100644 --- a/drivers/i3c/i3c_handlers.c +++ b/drivers/i3c/i3c_handlers.c @@ -11,24 +11,24 @@ static inline int z_vrfy_i3c_do_ccc(const struct device *dev, struct i3c_ccc_payload *payload) { - Z_OOPS(K_SYSCALL_DRIVER_I3C(dev, do_ccc)); - Z_OOPS(K_SYSCALL_MEMORY_READ(payload, sizeof(*payload))); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(payload, sizeof(*payload))); + K_OOPS(K_SYSCALL_DRIVER_I3C(dev, do_ccc)); + K_OOPS(K_SYSCALL_MEMORY_READ(payload, sizeof(*payload))); + K_OOPS(K_SYSCALL_MEMORY_WRITE(payload, sizeof(*payload))); 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, 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, sizeof(*payload->ccc.data))); } 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, 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, 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 */ 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)); } @@ -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, struct i3c_msg *msgs, uint8_t num_msgs) { - Z_OOPS(K_SYSCALL_MEMORY_READ(target, sizeof(*target))); - Z_OOPS(K_SYSCALL_OBJ(target->bus, K_OBJ_DRIVER_I3C)); + K_OOPS(K_SYSCALL_MEMORY_READ(target, sizeof(*target))); + K_OOPS(K_SYSCALL_OBJ(target->bus, K_OBJ_DRIVER_I3C)); /* copy_msgs_and_transfer() will allocate a copy on the stack using * 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 * 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 */ - Z_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(msgs, num_msgs, + K_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(msgs, num_msgs, sizeof(struct i3c_msg))); return copy_i3c_msgs_and_transfer((struct i3c_device_desc *)target, diff --git a/drivers/ipm/ipm_handlers.c b/drivers/ipm/ipm_handlers.c index ef139c67338..259644ae8d0 100644 --- a/drivers/ipm/ipm_handlers.c +++ b/drivers/ipm/ipm_handlers.c @@ -11,8 +11,8 @@ static inline int z_vrfy_ipm_send(const struct device *dev, int wait, uint32_t id, const void *data, int size) { - Z_OOPS(K_SYSCALL_DRIVER_IPM(dev, send)); - Z_OOPS(K_SYSCALL_MEMORY_READ(data, size)); + K_OOPS(K_SYSCALL_DRIVER_IPM(dev, send)); + K_OOPS(K_SYSCALL_MEMORY_READ(data, size)); return z_impl_ipm_send((const struct device *)dev, wait, id, (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) { - 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); } #include 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); } #include 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); } #include diff --git a/drivers/kscan/kscan_handlers.c b/drivers/kscan/kscan_handlers.c index d62cfbb603e..98809687430 100644 --- a/drivers/kscan/kscan_handlers.c +++ b/drivers/kscan/kscan_handlers.c @@ -10,8 +10,8 @@ static inline int z_vrfy_kscan_config(const struct device *dev, kscan_callback_t callback_isr) { - Z_OOPS(K_SYSCALL_DRIVER_KSCAN(dev, config)); - Z_OOPS(K_SYSCALL_VERIFY_MSG(callback_isr == 0, + K_OOPS(K_SYSCALL_DRIVER_KSCAN(dev, config)); + K_OOPS(K_SYSCALL_VERIFY_MSG(callback_isr == 0, "callback cannot be set from user mode")); 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) { - 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); } @@ -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) { - 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); } diff --git a/drivers/led/led_handlers.c b/drivers/led/led_handlers.c index 223c673c4a6..a089846e695 100644 --- a/drivers/led/led_handlers.c +++ b/drivers/led/led_handlers.c @@ -10,7 +10,7 @@ static inline int z_vrfy_led_blink(const struct device *dev, uint32_t led, 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, 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, const struct led_info **info) { - Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_LED)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(info, sizeof(*info))); + K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_LED)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(info, sizeof(*info))); return z_impl_led_get_info(dev, led, info); } #include @@ -29,7 +29,7 @@ static inline int z_vrfy_led_set_brightness(const struct device *dev, uint32_t led, 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, value); } @@ -39,8 +39,8 @@ static inline int z_vrfy_led_write_channels(const struct device *dev, uint32_t start_channel, uint32_t num_channels, const uint8_t *buf) { - Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_LED)); - Z_OOPS(K_SYSCALL_MEMORY_READ(buf, num_channels)); + K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_LED)); + K_OOPS(K_SYSCALL_MEMORY_READ(buf, num_channels)); return z_impl_led_write_channels(dev, start_channel, num_channels, buf); } #include @@ -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, 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); } #include @@ -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, uint8_t num_colors, const uint8_t *color) { - Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_LED)); - Z_OOPS(K_SYSCALL_MEMORY_READ(color, num_colors)); + K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_LED)); + K_OOPS(K_SYSCALL_MEMORY_READ(color, num_colors)); return z_impl_led_set_color(dev, led, num_colors, color); } #include 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); } #include 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); } #include diff --git a/drivers/mbox/mbox_handlers.c b/drivers/mbox/mbox_handlers.c index 4b2c84997ec..c4e43f74fe5 100644 --- a/drivers/mbox/mbox_handlers.c +++ b/drivers/mbox/mbox_handlers.c @@ -10,10 +10,10 @@ static inline int z_vrfy_mbox_send(const struct mbox_channel *channel, const struct mbox_msg *msg) { - Z_OOPS(K_SYSCALL_MEMORY_READ(channel, sizeof(struct mbox_channel))); - Z_OOPS(K_SYSCALL_DRIVER_MBOX(channel->dev, send)); - Z_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(channel, sizeof(struct mbox_channel))); + K_OOPS(K_SYSCALL_DRIVER_MBOX(channel->dev, send)); + K_OOPS(K_SYSCALL_MEMORY_READ(msg, sizeof(struct mbox_msg))); + K_OOPS(K_SYSCALL_MEMORY_READ(msg->data, msg->size)); 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) { - 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); } @@ -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) { - 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); } @@ -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) { - Z_OOPS(K_SYSCALL_MEMORY_READ(channel, sizeof(struct mbox_channel))); - Z_OOPS(K_SYSCALL_DRIVER_MBOX(channel->dev, set_enabled)); + K_OOPS(K_SYSCALL_MEMORY_READ(channel, sizeof(struct mbox_channel))); + K_OOPS(K_SYSCALL_DRIVER_MBOX(channel->dev, set_enabled)); return z_impl_mbox_set_enabled(channel, enable); } diff --git a/drivers/misc/timeaware_gpio/timeaware_gpio_handlers.c b/drivers/misc/timeaware_gpio/timeaware_gpio_handlers.c index e65dcb2a62c..1904db4218d 100644 --- a/drivers/misc/timeaware_gpio/timeaware_gpio_handlers.c +++ b/drivers/misc/timeaware_gpio/timeaware_gpio_handlers.c @@ -8,8 +8,8 @@ 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)); - Z_OOPS(Z_SYSCALL_MEMORY_WRITE(current_time, sizeof(uint64_t))); + K_OOPS(Z_SYSCALL_DRIVER_TGPIO(port, get_time)); + 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); } #include @@ -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, uint32_t *cycles) { - Z_OOPS(Z_SYSCALL_DRIVER_TGPIO(port, cyc_per_sec)); - Z_OOPS(Z_SYSCALL_MEMORY_WRITE(cycles, sizeof(uint32_t))); + K_OOPS(Z_SYSCALL_DRIVER_TGPIO(port, cyc_per_sec)); + K_OOPS(Z_SYSCALL_MEMORY_WRITE(cycles, sizeof(uint32_t))); return z_impl_tgpio_port_get_cycles_per_second((const struct device *)port, (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, 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, 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) { - 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); } #include @@ -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, 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, 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, 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, (uint64_t *)event_count); } diff --git a/drivers/peci/peci_handlers.c b/drivers/peci/peci_handlers.c index 6f695e9b72d..64947a8743d 100644 --- a/drivers/peci/peci_handlers.c +++ b/drivers/peci/peci_handlers.c @@ -11,7 +11,7 @@ static inline int z_vrfy_peci_config(const struct device *dev, 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); } @@ -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) { - Z_OOPS(K_SYSCALL_DRIVER_PECI(dev, enable)); + K_OOPS(K_SYSCALL_DRIVER_PECI(dev, enable)); 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) { - Z_OOPS(K_SYSCALL_DRIVER_PECI(dev, disable)); + K_OOPS(K_SYSCALL_DRIVER_PECI(dev, disable)); 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; - Z_OOPS(K_SYSCALL_DRIVER_PECI(dev, transfer)); - Z_OOPS(k_usermode_from_copy(&msg_copy, msg, sizeof(*msg))); + K_OOPS(K_SYSCALL_DRIVER_PECI(dev, transfer)); + K_OOPS(k_usermode_from_copy(&msg_copy, msg, sizeof(*msg))); return z_impl_peci_transfer(dev, &msg_copy); } diff --git a/drivers/ps2/ps2_handlers.c b/drivers/ps2/ps2_handlers.c index f02365774bf..91835e85ea5 100644 --- a/drivers/ps2/ps2_handlers.c +++ b/drivers/ps2/ps2_handlers.c @@ -10,8 +10,8 @@ static inline int z_vrfy_ps2_config(const struct device *dev, ps2_callback_t callback_isr) { - Z_OOPS(K_SYSCALL_DRIVER_PS2(dev, config)); - Z_OOPS(K_SYSCALL_VERIFY_MSG(callback_isr == NULL, + K_OOPS(K_SYSCALL_DRIVER_PS2(dev, config)); + K_OOPS(K_SYSCALL_VERIFY_MSG(callback_isr == NULL, "callback not be set from user mode")); 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) { - Z_OOPS(K_SYSCALL_DRIVER_PS2(dev, write)); + K_OOPS(K_SYSCALL_DRIVER_PS2(dev, write)); return z_impl_ps2_write(dev, value); } #include static inline int z_vrfy_ps2_read(const struct device *dev, uint8_t *value) { - Z_OOPS(K_SYSCALL_DRIVER_PS2(dev, read)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(value, sizeof(uint8_t))); + K_OOPS(K_SYSCALL_DRIVER_PS2(dev, read)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(value, sizeof(uint8_t))); return z_impl_ps2_read(dev, value); } #include 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); } #include 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); } #include diff --git a/drivers/ptp_clock/ptp_clock.c b/drivers/ptp_clock/ptp_clock.c index fe105c5a21a..0ac0e5c242f 100644 --- a/drivers/ptp_clock/ptp_clock.c +++ b/drivers/ptp_clock/ptp_clock.c @@ -14,8 +14,8 @@ int z_vrfy_ptp_clock_get(const struct device *dev, struct net_ptp_time ptp_time; int ret; - Z_OOPS(K_SYSCALL_DRIVER_PTP_CLOCK(dev, get)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(tm, sizeof(struct net_ptp_time))); + K_OOPS(K_SYSCALL_DRIVER_PTP_CLOCK(dev, get)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(tm, sizeof(struct net_ptp_time))); ret = z_impl_ptp_clock_get((const struct device *)dev, &ptp_time); if (ret != 0) { diff --git a/drivers/pwm/pwm_handlers.c b/drivers/pwm/pwm_handlers.c index 01c3c1dca8f..3ffaaa61e46 100644 --- a/drivers/pwm/pwm_handlers.c +++ b/drivers/pwm/pwm_handlers.c @@ -12,7 +12,7 @@ static inline int z_vrfy_pwm_set_cycles(const struct device *dev, uint32_t channel, uint32_t period, 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, period, pulse, flags); } @@ -22,8 +22,8 @@ static inline int z_vrfy_pwm_get_cycles_per_sec(const struct device *dev, uint32_t channel, uint64_t *cycles) { - Z_OOPS(K_SYSCALL_DRIVER_PWM(dev, get_cycles_per_sec)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(cycles, sizeof(uint64_t))); + K_OOPS(K_SYSCALL_DRIVER_PWM(dev, get_cycles_per_sec)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(cycles, sizeof(uint64_t))); return z_impl_pwm_get_cycles_per_sec((const struct device *)dev, 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, 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); } #include @@ -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, 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); } #include @@ -57,19 +57,19 @@ static inline int z_vrfy_pwm_capture_cycles(const struct device *dev, uint32_t pulse; int err; - Z_OOPS(K_SYSCALL_DRIVER_PWM(dev, configure_capture)); - Z_OOPS(K_SYSCALL_DRIVER_PWM(dev, enable_capture)); - Z_OOPS(K_SYSCALL_DRIVER_PWM(dev, disable_capture)); + K_OOPS(K_SYSCALL_DRIVER_PWM(dev, configure_capture)); + K_OOPS(K_SYSCALL_DRIVER_PWM(dev, enable_capture)); + K_OOPS(K_SYSCALL_DRIVER_PWM(dev, disable_capture)); err = z_impl_pwm_capture_cycles((const struct device *)dev, channel, flags, &period, &pulse, timeout); 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))); } 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))); } diff --git a/drivers/retained_mem/retained_mem_handlers.c b/drivers/retained_mem/retained_mem_handlers.c index 4189bbacf3e..d344e37b42c 100644 --- a/drivers/retained_mem/retained_mem_handlers.c +++ b/drivers/retained_mem/retained_mem_handlers.c @@ -9,7 +9,7 @@ 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); } #include @@ -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, uint8_t *buffer, size_t size) { - Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RETAINED_MEM)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(buffer, size)); + K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RETAINED_MEM)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(buffer, size)); return z_impl_retained_mem_read(dev, offset, buffer, size); } #include @@ -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, const uint8_t *buffer, size_t size) { - Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RETAINED_MEM)); - Z_OOPS(K_SYSCALL_MEMORY_READ(buffer, size)); + K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RETAINED_MEM)); + K_OOPS(K_SYSCALL_MEMORY_READ(buffer, size)); return z_impl_retained_mem_write(dev, offset, buffer, size); } #include 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); } #include diff --git a/drivers/rtc/rtc_handlers.c b/drivers/rtc/rtc_handlers.c index 95d373025a4..33bb9076971 100644 --- a/drivers/rtc/rtc_handlers.c +++ b/drivers/rtc/rtc_handlers.c @@ -9,16 +9,16 @@ 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)); - Z_OOPS(K_SYSCALL_MEMORY_READ(timeptr, sizeof(struct rtc_time))); + K_OOPS(K_SYSCALL_DRIVER_RTC(dev, set_time)); + K_OOPS(K_SYSCALL_MEMORY_READ(timeptr, sizeof(struct rtc_time))); return z_impl_rtc_set_time(dev, timeptr); } #include 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)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(timeptr, sizeof(struct rtc_time))); + K_OOPS(K_SYSCALL_DRIVER_RTC(dev, get_time)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(timeptr, sizeof(struct rtc_time))); return z_impl_rtc_get_time(dev, timeptr); } #include @@ -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, uint16_t *mask) { - Z_OOPS(K_SYSCALL_DRIVER_RTC(dev, alarm_get_supported_fields)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(mask, sizeof(uint16_t))); + K_OOPS(K_SYSCALL_DRIVER_RTC(dev, alarm_get_supported_fields)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(mask, sizeof(uint16_t))); return z_impl_rtc_alarm_get_supported_fields(dev, id, mask); } #include @@ -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, const struct rtc_time *timeptr) { - Z_OOPS(K_SYSCALL_DRIVER_RTC(dev, alarm_set_time)); - Z_OOPS(K_SYSCALL_MEMORY_READ(timeptr, sizeof(struct rtc_time))); + K_OOPS(K_SYSCALL_DRIVER_RTC(dev, alarm_set_time)); + K_OOPS(K_SYSCALL_MEMORY_READ(timeptr, sizeof(struct rtc_time))); return z_impl_rtc_alarm_set_time(dev, id, mask, timeptr); } #include @@ -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, struct rtc_time *timeptr) { - Z_OOPS(K_SYSCALL_DRIVER_RTC(dev, alarm_get_time)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(mask, sizeof(uint16_t))); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(timeptr, sizeof(struct rtc_time))); + K_OOPS(K_SYSCALL_DRIVER_RTC(dev, alarm_get_time)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(mask, sizeof(uint16_t))); + K_OOPS(K_SYSCALL_MEMORY_WRITE(timeptr, sizeof(struct rtc_time))); return z_impl_rtc_alarm_get_time(dev, id, mask, timeptr); } #include 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); } #include @@ -63,7 +63,7 @@ static inline int z_vrfy_rtc_alarm_is_pending(const struct device *dev, uint16_t #ifdef CONFIG_RTC_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); } @@ -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) { - Z_OOPS(K_SYSCALL_DRIVER_RTC(dev, get_calibration)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(calibration, sizeof(int32_t))); + K_OOPS(K_SYSCALL_DRIVER_RTC(dev, get_calibration)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(calibration, sizeof(int32_t))); return z_impl_rtc_get_calibration(dev, calibration); } #include diff --git a/drivers/sensor/sensor_handlers.c b/drivers/sensor/sensor_handlers.c index a574d20b60b..4643646c215 100644 --- a/drivers/sensor/sensor_handlers.c +++ b/drivers/sensor/sensor_handlers.c @@ -12,8 +12,8 @@ static inline int z_vrfy_sensor_attr_set(const struct device *dev, enum sensor_attribute attr, const struct sensor_value *val) { - Z_OOPS(K_SYSCALL_DRIVER_SENSOR(dev, attr_set)); - Z_OOPS(K_SYSCALL_MEMORY_READ(val, sizeof(struct sensor_value))); + K_OOPS(K_SYSCALL_DRIVER_SENSOR(dev, attr_set)); + K_OOPS(K_SYSCALL_MEMORY_READ(val, sizeof(struct sensor_value))); return z_impl_sensor_attr_set((const struct device *)dev, chan, attr, (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, struct sensor_value *val) { - Z_OOPS(K_SYSCALL_DRIVER_SENSOR(dev, attr_get)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(val, sizeof(struct sensor_value))); + K_OOPS(K_SYSCALL_DRIVER_SENSOR(dev, attr_get)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(val, sizeof(struct sensor_value))); return z_impl_sensor_attr_get((const struct device *)dev, chan, attr, (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) { - 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); } #include @@ -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, 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, type); } @@ -51,8 +51,8 @@ static inline int z_vrfy_sensor_channel_get(const struct device *dev, enum sensor_channel chan, struct sensor_value *val) { - Z_OOPS(K_SYSCALL_DRIVER_SENSOR(dev, channel_get)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(val, sizeof(struct sensor_value))); + K_OOPS(K_SYSCALL_DRIVER_SENSOR(dev, channel_get)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(val, sizeof(struct sensor_value))); return z_impl_sensor_channel_get((const struct device *)dev, chan, (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, const struct sensor_decoder_api **decoder) { - Z_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_OBJ(dev, K_OBJ_DRIVER_SENSOR)); + K_OOPS(K_SYSCALL_MEMORY_READ(decoder, sizeof(struct sensor_decoder_api))); return z_impl_sensor_get_decoder(dev, decoder); } #include @@ -73,9 +73,9 @@ static inline int z_vrfy_sensor_reconfigure_read_iodev(struct rtio_iodev *iodev, const enum sensor_channel *channels, size_t num_channels) { - Z_OOPS(K_SYSCALL_OBJ(iodev, K_OBJ_RTIO_IODEV)); - Z_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_OBJ(iodev, K_OBJ_RTIO_IODEV)); + K_OOPS(K_SYSCALL_OBJ(sensor, K_OBJ_DRIVER_SENSOR)); + 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); } #include diff --git a/drivers/serial/uart_handlers.c b/drivers/serial/uart_handlers.c index 823ba718777..954592aca28 100644 --- a/drivers/serial/uart_handlers.c +++ b/drivers/serial/uart_handlers.c @@ -10,14 +10,14 @@ #define UART_SIMPLE(op_) \ 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); \ } #define UART_SIMPLE_VOID(op_) \ 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); \ } @@ -27,8 +27,8 @@ UART_SIMPLE(err_check) static inline int z_vrfy_uart_poll_in(const struct device *dev, unsigned char *p_char) { - Z_OOPS(K_SYSCALL_DRIVER_UART(dev, poll_in)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(p_char, sizeof(unsigned char))); + K_OOPS(K_SYSCALL_DRIVER_UART(dev, poll_in)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(p_char, sizeof(unsigned char))); return z_impl_uart_poll_in(dev, p_char); } #include @@ -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, uint16_t *p_u16) { - Z_OOPS(K_SYSCALL_DRIVER_UART(dev, poll_in)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(p_u16, sizeof(uint16_t))); + K_OOPS(K_SYSCALL_DRIVER_UART(dev, poll_in)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(p_u16, sizeof(uint16_t))); return z_impl_uart_poll_in_u16(dev, p_u16); } #include @@ -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, 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); } #include @@ -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, 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); } #include @@ -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, struct uart_config *cfg) { - Z_OOPS(K_SYSCALL_DRIVER_UART(dev, config_get)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(cfg, sizeof(struct uart_config))); + K_OOPS(K_SYSCALL_DRIVER_UART(dev, config_get)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(cfg, sizeof(struct uart_config))); 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, const struct uart_config *cfg) { - Z_OOPS(K_SYSCALL_DRIVER_UART(dev, config_get)); - Z_OOPS(K_SYSCALL_MEMORY_READ(cfg, sizeof(struct uart_config))); + K_OOPS(K_SYSCALL_DRIVER_UART(dev, config_get)); + K_OOPS(K_SYSCALL_MEMORY_READ(cfg, sizeof(struct uart_config))); 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, size_t len, int32_t timeout) { - Z_OOPS(K_SYSCALL_DRIVER_UART(dev, tx)); - Z_OOPS(K_SYSCALL_MEMORY_READ(buf, len)); + K_OOPS(K_SYSCALL_DRIVER_UART(dev, tx)); + K_OOPS(K_SYSCALL_MEMORY_READ(buf, len)); return z_impl_uart_tx(dev, buf, len, timeout); } #include @@ -101,8 +101,8 @@ static inline int z_vrfy_uart_tx_u16(const struct device *dev, const uint16_t *buf, size_t len, int32_t timeout) { - Z_OOPS(K_SYSCALL_DRIVER_UART(dev, tx)); - Z_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(buf, len, sizeof(uint16_t))); + K_OOPS(K_SYSCALL_DRIVER_UART(dev, tx)); + K_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(buf, len, sizeof(uint16_t))); return z_impl_uart_tx_u16(dev, buf, len, timeout); } #include @@ -115,8 +115,8 @@ static inline int z_vrfy_uart_rx_enable(const struct device *dev, uint8_t *buf, size_t len, int32_t timeout) { - Z_OOPS(K_SYSCALL_DRIVER_UART(dev, rx_enable)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(buf, len)); + K_OOPS(K_SYSCALL_DRIVER_UART(dev, rx_enable)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(buf, len)); return z_impl_uart_rx_enable(dev, buf, len, timeout); } #include @@ -126,8 +126,8 @@ static inline int z_vrfy_uart_rx_enable_u16(const struct device *dev, uint16_t *buf, size_t len, int32_t timeout) { - Z_OOPS(K_SYSCALL_DRIVER_UART(dev, rx_enable)); - Z_OOPS(K_SYSCALL_MEMORY_ARRAY_WRITE(buf, len, sizeof(uint16_t))); + K_OOPS(K_SYSCALL_DRIVER_UART(dev, rx_enable)); + K_OOPS(K_SYSCALL_MEMORY_ARRAY_WRITE(buf, len, sizeof(uint16_t))); return z_impl_uart_rx_enable_u16(dev, buf, len, timeout); } #include @@ -160,7 +160,7 @@ UART_SIMPLE(irq_update) static inline int z_vrfy_uart_line_ctrl_set(const struct device *dev, 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, 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, uint32_t ctrl, uint32_t *val) { - Z_OOPS(K_SYSCALL_DRIVER_UART(dev, line_ctrl_get)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(val, sizeof(uint32_t))); + K_OOPS(K_SYSCALL_DRIVER_UART(dev, line_ctrl_get)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(val, sizeof(uint32_t))); return z_impl_uart_line_ctrl_get((const struct device *)dev, ctrl, (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, 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); } #include diff --git a/drivers/smbus/smbus_handlers.c b/drivers/smbus/smbus_handlers.c index 5db5d12dfa8..4762ccf1e90 100644 --- a/drivers/smbus/smbus_handlers.c +++ b/drivers/smbus/smbus_handlers.c @@ -11,7 +11,7 @@ static inline int z_vrfy_smbus_configure(const struct device *dev, 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); } @@ -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, uint32_t *dev_config) { - Z_OOPS(K_SYSCALL_DRIVER_SMBUS(dev, get_config)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(dev_config, sizeof(uint32_t))); + K_OOPS(K_SYSCALL_DRIVER_SMBUS(dev, get_config)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(dev_config, sizeof(uint32_t))); 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, 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); } @@ -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, 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); } @@ -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, uint16_t addr, uint8_t *byte) { - Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(byte, sizeof(uint8_t))); + K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(byte, sizeof(uint8_t))); 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, 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); } @@ -69,8 +69,8 @@ static inline int z_vrfy_smbus_byte_data_read(const struct device *dev, uint16_t addr, uint8_t cmd, uint8_t *byte) { - Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(byte, sizeof(uint8_t))); + K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(byte, sizeof(uint8_t))); 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 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); } @@ -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 *word) { - Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(word, sizeof(uint16_t))); + K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(word, sizeof(uint16_t))); 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 send_word, uint16_t *recv_word) { - Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(recv_word, sizeof(uint16_t))); + K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(recv_word, sizeof(uint16_t))); 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, uint8_t count, uint8_t *buf) { - Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS)); - Z_OOPS(K_SYSCALL_MEMORY_READ(buf, count)); + K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS)); + K_OOPS(K_SYSCALL_MEMORY_READ(buf, count)); 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, uint8_t *count, uint8_t *buf) { - Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(count, sizeof(uint8_t))); + K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(count, sizeof(uint8_t))); 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 *rcv_count, uint8_t *rcv_buf) { - Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS)); - Z_OOPS(K_SYSCALL_MEMORY_READ(snd_buf, snd_count)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(rcv_count, sizeof(uint8_t))); + K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_SMBUS)); + K_OOPS(K_SYSCALL_MEMORY_READ(snd_buf, snd_count)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(rcv_count, sizeof(uint8_t))); return z_impl_smbus_block_pcall(dev, addr, cmd, snd_count, snd_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, 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); } @@ -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, 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); } @@ -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, 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); } @@ -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, 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); } diff --git a/drivers/spi/spi_handlers.c b/drivers/spi/spi_handlers.c index 3618d9dedcb..68b362b5ed2 100644 --- a/drivers/spi/spi_handlers.c +++ b/drivers/spi/spi_handlers.c @@ -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 */ - Z_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(bufs->buffers, + K_OOPS(K_SYSCALL_MEMORY_ARRAY_READ(bufs->buffers, bufs->count, 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]; - Z_OOPS(K_SYSCALL_MEMORY(buf->buf, buf->len, writable)); + K_OOPS(K_SYSCALL_MEMORY(buf->buf, buf->len, writable)); } 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_config config_copy; - Z_OOPS(K_SYSCALL_MEMORY_READ(config, sizeof(*config))); - Z_OOPS(K_SYSCALL_DRIVER_SPI(dev, transceive)); + K_OOPS(K_SYSCALL_MEMORY_READ(config, sizeof(*config))); + K_OOPS(K_SYSCALL_DRIVER_SPI(dev, transceive)); if (tx_bufs) { const struct spi_buf_set *tx = (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))); 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 { 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_bufs; - Z_OOPS(K_SYSCALL_MEMORY_READ(rx_bufs, + K_OOPS(K_SYSCALL_MEMORY_READ(rx_bufs, sizeof(struct spi_buf_set))); 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 { memset(&rx_bufs_copy, 0, sizeof(rx_bufs_copy)); } memcpy(&config_copy, config, sizeof(*config)); 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)); } @@ -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, const struct spi_config *config) { - Z_OOPS(K_SYSCALL_MEMORY_READ(config, sizeof(*config))); - Z_OOPS(K_SYSCALL_DRIVER_SPI(dev, release)); + K_OOPS(K_SYSCALL_MEMORY_READ(config, sizeof(*config))); + K_OOPS(K_SYSCALL_DRIVER_SPI(dev, release)); return z_impl_spi_release((const struct device *)dev, config); } #include diff --git a/drivers/usb/bc12/bc12_handlers.c b/drivers/usb/bc12/bc12_handlers.c index 0e4e6d83e25..dce82695a14 100644 --- a/drivers/usb/bc12/bc12_handlers.c +++ b/drivers/usb/bc12/bc12_handlers.c @@ -9,7 +9,7 @@ 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); } @@ -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, void *user_data) { - Z_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_DRIVER_BC12(dev, set_result_cb)); + 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); } diff --git a/drivers/virtualization/virt_ivshmem_handlers.c b/drivers/virtualization/virt_ivshmem_handlers.c index 8f6221c8160..821ab16f304 100644 --- a/drivers/virtualization/virt_ivshmem_handlers.c +++ b/drivers/virtualization/virt_ivshmem_handlers.c @@ -11,8 +11,8 @@ static inline size_t z_vrfy_ivshmem_get_mem(const struct device *dev, uintptr_t *memmap) { - Z_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, get_mem)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(memmap, sizeof(uintptr_t))); + K_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, get_mem)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(memmap, sizeof(uintptr_t))); 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) { - 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); } @@ -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) { - 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); } @@ -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, 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); } @@ -47,8 +47,8 @@ static inline int z_vrfy_ivshmem_register_handler(const struct device *dev, struct k_poll_signal *signal, uint16_t vector) { - Z_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, register_handler)); - Z_OOPS(K_SYSCALL_OBJ(signal, K_OBJ_POLL_SIGNAL)); + K_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, register_handler)); + K_OOPS(K_SYSCALL_OBJ(signal, K_OBJ_POLL_SIGNAL)); 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, uintptr_t *memmap) { - Z_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, get_rw_mem_section)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(memmap, sizeof(uintptr_t))); + K_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, get_rw_mem_section)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(memmap, sizeof(uintptr_t))); 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, uintptr_t *memmap) { - Z_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, get_output_mem_section)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(memmap, sizeof(uintptr_t))); + K_OOPS(K_SYSCALL_DRIVER_IVSHMEM(dev, get_output_mem_section)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(memmap, sizeof(uintptr_t))); 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, 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); } @@ -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, 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); } @@ -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) { - 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); } @@ -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) { - 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); } @@ -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, 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); } diff --git a/drivers/w1/w1_handlers.c b/drivers/w1/w1_handlers.c index 496fc7a4cca..f2299705a26 100644 --- a/drivers/w1/w1_handlers.c +++ b/drivers/w1/w1_handlers.c @@ -9,7 +9,7 @@ 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); } @@ -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) { - 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); } @@ -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) { - 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); } @@ -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) { - 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); } @@ -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) { - 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); } @@ -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, uint8_t *buffer, size_t len) { - Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_W1)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(buffer, len)); + K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_W1)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(buffer, len)); return z_impl_w1_read_block((const struct device *)dev, (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, const uint8_t *buffer, size_t len) { - Z_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_W1)); - Z_OOPS(K_SYSCALL_MEMORY_READ(buffer, len)); + K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_W1)); + K_OOPS(K_SYSCALL_MEMORY_READ(buffer, len)); return z_impl_w1_write_block((const struct device *)dev, (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) { - 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); } @@ -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, 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); } @@ -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) { - 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); } @@ -100,9 +100,9 @@ static inline int z_vrfy_w1_search_bus(const struct device *dev, w1_search_callback_t callback, 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")); /* user_data is not dereferenced, no need to check parameter */ diff --git a/drivers/watchdog/wdt_handlers.c b/drivers/watchdog/wdt_handlers.c index 66f99c6590d..2ac872f1379 100644 --- a/drivers/watchdog/wdt_handlers.c +++ b/drivers/watchdog/wdt_handlers.c @@ -9,7 +9,7 @@ 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); } @@ -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) { - Z_OOPS(K_SYSCALL_DRIVER_WDT(dev, disable)); + K_OOPS(K_SYSCALL_DRIVER_WDT(dev, disable)); 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) { - Z_OOPS(K_SYSCALL_DRIVER_WDT(dev, feed)); + K_OOPS(K_SYSCALL_DRIVER_WDT(dev, feed)); return z_impl_wdt_feed(dev, channel_id); } diff --git a/include/zephyr/internal/syscall_handler.h b/include/zephyr/internal/syscall_handler.h index ff39f5cd9a0..568c0e7b693 100644 --- a/include/zephyr/internal/syscall_handler.h +++ b/include/zephyr/internal/syscall_handler.h @@ -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); -#define Z_OOPS(expr) \ +#define K_OOPS(expr) \ do { \ if (expr) { \ arch_syscall_oops(_current->syscall_frame); \ diff --git a/kernel/atomic_c.c b/kernel/atomic_c.c index 21ca934f012..1790953cb11 100644 --- a/kernel/atomic_c.c +++ b/kernel/atomic_c.c @@ -42,7 +42,7 @@ static struct k_spinlock lock; #define ATOMIC_SYSCALL_HANDLER_TARGET(name) \ 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); \ } @@ -50,7 +50,7 @@ static struct k_spinlock lock; static inline atomic_val_t z_vrfy_##name(atomic_t *target, \ 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); \ } #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, 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); } @@ -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 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); } @@ -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, 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); } diff --git a/kernel/condvar.c b/kernel/condvar.c index 25e873e7f89..1aa26e937d3 100644 --- a/kernel/condvar.c +++ b/kernel/condvar.c @@ -35,7 +35,7 @@ int z_impl_k_condvar_init(struct k_condvar *condvar) #ifdef CONFIG_USERSPACE 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); } #include @@ -67,7 +67,7 @@ int z_impl_k_condvar_signal(struct k_condvar *condvar) #ifdef CONFIG_USERSPACE 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); } #include @@ -100,7 +100,7 @@ int z_impl_k_condvar_broadcast(struct k_condvar *condvar) #ifdef CONFIG_USERSPACE 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); } #include @@ -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, k_timeout_t timeout) { - Z_OOPS(K_SYSCALL_OBJ(condvar, K_OBJ_CONDVAR)); - Z_OOPS(K_SYSCALL_OBJ(mutex, K_OBJ_MUTEX)); + K_OOPS(K_SYSCALL_OBJ(condvar, K_OBJ_CONDVAR)); + K_OOPS(K_SYSCALL_OBJ(mutex, K_OBJ_MUTEX)); return z_impl_k_condvar_wait(condvar, mutex, timeout); } #include diff --git a/kernel/device.c b/kernel/device.c index a757fc73863..6124ada5140 100644 --- a/kernel/device.c +++ b/kernel/device.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) { - 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); } diff --git a/kernel/events.c b/kernel/events.c index 793fd340bc5..8cb90dc6160 100644 --- a/kernel/events.c +++ b/kernel/events.c @@ -68,7 +68,7 @@ void z_impl_k_event_init(struct k_event *event) #ifdef CONFIG_USERSPACE 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); } #include @@ -187,7 +187,7 @@ uint32_t z_impl_k_event_post(struct k_event *event, uint32_t events) #ifdef CONFIG_USERSPACE 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); } #include @@ -201,7 +201,7 @@ uint32_t z_impl_k_event_set(struct k_event *event, uint32_t events) #ifdef CONFIG_USERSPACE 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); } #include @@ -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 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); } #include @@ -231,7 +231,7 @@ uint32_t z_impl_k_event_clear(struct k_event *event, uint32_t events) #ifdef CONFIG_USERSPACE 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); } #include @@ -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, 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); } #include @@ -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, 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); } #include diff --git a/kernel/msg_q.c b/kernel/msg_q.c index cd3c8e48ff5..e11e9a2527e 100644 --- a/kernel/msg_q.c +++ b/kernel/msg_q.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, 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); } @@ -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, k_timeout_t timeout) { - Z_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ)); - Z_OOPS(K_SYSCALL_MEMORY_READ(data, msgq->msg_size)); + K_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ)); + K_OOPS(K_SYSCALL_MEMORY_READ(data, msgq->msg_size)); 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, struct k_msgq_attrs *attrs) { - Z_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(attrs, sizeof(struct k_msgq_attrs))); + K_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(attrs, sizeof(struct k_msgq_attrs))); z_impl_k_msgq_get_attrs(msgq, attrs); } #include @@ -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, k_timeout_t timeout) { - Z_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(data, msgq->msg_size)); + K_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(data, msgq->msg_size)); 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 static inline int z_vrfy_k_msgq_peek(struct k_msgq *msgq, void *data) { - Z_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(data, msgq->msg_size)); + K_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(data, msgq->msg_size)); 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 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)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(data, msgq->msg_size)); + K_OOPS(K_SYSCALL_OBJ(msgq, K_OBJ_MSGQ)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(data, msgq->msg_size)); 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 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); } #include 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); } #include 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); } #include diff --git a/kernel/mutex.c b/kernel/mutex.c index d06522a0420..6d22ce83f22 100644 --- a/kernel/mutex.c +++ b/kernel/mutex.c @@ -71,7 +71,7 @@ int z_impl_k_mutex_init(struct k_mutex *mutex) #ifdef CONFIG_USERSPACE 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); } #include @@ -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, 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); } #include @@ -284,7 +284,7 @@ k_mutex_unlock_return: #ifdef CONFIG_USERSPACE 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); } #include diff --git a/kernel/paging/statistics.c b/kernel/paging/statistics.c index 87cd2b04b68..b2f343c9fcb 100644 --- a/kernel/paging/statistics.c +++ b/kernel/paging/statistics.c @@ -102,7 +102,7 @@ void z_impl_k_mem_paging_stats_get(struct k_mem_paging_stats_t *stats) static inline 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); } #include @@ -125,8 +125,8 @@ static inline void z_vrfy_k_mem_paging_thread_stats_get(struct k_thread *thread, struct k_mem_paging_stats_t *stats) { - Z_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(stats, sizeof(*stats))); + K_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(stats, sizeof(*stats))); z_impl_k_mem_paging_thread_stats_get(thread, stats); } #include @@ -224,7 +224,7 @@ static inline void z_vrfy_k_mem_paging_histogram_eviction_get( 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); } #include @@ -233,7 +233,7 @@ static inline void z_vrfy_k_mem_paging_histogram_backing_store_page_in_get( 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); } #include @@ -242,7 +242,7 @@ static inline void z_vrfy_k_mem_paging_histogram_backing_store_page_out_get( 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); } #include diff --git a/kernel/pipes.c b/kernel/pipes.c index 01c5f36b906..3fa1c72036d 100644 --- a/kernel/pipes.c +++ b/kernel/pipes.c @@ -89,7 +89,7 @@ int z_impl_k_pipe_alloc_init(struct k_pipe *pipe, size_t size) #ifdef CONFIG_USERSPACE 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); } @@ -122,7 +122,7 @@ void z_impl_k_pipe_flush(struct k_pipe *pipe) #ifdef CONFIG_USERSPACE 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); } @@ -150,7 +150,7 @@ void z_impl_k_pipe_buffer_flush(struct k_pipe *pipe) #ifdef CONFIG_USERSPACE 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); } @@ -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, k_timeout_t timeout) { - Z_OOPS(K_SYSCALL_OBJ(pipe, K_OBJ_PIPE)); - Z_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_OBJ(pipe, K_OBJ_PIPE)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(bytes_written, sizeof(*bytes_written))); + K_OOPS(K_SYSCALL_MEMORY_READ((void *)data, bytes_to_write)); return z_impl_k_pipe_put((struct k_pipe *)pipe, (void *)data, 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, size_t *bytes_read, size_t min_xfer, k_timeout_t timeout) { - Z_OOPS(K_SYSCALL_OBJ(pipe, K_OBJ_PIPE)); - Z_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_OBJ(pipe, K_OBJ_PIPE)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(bytes_read, sizeof(*bytes_read))); + K_OOPS(K_SYSCALL_MEMORY_WRITE((void *)data, bytes_to_read)); return z_impl_k_pipe_get((struct k_pipe *)pipe, (void *)data, bytes_to_read, bytes_read, min_xfer, @@ -766,7 +766,7 @@ out: #ifdef CONFIG_USERSPACE 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); } @@ -803,7 +803,7 @@ out: #ifdef CONFIG_USERSPACE 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); } diff --git a/kernel/poll.c b/kernel/poll.c index 3c0c94744ad..d983af7e20e 100644 --- a/kernel/poll.c +++ b/kernel/poll.c @@ -402,20 +402,20 @@ static inline int z_vrfy_k_poll(struct k_poll_event *events, case K_POLL_TYPE_IGNORE: break; 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; 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; 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; 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; #ifdef CONFIG_PIPES 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; #endif default: @@ -432,7 +432,7 @@ out: return ret; oops_free: k_free(events_copy); - Z_OOPS(1); + K_OOPS(1); } #include #endif @@ -490,7 +490,7 @@ void z_impl_k_poll_signal_init(struct k_poll_signal *sig) #ifdef CONFIG_USERSPACE 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); } #include @@ -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, unsigned int *signaled, int *result) { - Z_OOPS(K_SYSCALL_OBJ(sig, K_OBJ_POLL_SIGNAL)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(signaled, sizeof(unsigned int))); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(result, sizeof(int))); + K_OOPS(K_SYSCALL_OBJ(sig, K_OBJ_POLL_SIGNAL)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(signaled, sizeof(unsigned int))); + K_OOPS(K_SYSCALL_MEMORY_WRITE(result, sizeof(int))); z_impl_k_poll_signal_check(sig, signaled, result); } #include @@ -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, 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); } #include 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); } #include diff --git a/kernel/queue.c b/kernel/queue.c index d1f9a4344ad..04aaa149d97 100644 --- a/kernel/queue.c +++ b/kernel/queue.c @@ -72,7 +72,7 @@ void z_impl_k_queue_init(struct k_queue *queue) #ifdef CONFIG_USERSPACE 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); } #include @@ -114,7 +114,7 @@ void z_impl_k_queue_cancel_wait(struct k_queue *queue) #ifdef CONFIG_USERSPACE 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); } #include @@ -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, 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); } #include @@ -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, 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); } #include @@ -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, 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); } #include 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); } #include 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); } #include 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); } #include diff --git a/kernel/sched.c b/kernel/sched.c index f1593d442a0..ffd3070f187 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -689,7 +689,7 @@ void z_impl_k_thread_suspend(struct k_thread *thread) #ifdef CONFIG_USERSPACE 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); } #include @@ -718,7 +718,7 @@ void z_impl_k_thread_resume(struct k_thread *thread) #ifdef CONFIG_USERSPACE 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); } #include @@ -1335,7 +1335,7 @@ int z_impl_k_thread_priority_get(k_tid_t thread) #ifdef CONFIG_USERSPACE 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); } #include @@ -1358,10 +1358,10 @@ void z_impl_k_thread_priority_set(k_tid_t thread, int prio) #ifdef CONFIG_USERSPACE static inline void z_vrfy_k_thread_priority_set(k_tid_t thread, int prio) { - Z_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD)); - Z_OOPS(K_SYSCALL_VERIFY_MSG(_is_valid_prio(prio, NULL), + K_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD)); + K_OOPS(K_SYSCALL_VERIFY_MSG(_is_valid_prio(prio, NULL), "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)", 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; - Z_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD)); - Z_OOPS(K_SYSCALL_VERIFY_MSG(deadline > 0, + K_OOPS(K_SYSCALL_OBJ(thread, K_OBJ_THREAD)); + K_OOPS(K_SYSCALL_VERIFY_MSG(deadline > 0, "invalid thread deadline %d", (int)deadline)); @@ -1583,7 +1583,7 @@ void z_sched_ipi(void) #ifdef CONFIG_USERSPACE 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); } #include @@ -1890,7 +1890,7 @@ static bool thread_obj_validate(struct k_thread *thread) #ifdef CONFIG_LOG k_object_dump_error(ret, thread, ko, K_OBJ_THREAD); #endif - Z_OOPS(K_SYSCALL_VERIFY_MSG(ret, "access denied")); + K_OOPS(K_SYSCALL_VERIFY_MSG(ret, "access denied")); } CODE_UNREACHABLE; /* LCOV_EXCL_LINE */ } @@ -1912,7 +1912,7 @@ static inline void z_vrfy_k_thread_abort(k_tid_t thread) 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)); z_impl_k_thread_abort((struct k_thread *)thread); diff --git a/kernel/sem.c b/kernel/sem.c index b7e04207929..2f8de51ed83 100644 --- a/kernel/sem.c +++ b/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, 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); } #include @@ -123,7 +123,7 @@ void z_impl_k_sem_give(struct k_sem *sem) #ifdef CONFIG_USERSPACE 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); } #include @@ -188,21 +188,21 @@ void z_impl_k_sem_reset(struct k_sem *sem) #ifdef CONFIG_USERSPACE 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); } #include 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); } #include 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); } #include diff --git a/kernel/stack.c b/kernel/stack.c index 72db870b6ea..6ada39c9b1e 100644 --- a/kernel/stack.c +++ b/kernel/stack.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, uint32_t num_entries) { - Z_OOPS(K_SYSCALL_OBJ_NEVER_INIT(stack, K_OBJ_STACK)); - Z_OOPS(K_SYSCALL_VERIFY(num_entries > 0)); + K_OOPS(K_SYSCALL_OBJ_NEVER_INIT(stack, K_OBJ_STACK)); + K_OOPS(K_SYSCALL_VERIFY(num_entries > 0)); return z_impl_k_stack_alloc_init(stack, num_entries); } #include @@ -132,7 +132,7 @@ end: #ifdef CONFIG_USERSPACE 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); } @@ -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, stack_data_t *data, k_timeout_t timeout) { - Z_OOPS(K_SYSCALL_OBJ(stack, K_OBJ_STACK)); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(data, sizeof(stack_data_t))); + K_OOPS(K_SYSCALL_OBJ(stack, K_OBJ_STACK)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(data, sizeof(stack_data_t))); return z_impl_k_stack_pop(stack, data, timeout); } #include diff --git a/kernel/thread.c b/kernel/thread.c index 42327565eff..7741f7acc66 100644 --- a/kernel/thread.c +++ b/kernel/thread.c @@ -433,7 +433,7 @@ void z_impl_k_thread_start(struct k_thread *thread) #ifdef CONFIG_USERSPACE 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); } #include @@ -728,13 +728,13 @@ k_tid_t z_vrfy_k_thread_create(struct k_thread *new_thread, struct k_object *stack_object; /* 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 * object table if it isn't */ 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, _OBJ_INIT_FALSE) == 0, "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 * 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 overflow (%zu+%zu)", stack_size, @@ -756,21 +756,21 @@ k_tid_t z_vrfy_k_thread_create(struct k_thread *new_thread, #else stack_obj_size = stack_object->data.stack_size; #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", total_size, stack_obj_size)); /* User threads may only create other user threads and they can't * be marked as essential */ - Z_OOPS(K_SYSCALL_VERIFY(options & K_USER)); - Z_OOPS(K_SYSCALL_VERIFY(!(options & K_ESSENTIAL))); + K_OOPS(K_SYSCALL_VERIFY(options & K_USER)); + K_OOPS(K_SYSCALL_VERIFY(!(options & K_ESSENTIAL))); /* Check validity of prio argument; must be the same or worse priority * than the caller */ - Z_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(_is_valid_prio(prio, NULL))); + K_OOPS(K_SYSCALL_VERIFY(z_is_prio_lower_or_equal(prio, _current->base.prio))); 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 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); } #include @@ -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( 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); } #include @@ -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( 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); } #include diff --git a/kernel/timer.c b/kernel/timer.c index 09ec65541c1..48cc69baffe 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -185,7 +185,7 @@ static inline void z_vrfy_k_timer_start(struct k_timer *timer, k_timeout_t duration, 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); } #include @@ -218,7 +218,7 @@ void z_impl_k_timer_stop(struct k_timer *timer) #ifdef CONFIG_USERSPACE 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); } #include @@ -238,7 +238,7 @@ uint32_t z_impl_k_timer_status_get(struct k_timer *timer) #ifdef CONFIG_USERSPACE 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); } #include @@ -306,7 +306,7 @@ uint32_t z_impl_k_timer_status_sync(struct k_timer *timer) #ifdef CONFIG_USERSPACE 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); } #include @@ -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( 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); } #include @@ -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( 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); } #include 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); } #include @@ -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, 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); } #include diff --git a/kernel/userspace_handler.c b/kernel/userspace_handler.c index 616b6954182..a1cf9f9d7a3 100644 --- a/kernel/userspace_handler.c +++ b/kernel/userspace_handler.c @@ -58,9 +58,9 @@ static inline void z_vrfy_k_object_access_grant(const void *object, { 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); - 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)); 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; 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)); k_thread_perms_clear(ko, _current); } diff --git a/lib/libc/arcmwdt/libc-hooks.c b/lib/libc/arcmwdt/libc-hooks.c index 3a79f45afe7..babf24ebda8 100644 --- a/lib/libc/arcmwdt/libc-hooks.c +++ b/lib/libc/arcmwdt/libc-hooks.c @@ -56,7 +56,7 @@ int z_impl_zephyr_write_stdout(const void *buffer, int nbytes) #ifdef CONFIG_USERSPACE 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); } #include diff --git a/lib/libc/minimal/source/stdout/stdout_console.c b/lib/libc/minimal/source/stdout/stdout_console.c index ab3777fbf91..33ea7ffaa66 100644 --- a/lib/libc/minimal/source/stdout/stdout_console.c +++ b/lib/libc/minimal/source/stdout/stdout_console.c @@ -101,7 +101,7 @@ static inline size_t z_vrfy_zephyr_fwrite(const void *ZRESTRICT ptr, 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, nitems, (FILE *ZRESTRICT)stream); } diff --git a/lib/libc/newlib/libc-hooks.c b/lib/libc/newlib/libc-hooks.c index 294db355e5a..88a83742a50 100644 --- a/lib/libc/newlib/libc-hooks.c +++ b/lib/libc/newlib/libc-hooks.c @@ -181,7 +181,7 @@ int z_impl_zephyr_read_stdin(char *buf, int nbytes) #ifdef CONFIG_USERSPACE 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); } #include @@ -204,7 +204,7 @@ int z_impl_zephyr_write_stdout(const void *buffer, int nbytes) #ifdef CONFIG_USERSPACE 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); } #include diff --git a/lib/os/printk.c b/lib/os/printk.c index 970574528ee..f46b950ffe4 100644 --- a/lib/os/printk.c +++ b/lib/os/printk.c @@ -174,7 +174,7 @@ void z_impl_k_str_out(char *c, size_t n) #ifdef CONFIG_USERSPACE 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); } #include diff --git a/lib/posix/clock.c b/lib/posix/clock.c index 98d6a8161da..d7ca3969aa8 100644 --- a/lib/posix/clock.c +++ b/lib/posix/clock.c @@ -68,7 +68,7 @@ int z_impl_clock_gettime(clockid_t clock_id, struct timespec *ts) #ifdef CONFIG_USERSPACE 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); } #include diff --git a/scripts/build/gen_syscalls.py b/scripts/build/gen_syscalls.py index 8703352b133..68d0f15f48b 100755 --- a/scripts/build/gen_syscalls.py +++ b/scripts/build/gen_syscalls.py @@ -322,7 +322,7 @@ def marshall_defs(func_name, func_type, args): mrsh += "\t(void) arg%d;\t/* unused */\n" % unused_arg 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") argnum = 0 @@ -349,7 +349,7 @@ def marshall_defs(func_name, func_type, args): if need_split(func_type): 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" + "_current->syscall_frame = NULL;\n" mrsh += "\t" + "return 0;\n" diff --git a/subsys/logging/log_mgmt.c b/subsys/logging/log_mgmt.c index eb7d82f483a..6336e4a8385 100644 --- a/subsys/logging/log_mgmt.c +++ b/subsys/logging/log_mgmt.c @@ -449,13 +449,13 @@ uint32_t z_vrfy_log_filter_set(struct log_backend const *const backend, int16_t src_id, 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")); - 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")); - 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")); - Z_OOPS(K_SYSCALL_VERIFY_MSG( + K_OOPS(K_SYSCALL_VERIFY_MSG( (level <= LOG_LEVEL_DBG), "Invalid log level")); diff --git a/subsys/net/ip/net_if.c b/subsys/net/ip/net_if.c index 72a5de8e3cc..9f5a3306f94 100644 --- a/subsys/net/ip/net_if.c +++ b/subsys/net/ip/net_if.c @@ -1589,7 +1589,7 @@ static inline int z_vrfy_net_if_ipv6_addr_lookup_by_index( { 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); } @@ -1929,7 +1929,7 @@ bool z_vrfy_net_if_ipv6_addr_add_by_index(int index, 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, &addr_v6, @@ -1965,7 +1965,7 @@ bool z_vrfy_net_if_ipv6_addr_rm_by_index(int index, 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); } @@ -3526,7 +3526,7 @@ static inline int z_vrfy_net_if_ipv4_addr_lookup_by_index( { 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); } @@ -3578,7 +3578,7 @@ bool z_vrfy_net_if_ipv4_set_netmask_by_index(int index, 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))); 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; } - 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); } @@ -3805,7 +3805,7 @@ bool z_vrfy_net_if_ipv4_addr_add_by_index(int index, 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, &addr_v4, @@ -3841,7 +3841,7 @@ bool z_vrfy_net_if_ipv4_addr_rm_by_index(int index, 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); } diff --git a/subsys/net/ip/utils.c b/subsys/net/ip/utils.c index 7333f140805..0e3bbce5d33 100644 --- a/subsys/net/ip/utils.c +++ b/subsys/net/ip/utils.c @@ -304,14 +304,14 @@ char *z_vrfy_net_addr_ntop(sa_family_t family, const void *src, char *out; const void *addr; - Z_OOPS(K_SYSCALL_MEMORY_WRITE(dst, size)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(dst, size)); 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))); addr = &addr4; } 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))); addr = &addr6; } else { @@ -323,7 +323,7 @@ char *z_vrfy_net_addr_ntop(sa_family_t family, const void *src, 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; } @@ -488,14 +488,14 @@ int z_vrfy_net_addr_pton(sa_family_t family, const char *src, 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); if (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; } diff --git a/subsys/net/lib/sockets/getaddrinfo.c b/subsys/net/lib/sockets/getaddrinfo.c index b5285feb156..70a611a3f4a 100644 --- a/subsys/net/lib/sockets/getaddrinfo.c +++ b/subsys/net/lib/sockets/getaddrinfo.c @@ -281,10 +281,10 @@ static inline int z_vrfy_z_zsock_getaddrinfo_internal(const char *host, uint32_t ret; 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))); } - 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) { service_copy = k_usermode_string_alloc_copy((char *)service, 64); diff --git a/subsys/net/lib/sockets/socketpair.c b/subsys/net/lib/sockets/socketpair.c index 80f7a61ea22..417a3b34fb1 100644 --- a/subsys/net/lib/sockets/socketpair.c +++ b/subsys/net/lib/sockets/socketpair.c @@ -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); if (ret == 0) { - Z_OOPS(k_usermode_to_copy(sv, tmp, sizeof(tmp))); + K_OOPS(k_usermode_to_copy(sv, tmp, sizeof(tmp))); } out: diff --git a/subsys/net/lib/sockets/sockets.c b/subsys/net/lib/sockets/sockets.c index 050b0c1c533..9dadc452a26 100644 --- a/subsys/net/lib/sockets/sockets.c +++ b/subsys/net/lib/sockets/sockets.c @@ -482,8 +482,8 @@ static inline int z_vrfy_zsock_bind(int sock, const struct sockaddr *addr, { struct sockaddr_storage dest_addr_copy; - Z_OOPS(K_SYSCALL_VERIFY(addrlen <= sizeof(dest_addr_copy))); - Z_OOPS(k_usermode_from_copy(&dest_addr_copy, (void *)addr, addrlen)); + K_OOPS(K_SYSCALL_VERIFY(addrlen <= sizeof(dest_addr_copy))); + K_OOPS(k_usermode_from_copy(&dest_addr_copy, (void *)addr, addrlen)); return z_impl_zsock_bind(sock, (struct sockaddr *)&dest_addr_copy, addrlen); @@ -561,8 +561,8 @@ int z_vrfy_zsock_connect(int sock, const struct sockaddr *addr, { struct sockaddr_storage dest_addr_copy; - Z_OOPS(K_SYSCALL_VERIFY(addrlen <= sizeof(dest_addr_copy))); - Z_OOPS(k_usermode_from_copy(&dest_addr_copy, (void *)addr, addrlen)); + K_OOPS(K_SYSCALL_VERIFY(addrlen <= sizeof(dest_addr_copy))); + K_OOPS(k_usermode_from_copy(&dest_addr_copy, (void *)addr, addrlen)); return z_impl_zsock_connect(sock, (struct sockaddr *)&dest_addr_copy, addrlen); @@ -693,14 +693,14 @@ static inline int z_vrfy_zsock_accept(int sock, struct sockaddr *addr, socklen_t addrlen_copy; 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))); - 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, 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))); 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; - Z_OOPS(K_SYSCALL_MEMORY_READ(buf, len)); + K_OOPS(K_SYSCALL_MEMORY_READ(buf, len)); if (dest_addr) { - Z_OOPS(K_SYSCALL_VERIFY(addrlen <= sizeof(dest_addr_copy))); - Z_OOPS(k_usermode_from_copy(&dest_addr_copy, (void *)dest_addr, + K_OOPS(K_SYSCALL_VERIFY(addrlen <= sizeof(dest_addr_copy))); + K_OOPS(k_usermode_from_copy(&dest_addr_copy, (void *)dest_addr, addrlen)); } @@ -950,7 +950,7 @@ static inline ssize_t z_vrfy_zsock_sendmsg(int sock, size_t i; 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_control = NULL; @@ -1520,17 +1520,17 @@ ssize_t z_vrfy_zsock_recvfrom(int sock, void *buf, size_t max_len, int flags, } if (addrlen) { - Z_OOPS(k_usermode_from_copy(&addrlen_copy, addrlen, + K_OOPS(k_usermode_from_copy(&addrlen_copy, addrlen, 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, (struct sockaddr *)src_addr, addrlen ? &addrlen_copy : NULL); if (addrlen) { - Z_OOPS(k_usermode_to_copy(addrlen, &addrlen_copy, + K_OOPS(k_usermode_to_copy(addrlen, &addrlen_copy, sizeof(socklen_t))); } @@ -1609,7 +1609,7 @@ static inline int z_vrfy_zsock_ioctl(int sock, unsigned long request, va_list ar int *avail; avail = va_arg(args, int *); - Z_OOPS(K_SYSCALL_MEMORY_WRITE(avail, sizeof(*avail))); + K_OOPS(K_SYSCALL_MEMORY_WRITE(avail, sizeof(*avail))); break; } @@ -1954,9 +1954,9 @@ static inline int z_vrfy_zsock_inet_pton(sa_family_t family, 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); - Z_OOPS(k_usermode_to_copy(dst, dst_copy, dst_size)); + K_OOPS(k_usermode_to_copy(dst, dst_copy, dst_size)); 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_optlen); - Z_OOPS(!kernel_optval); + K_OOPS(!kernel_optval); ret = z_impl_zsock_getsockopt(sock, level, optname, kernel_optval, &kernel_optlen); - Z_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 *)optval, kernel_optval, kernel_optlen)); + K_OOPS(k_usermode_to_copy((void *)optlen, &kernel_optlen, sizeof(socklen_t))); k_free(kernel_optval); @@ -2518,7 +2518,7 @@ int z_vrfy_zsock_setsockopt(int sock, int level, int optname, int ret; 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, kernel_optval, optlen); @@ -2591,7 +2591,7 @@ static inline int z_vrfy_zsock_getpeername(int sock, struct sockaddr *addr, socklen_t addrlen_copy; 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))); 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; 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))); if (K_SYSCALL_MEMORY_WRITE(addr, addrlen_copy)) { diff --git a/subsys/net/lib/sockets/sockets_misc.c b/subsys/net/lib/sockets/sockets_misc.c index 65b9b27af2d..fb3750e110a 100644 --- a/subsys/net/lib/sockets/sockets_misc.c +++ b/subsys/net/lib/sockets/sockets_misc.c @@ -20,7 +20,7 @@ int z_impl_zsock_gethostname(char *buf, size_t len) #ifdef CONFIG_USERSPACE 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); } #include diff --git a/subsys/random/rand32_handlers.c b/subsys/random/rand32_handlers.c index e51d3d0c2b2..38344a00190 100644 --- a/subsys/random/rand32_handlers.c +++ b/subsys/random/rand32_handlers.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) { - Z_OOPS(K_SYSCALL_MEMORY_WRITE(dst, len)); + K_OOPS(K_SYSCALL_MEMORY_WRITE(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 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); } diff --git a/subsys/rtio/rtio_handlers.c b/subsys/rtio/rtio_handlers.c index 30c876e056f..3930d5bdee9 100644 --- a/subsys/rtio/rtio_handlers.c +++ b/subsys/rtio/rtio_handlers.c @@ -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) { - 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); } #include @@ -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, uint8_t **buff, uint32_t *buff_len) { - Z_OOPS(K_SYSCALL_OBJ(r, K_OBJ_RTIO)); - Z_OOPS(K_SYSCALL_MEMORY_READ(cqe, sizeof(struct rtio_cqe))); - Z_OOPS(K_SYSCALL_MEMORY_READ(buff, sizeof(void *))); - Z_OOPS(K_SYSCALL_MEMORY_READ(buff_len, sizeof(uint32_t))); + K_OOPS(K_SYSCALL_OBJ(r, K_OBJ_RTIO)); + K_OOPS(K_SYSCALL_MEMORY_READ(cqe, sizeof(struct rtio_cqe))); + K_OOPS(K_SYSCALL_MEMORY_READ(buff, sizeof(void *))); + K_OOPS(K_SYSCALL_MEMORY_READ(buff_len, sizeof(uint32_t))); return z_impl_rtio_cqe_get_mempool_buffer(r, cqe, buff, buff_len); } #include @@ -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, 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; 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)) { 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, 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); } @@ -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) { - Z_OOPS(K_SYSCALL_OBJ(r, K_OBJ_RTIO)); + K_OOPS(K_SYSCALL_OBJ(r, K_OBJ_RTIO)); #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 return z_impl_rtio_submit(r, wait_count); diff --git a/tests/kernel/mem_protect/syscalls/src/main.c b/tests/kernel/mem_protect/syscalls/src/main.c index 258237d99e0..ed57d7e9120 100644 --- a/tests/kernel/mem_protect/syscalls/src/main.c +++ b/tests/kernel/mem_protect/syscalls/src/main.c @@ -59,7 +59,7 @@ static inline size_t z_vrfy_string_nlen(char *src, size_t maxlen, int *err) 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; } diff --git a/tests/kernel/threads/thread_stack/src/main.c b/tests/kernel/threads/thread_stack/src/main.c index b3bfe73c0b8..a2ea5e95753 100644 --- a/tests/kernel/threads/thread_stack/src/main.c +++ b/tests/kernel/threads/thread_stack/src/main.c @@ -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, size_t *size) { - Z_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(start_addr, sizeof(uintptr_t))); + K_OOPS(K_SYSCALL_MEMORY_WRITE(size, sizeof(size_t))); z_impl_stack_info_get(start_addr, size); } diff --git a/tests/ztest/error_hook/README.txt b/tests/ztest/error_hook/README.txt index 5ca44e9e330..1304cce5ab0 100644 --- a/tests/ztest/error_hook/README.txt +++ b/tests/ztest/error_hook/README.txt @@ -80,7 +80,7 @@ test_catch_assert_in_isr test_catch_z_oops - 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). diff --git a/tests/ztest/error_hook/src/main.c b/tests/ztest/error_hook/src/main.c index cba35ce46b4..e38b3111cf3 100644 --- a/tests/ztest/error_hook/src/main.c +++ b/tests/ztest/error_hook/src/main.c @@ -31,7 +31,7 @@ enum { ZTEST_CATCH_FATAL_IN_ISR, ZTEST_CATCH_ASSERT_FAIL, ZTEST_CATCH_ASSERT_IN_ISR, - ZTEST_CATCH_USER_FATAL_Z_OOPS, + ZTEST_CATCH_USER_FATAL_K_OOPS, ZTEST_ERROR_MAX } 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_K_PANIC: case ZTEST_CATCH_FATAL_K_OOPS: - case ZTEST_CATCH_USER_FATAL_Z_OOPS: + case ZTEST_CATCH_USER_FATAL_K_OOPS: zassert_true(true); break; @@ -338,7 +338,7 @@ static void trigger_z_oops(void) /* Set up a dummy syscall frame, pointing to a valid area in memory. */ _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) { - case_type = ZTEST_CATCH_USER_FATAL_Z_OOPS; + case_type = ZTEST_CATCH_USER_FATAL_K_OOPS; ztest_set_fault_valid(true); trigger_z_oops();