1 /*
2 * Copyright (c) 2019 Intel Corporation
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7 #include <zephyr/drivers/ps2.h>
8 #include <zephyr/syscall_handler.h>
9
z_vrfy_ps2_config(const struct device * dev,ps2_callback_t callback_isr)10 static inline int z_vrfy_ps2_config(const struct device *dev,
11 ps2_callback_t callback_isr)
12 {
13 Z_OOPS(Z_SYSCALL_DRIVER_PS2(dev, config));
14 Z_OOPS(Z_SYSCALL_VERIFY_MSG(callback_isr == NULL,
15 "callback not be set from user mode"));
16 return z_impl_ps2_config(dev, callback_isr);
17 }
18 #include <syscalls/ps2_config_mrsh.c>
19
z_vrfy_ps2_write(const struct device * dev,uint8_t value)20 static inline int z_vrfy_ps2_write(const struct device *dev, uint8_t value)
21 {
22 Z_OOPS(Z_SYSCALL_DRIVER_PS2(dev, write));
23 return z_impl_ps2_write(dev, value);
24 }
25 #include <syscalls/ps2_write_mrsh.c>
26
z_vrfy_ps2_read(const struct device * dev,uint8_t * value)27 static inline int z_vrfy_ps2_read(const struct device *dev, uint8_t *value)
28 {
29 Z_OOPS(Z_SYSCALL_DRIVER_PS2(dev, read));
30 Z_OOPS(Z_SYSCALL_MEMORY_WRITE(value, sizeof(uint8_t)));
31 return z_impl_ps2_read(dev, value);
32 }
33 #include <syscalls/ps2_read_mrsh.c>
34
z_vrfy_ps2_enable_callback(const struct device * dev)35 static inline int z_vrfy_ps2_enable_callback(const struct device *dev)
36 {
37 Z_OOPS(Z_SYSCALL_DRIVER_PS2(dev, enable_callback));
38 return z_impl_ps2_enable_callback(dev);
39 }
40 #include <syscalls/ps2_enable_callback_mrsh.c>
41
z_vrfy_ps2_disable_callback(const struct device * dev)42 static inline int z_vrfy_ps2_disable_callback(const struct device *dev)
43 {
44 Z_OOPS(Z_SYSCALL_DRIVER_PS2(dev, disable_callback));
45 return z_impl_ps2_disable_callback(dev);
46 }
47 #include <syscalls/ps2_disable_callback_mrsh.c>
48