2021-10-15 17:55:56 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021 Carlo Caione <ccaione@baylibre.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2023-09-27 06:46:01 +08:00
|
|
|
#include <zephyr/internal/syscall_handler.h>
|
2022-05-06 16:25:46 +08:00
|
|
|
#include <zephyr/drivers/mbox.h>
|
2021-10-15 17:55:56 +08:00
|
|
|
|
2024-02-23 20:20:41 +08:00
|
|
|
static inline int z_vrfy_mbox_send(const struct device *dev,
|
|
|
|
mbox_channel_id_t channel_id,
|
2021-10-15 17:55:56 +08:00
|
|
|
const struct mbox_msg *msg)
|
|
|
|
{
|
2024-02-23 20:20:41 +08:00
|
|
|
K_OOPS(K_SYSCALL_DRIVER_MBOX(dev, send));
|
2023-09-27 19:20:28 +08:00
|
|
|
K_OOPS(K_SYSCALL_MEMORY_READ(msg, sizeof(struct mbox_msg)));
|
|
|
|
K_OOPS(K_SYSCALL_MEMORY_READ(msg->data, msg->size));
|
2021-10-15 17:55:56 +08:00
|
|
|
|
2024-03-12 09:58:24 +08:00
|
|
|
return z_impl_mbox_send(dev, channel_id, msg);
|
2021-10-15 17:55:56 +08:00
|
|
|
}
|
2024-01-24 17:35:04 +08:00
|
|
|
#include <zephyr/syscalls/mbox_send_mrsh.c>
|
2021-10-15 17:55:56 +08:00
|
|
|
|
|
|
|
static inline int z_vrfy_mbox_mtu_get(const struct device *dev)
|
|
|
|
{
|
2023-09-27 19:20:28 +08:00
|
|
|
K_OOPS(K_SYSCALL_DRIVER_MBOX(dev, mtu_get));
|
2021-10-15 17:55:56 +08:00
|
|
|
|
|
|
|
return z_impl_mbox_mtu_get(dev);
|
|
|
|
}
|
2024-01-24 17:35:04 +08:00
|
|
|
#include <zephyr/syscalls/mbox_mtu_get_mrsh.c>
|
2021-10-15 17:55:56 +08:00
|
|
|
|
|
|
|
static inline uint32_t z_vrfy_mbox_max_channels_get(const struct device *dev)
|
|
|
|
{
|
2023-09-27 19:20:28 +08:00
|
|
|
K_OOPS(K_SYSCALL_DRIVER_MBOX(dev, max_channels_get));
|
2021-10-15 17:55:56 +08:00
|
|
|
|
|
|
|
return z_impl_mbox_max_channels_get(dev);
|
|
|
|
}
|
2024-01-24 17:35:04 +08:00
|
|
|
#include <zephyr/syscalls/mbox_max_channels_get_mrsh.c>
|
2021-10-15 17:55:56 +08:00
|
|
|
|
2024-02-23 20:20:41 +08:00
|
|
|
static inline int z_vrfy_mbox_set_enabled(const struct device *dev,
|
|
|
|
mbox_channel_id_t channel_id,
|
|
|
|
bool enabled)
|
2021-10-15 17:55:56 +08:00
|
|
|
{
|
2024-02-23 20:20:41 +08:00
|
|
|
K_OOPS(K_SYSCALL_DRIVER_MBOX(dev, set_enabled));
|
2021-10-15 17:55:56 +08:00
|
|
|
|
2024-03-12 09:58:24 +08:00
|
|
|
return z_impl_mbox_set_enabled(dev, channel_id, enabled);
|
2021-10-15 17:55:56 +08:00
|
|
|
}
|
2024-01-24 17:35:04 +08:00
|
|
|
#include <zephyr/syscalls/mbox_set_enabled_mrsh.c>
|