syscall: rename Z_SYSCALL_VERIFY -> K_SYSCALL_VERIFY
Rename internal API to not use z_/Z_.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
diff --git a/doc/kernel/usermode/syscalls.rst b/doc/kernel/usermode/syscalls.rst
index 5c0ad90..60f0b48 100644
--- a/doc/kernel/usermode/syscalls.rst
+++ b/doc/kernel/usermode/syscalls.rst
@@ -311,7 +311,7 @@
* :c:macro:`K_SYSCALL_VERIFY_MSG()` does a runtime check of some boolean
expression which must evaluate to true otherwise the check will fail.
- A variant :c:macro:`Z_SYSCALL_VERIFY` exists which does not take
+ A variant :c:macro:`K_SYSCALL_VERIFY` exists which does not take
a message parameter, instead printing the expression tested if it
fails. The latter should only be used for the most obvious of tests.
@@ -641,7 +641,7 @@
* :c:macro:`K_SYSCALL_MEMORY_ARRAY_READ()`
* :c:macro:`K_SYSCALL_MEMORY_ARRAY_WRITE()`
* :c:macro:`K_SYSCALL_VERIFY_MSG()`
-* :c:macro:`Z_SYSCALL_VERIFY`
+* :c:macro:`K_SYSCALL_VERIFY`
Functions for invoking system calls are defined in
:zephyr_file:`include/zephyr/syscall.h`:
diff --git a/drivers/i2c/i2c_handlers.c b/drivers/i2c/i2c_handlers.c
index 5c46389..99c3e60 100644
--- a/drivers/i2c/i2c_handlers.c
+++ b/drivers/i2c/i2c_handlers.c
@@ -59,7 +59,7 @@
* in i2c.h use only a handful of messages, so up to 32 messages
* should be more than sufficient.
*/
- Z_OOPS(Z_SYSCALL_VERIFY(num_msgs >= 1 && num_msgs < 32));
+ Z_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,
diff --git a/drivers/i3c/i3c_handlers.c b/drivers/i3c/i3c_handlers.c
index 6bb37f7..b9aaaa7 100644
--- a/drivers/i3c/i3c_handlers.c
+++ b/drivers/i3c/i3c_handlers.c
@@ -69,7 +69,7 @@
* in i2c.h use only a handful of messages, so up to 32 messages
* should be more than sufficient.
*/
- Z_OOPS(Z_SYSCALL_VERIFY(num_msgs >= 1 && num_msgs < 32));
+ Z_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,
diff --git a/drivers/spi/spi_handlers.c b/drivers/spi/spi_handlers.c
index ab1708b..3618d9d 100644
--- a/drivers/spi/spi_handlers.c
+++ b/drivers/spi/spi_handlers.c
@@ -86,7 +86,7 @@
Z_OOPS(K_SYSCALL_MEMORY_READ(tx_bufs,
sizeof(struct spi_buf_set)));
memcpy(&tx_bufs_copy, tx, sizeof(tx_bufs_copy));
- Z_OOPS(Z_SYSCALL_VERIFY(tx_bufs_copy.count < 32));
+ Z_OOPS(K_SYSCALL_VERIFY(tx_bufs_copy.count < 32));
} else {
memset(&tx_bufs_copy, 0, sizeof(tx_bufs_copy));
}
@@ -98,7 +98,7 @@
Z_OOPS(K_SYSCALL_MEMORY_READ(rx_bufs,
sizeof(struct spi_buf_set)));
memcpy(&rx_bufs_copy, rx, sizeof(rx_bufs_copy));
- Z_OOPS(Z_SYSCALL_VERIFY(rx_bufs_copy.count < 32));
+ Z_OOPS(K_SYSCALL_VERIFY(rx_bufs_copy.count < 32));
} else {
memset(&rx_bufs_copy, 0, sizeof(rx_bufs_copy));
}
diff --git a/include/zephyr/internal/syscall_handler.h b/include/zephyr/internal/syscall_handler.h
index ddceb01..ff39f5c 100644
--- a/include/zephyr/internal/syscall_handler.h
+++ b/include/zephyr/internal/syscall_handler.h
@@ -328,7 +328,7 @@
* oops. A stringified version of this expression will be printed.
* @return 0 on success, nonzero on failure
*/
-#define Z_SYSCALL_VERIFY(expr) K_SYSCALL_VERIFY_MSG(expr, #expr)
+#define K_SYSCALL_VERIFY(expr) K_SYSCALL_VERIFY_MSG(expr, #expr)
/**
* @brief Runtime check that a user thread has read and/or write permission to
diff --git a/kernel/poll.c b/kernel/poll.c
index 5b38ebe..3c0c947 100644
--- a/kernel/poll.c
+++ b/kernel/poll.c
@@ -364,7 +364,7 @@
/* Validate the events buffer and make a copy of it in an
* allocated kernel-side buffer.
*/
- if (Z_SYSCALL_VERIFY(num_events >= 0)) {
+ if (K_SYSCALL_VERIFY(num_events >= 0)) {
ret = -EINVAL;
goto out;
}
@@ -393,7 +393,7 @@
for (int i = 0; i < num_events; i++) {
struct k_poll_event *e = &events_copy[i];
- if (Z_SYSCALL_VERIFY(e->mode == K_POLL_MODE_NOTIFY_ONLY)) {
+ if (K_SYSCALL_VERIFY(e->mode == K_POLL_MODE_NOTIFY_ONLY)) {
ret = -EINVAL;
goto out_free;
}
diff --git a/kernel/stack.c b/kernel/stack.c
index 90c6a0f..72db870 100644
--- a/kernel/stack.c
+++ b/kernel/stack.c
@@ -65,7 +65,7 @@
uint32_t num_entries)
{
Z_OOPS(K_SYSCALL_OBJ_NEVER_INIT(stack, K_OBJ_STACK));
- Z_OOPS(Z_SYSCALL_VERIFY(num_entries > 0));
+ Z_OOPS(K_SYSCALL_VERIFY(num_entries > 0));
return z_impl_k_stack_alloc_init(stack, num_entries);
}
#include <syscalls/k_stack_alloc_init_mrsh.c>
diff --git a/kernel/thread.c b/kernel/thread.c
index 7bd47ae..4232756 100644
--- a/kernel/thread.c
+++ b/kernel/thread.c
@@ -763,14 +763,14 @@
/* User threads may only create other user threads and they can't
* be marked as essential
*/
- Z_OOPS(Z_SYSCALL_VERIFY(options & K_USER));
- Z_OOPS(Z_SYSCALL_VERIFY(!(options & K_ESSENTIAL)));
+ Z_OOPS(K_SYSCALL_VERIFY(options & K_USER));
+ Z_OOPS(K_SYSCALL_VERIFY(!(options & K_ESSENTIAL)));
/* Check validity of prio argument; must be the same or worse priority
* than the caller
*/
- Z_OOPS(Z_SYSCALL_VERIFY(_is_valid_prio(prio, NULL)));
- Z_OOPS(Z_SYSCALL_VERIFY(z_is_prio_lower_or_equal(prio,
+ Z_OOPS(K_SYSCALL_VERIFY(_is_valid_prio(prio, NULL)));
+ Z_OOPS(K_SYSCALL_VERIFY(z_is_prio_lower_or_equal(prio,
_current->base.prio)));
z_setup_new_thread(new_thread, stack, stack_size,
diff --git a/subsys/net/lib/sockets/sockets.c b/subsys/net/lib/sockets/sockets.c
index 1d05deb..050b0c1 100644
--- a/subsys/net/lib/sockets/sockets.c
+++ b/subsys/net/lib/sockets/sockets.c
@@ -482,7 +482,7 @@
{
struct sockaddr_storage dest_addr_copy;
- Z_OOPS(Z_SYSCALL_VERIFY(addrlen <= sizeof(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));
return z_impl_zsock_bind(sock, (struct sockaddr *)&dest_addr_copy,
@@ -561,7 +561,7 @@
{
struct sockaddr_storage dest_addr_copy;
- Z_OOPS(Z_SYSCALL_VERIFY(addrlen <= sizeof(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));
return z_impl_zsock_connect(sock, (struct sockaddr *)&dest_addr_copy,
@@ -864,7 +864,7 @@
Z_OOPS(K_SYSCALL_MEMORY_READ(buf, len));
if (dest_addr) {
- Z_OOPS(Z_SYSCALL_VERIFY(addrlen <= sizeof(dest_addr_copy)));
+ Z_OOPS(K_SYSCALL_VERIFY(addrlen <= sizeof(dest_addr_copy)));
Z_OOPS(k_usermode_from_copy(&dest_addr_copy, (void *)dest_addr,
addrlen));
}