1 /*
2  * Copyright (c) 2021 Carlo Caione <ccaione@baylibre.com>
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <zephyr/internal/syscall_handler.h>
8 #include <zephyr/drivers/mbox.h>
9 
z_vrfy_mbox_send(const struct device * dev,mbox_channel_id_t channel_id,const struct mbox_msg * msg)10 static inline int z_vrfy_mbox_send(const struct device *dev,
11 				   mbox_channel_id_t channel_id,
12 				   const struct mbox_msg *msg)
13 {
14 	K_OOPS(K_SYSCALL_DRIVER_MBOX(dev, send));
15 	K_OOPS(K_SYSCALL_MEMORY_READ(msg, sizeof(struct mbox_msg)));
16 	K_OOPS(K_SYSCALL_MEMORY_READ(msg->data, msg->size));
17 
18 	return z_impl_mbox_send(dev, channel_id, msg);
19 }
20 #include <zephyr/syscalls/mbox_send_mrsh.c>
21 
z_vrfy_mbox_mtu_get(const struct device * dev)22 static inline int z_vrfy_mbox_mtu_get(const struct device *dev)
23 {
24 	K_OOPS(K_SYSCALL_DRIVER_MBOX(dev, mtu_get));
25 
26 	return z_impl_mbox_mtu_get(dev);
27 }
28 #include <zephyr/syscalls/mbox_mtu_get_mrsh.c>
29 
z_vrfy_mbox_max_channels_get(const struct device * dev)30 static inline uint32_t z_vrfy_mbox_max_channels_get(const struct device *dev)
31 {
32 	K_OOPS(K_SYSCALL_DRIVER_MBOX(dev, max_channels_get));
33 
34 	return z_impl_mbox_max_channels_get(dev);
35 }
36 #include <zephyr/syscalls/mbox_max_channels_get_mrsh.c>
37 
z_vrfy_mbox_set_enabled(const struct device * dev,mbox_channel_id_t channel_id,bool enabled)38 static inline int z_vrfy_mbox_set_enabled(const struct device *dev,
39 					  mbox_channel_id_t channel_id,
40 					  bool enabled)
41 {
42 	K_OOPS(K_SYSCALL_DRIVER_MBOX(dev, set_enabled));
43 
44 	return z_impl_mbox_set_enabled(dev, channel_id, enabled);
45 }
46 #include <zephyr/syscalls/mbox_set_enabled_mrsh.c>
47