1 /*
2 * Copyright (c) 2023, Laczen
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7 #include <zephyr/drivers/bbram.h>
8 #include <zephyr/internal/syscall_handler.h>
9
z_vrfy_bbram_check_invalid(const struct device * dev)10 static inline int z_vrfy_bbram_check_invalid(const struct device *dev)
11 {
12 K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
13 return z_impl_bbram_check_invalid(dev);
14 }
15 #include <zephyr/syscalls/bbram_check_invalid_mrsh.c>
16
z_vrfy_bbram_check_standby_power(const struct device * dev)17 static inline int z_vrfy_bbram_check_standby_power(const struct device *dev)
18 {
19 K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
20 return z_impl_bbram_check_standby_power(dev);
21 }
22 #include <zephyr/syscalls/bbram_check_standby_power_mrsh.c>
23
z_vrfy_bbram_check_power(const struct device * dev)24 static inline int z_vrfy_bbram_check_power(const struct device *dev)
25 {
26 K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
27 return z_impl_bbram_check_power(dev);
28 }
29 #include <zephyr/syscalls/bbram_check_power_mrsh.c>
30
z_vrfy_bbram_get_size(const struct device * dev,size_t * size)31 static inline int z_vrfy_bbram_get_size(const struct device *dev, size_t *size)
32 {
33 K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
34 K_OOPS(K_SYSCALL_MEMORY_WRITE(size, sizeof(size_t)));
35 return z_impl_bbram_get_size(dev, size);
36 }
37 #include <zephyr/syscalls/bbram_get_size_mrsh.c>
38
z_vrfy_bbram_read(const struct device * dev,size_t offset,size_t size,uint8_t * data)39 static inline int z_vrfy_bbram_read(const struct device *dev, size_t offset,
40 size_t size, uint8_t *data)
41 {
42 K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
43 K_OOPS(K_SYSCALL_MEMORY_WRITE(data, size));
44 return z_impl_bbram_read(dev, offset, size, data);
45 }
46 #include <zephyr/syscalls/bbram_read_mrsh.c>
47
z_vrfy_bbram_write(const struct device * dev,size_t offset,size_t size,const uint8_t * data)48 static inline int z_vrfy_bbram_write(const struct device *dev, size_t offset,
49 size_t size, const uint8_t *data)
50 {
51 K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
52 K_OOPS(K_SYSCALL_MEMORY_READ(data, size));
53 return z_impl_bbram_write(dev, offset, size, data);
54 }
55 #include <zephyr/syscalls/bbram_write_mrsh.c>
56