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