1 /*
2  * Copyright (c) 2019 Intel Corporation.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <zephyr/kernel.h>
8 #include <zephyr/syscall_handler.h>
9 #include "sample_driver.h"
10 
z_vrfy_sample_driver_state_set(const struct device * dev,bool active)11 int z_vrfy_sample_driver_state_set(const struct device *dev, bool active)
12 {
13 	if (Z_SYSCALL_DRIVER_SAMPLE(dev, state_set)) {
14 		return -EINVAL;
15 	}
16 
17 	return z_impl_sample_driver_state_set(dev, active);
18 }
19 
20 #include <syscalls/sample_driver_state_set_mrsh.c>
21 
z_vrfy_sample_driver_write(const struct device * dev,void * buf)22 int z_vrfy_sample_driver_write(const struct device *dev, void *buf)
23 {
24 	if (Z_SYSCALL_DRIVER_SAMPLE(dev, write)) {
25 		return -EINVAL;
26 	}
27 
28 	if (Z_SYSCALL_MEMORY_READ(buf, SAMPLE_DRIVER_MSG_SIZE)) {
29 		return -EFAULT;
30 	}
31 
32 	return z_impl_sample_driver_write(dev, buf);
33 }
34 #include <syscalls/sample_driver_write_mrsh.c>
35