2019-08-07 07:39:54 -07:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2019 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2022-05-06 10:25:46 +02:00
|
|
|
#include <zephyr/drivers/ps2.h>
|
2023-09-26 22:46:01 +00:00
|
|
|
#include <zephyr/internal/syscall_handler.h>
|
2019-08-07 07:39:54 -07:00
|
|
|
|
2021-06-22 16:51:47 -07:00
|
|
|
static inline int z_vrfy_ps2_config(const struct device *dev,
|
|
|
|
ps2_callback_t callback_isr)
|
2019-08-07 07:39:54 -07:00
|
|
|
{
|
2023-09-27 11:20:28 +00:00
|
|
|
K_OOPS(K_SYSCALL_DRIVER_PS2(dev, config));
|
|
|
|
K_OOPS(K_SYSCALL_VERIFY_MSG(callback_isr == NULL,
|
2019-08-07 07:39:54 -07:00
|
|
|
"callback not be set from user mode"));
|
2021-06-22 16:51:47 -07:00
|
|
|
return z_impl_ps2_config(dev, callback_isr);
|
2019-08-07 07:39:54 -07:00
|
|
|
}
|
2024-01-24 17:35:04 +08:00
|
|
|
#include <zephyr/syscalls/ps2_config_mrsh.c>
|
2019-08-07 07:39:54 -07:00
|
|
|
|
2021-06-22 16:51:47 -07:00
|
|
|
static inline int z_vrfy_ps2_write(const struct device *dev, uint8_t value)
|
2019-08-07 07:39:54 -07:00
|
|
|
{
|
2023-09-27 11:20:28 +00:00
|
|
|
K_OOPS(K_SYSCALL_DRIVER_PS2(dev, write));
|
2021-06-22 16:51:47 -07:00
|
|
|
return z_impl_ps2_write(dev, value);
|
2019-08-07 07:39:54 -07:00
|
|
|
}
|
2024-01-24 17:35:04 +08:00
|
|
|
#include <zephyr/syscalls/ps2_write_mrsh.c>
|
2019-08-07 07:39:54 -07:00
|
|
|
|
2021-06-22 16:51:47 -07:00
|
|
|
static inline int z_vrfy_ps2_read(const struct device *dev, uint8_t *value)
|
2019-08-07 07:39:54 -07:00
|
|
|
{
|
2023-09-27 11:20:28 +00:00
|
|
|
K_OOPS(K_SYSCALL_DRIVER_PS2(dev, read));
|
|
|
|
K_OOPS(K_SYSCALL_MEMORY_WRITE(value, sizeof(uint8_t)));
|
2021-06-22 17:55:41 -07:00
|
|
|
return z_impl_ps2_read(dev, value);
|
2019-08-07 07:39:54 -07:00
|
|
|
}
|
2024-01-24 17:35:04 +08:00
|
|
|
#include <zephyr/syscalls/ps2_read_mrsh.c>
|
2019-08-07 07:39:54 -07:00
|
|
|
|
2021-06-22 16:51:47 -07:00
|
|
|
static inline int z_vrfy_ps2_enable_callback(const struct device *dev)
|
2019-08-07 07:39:54 -07:00
|
|
|
{
|
2023-09-27 11:20:28 +00:00
|
|
|
K_OOPS(K_SYSCALL_DRIVER_PS2(dev, enable_callback));
|
2021-06-22 16:51:47 -07:00
|
|
|
return z_impl_ps2_enable_callback(dev);
|
2019-08-07 07:39:54 -07:00
|
|
|
}
|
2024-01-24 17:35:04 +08:00
|
|
|
#include <zephyr/syscalls/ps2_enable_callback_mrsh.c>
|
2019-08-07 07:39:54 -07:00
|
|
|
|
2021-06-22 16:51:47 -07:00
|
|
|
static inline int z_vrfy_ps2_disable_callback(const struct device *dev)
|
2019-08-07 07:39:54 -07:00
|
|
|
{
|
2023-09-27 11:20:28 +00:00
|
|
|
K_OOPS(K_SYSCALL_DRIVER_PS2(dev, disable_callback));
|
2021-06-22 16:51:47 -07:00
|
|
|
return z_impl_ps2_disable_callback(dev);
|
2019-08-07 07:39:54 -07:00
|
|
|
}
|
2024-01-24 17:35:04 +08:00
|
|
|
#include <zephyr/syscalls/ps2_disable_callback_mrsh.c>
|