1 /*
2 * Copyright (c) 2023, Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7 #include <zephyr/drivers/retained_mem.h>
8 #include <zephyr/syscall_handler.h>
9
z_vrfy_retained_mem_size(const struct device * dev)10 static inline ssize_t z_vrfy_retained_mem_size(const struct device *dev)
11 {
12 Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RETAINED_MEM));
13 return z_impl_retained_mem_size(dev);
14 }
15 #include <syscalls/retained_mem_size_mrsh.c>
16
z_vrfy_retained_mem_read(const struct device * dev,off_t offset,uint8_t * buffer,size_t size)17 static inline int z_vrfy_retained_mem_read(const struct device *dev, off_t offset,
18 uint8_t *buffer, size_t size)
19 {
20 Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RETAINED_MEM));
21 Z_OOPS(Z_SYSCALL_MEMORY_WRITE(buffer, size));
22 return z_impl_retained_mem_read(dev, offset, buffer, size);
23 }
24 #include <syscalls/retained_mem_read_mrsh.c>
25
z_vrfy_retained_mem_write(const struct device * dev,off_t offset,const uint8_t * buffer,size_t size)26 static inline int z_vrfy_retained_mem_write(const struct device *dev, off_t offset,
27 const uint8_t *buffer, size_t size)
28 {
29 Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RETAINED_MEM));
30 Z_OOPS(Z_SYSCALL_MEMORY_READ(buffer, size));
31 return z_impl_retained_mem_write(dev, offset, buffer, size);
32 }
33 #include <syscalls/retained_mem_write_mrsh.c>
34
z_vrfy_retained_mem_clear(const struct device * dev)35 static inline int z_vrfy_retained_mem_clear(const struct device *dev)
36 {
37 Z_OOPS(Z_SYSCALL_OBJ(dev, K_OBJ_DRIVER_RETAINED_MEM));
38 return z_impl_retained_mem_clear(dev);
39 }
40 #include <syscalls/retained_mem_clear_mrsh.c>
41