1 /*
2 * Copyright (c) 2019 Vestas Wind Systems A/S
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7 #include <zephyr/internal/syscall_handler.h>
8 #include <zephyr/drivers/eeprom.h>
9
z_vrfy_eeprom_read(const struct device * dev,off_t offset,void * data,size_t len)10 static inline int z_vrfy_eeprom_read(const struct device *dev, off_t offset,
11 void *data, size_t len)
12 {
13 K_OOPS(K_SYSCALL_DRIVER_EEPROM(dev, read));
14 K_OOPS(K_SYSCALL_MEMORY_WRITE(data, len));
15 return z_impl_eeprom_read((const struct device *)dev, offset,
16 (void *)data,
17 len);
18 }
19 #include <syscalls/eeprom_read_mrsh.c>
20
z_vrfy_eeprom_write(const struct device * dev,off_t offset,const void * data,size_t len)21 static inline int z_vrfy_eeprom_write(const struct device *dev, off_t offset,
22 const void *data, size_t len)
23 {
24 K_OOPS(K_SYSCALL_DRIVER_EEPROM(dev, write));
25 K_OOPS(K_SYSCALL_MEMORY_READ(data, len));
26 return z_impl_eeprom_write((const struct device *)dev, offset,
27 (const void *)data, len);
28 }
29 #include <syscalls/eeprom_write_mrsh.c>
30
z_vrfy_eeprom_get_size(const struct device * dev)31 static inline size_t z_vrfy_eeprom_get_size(const struct device *dev)
32 {
33 K_OOPS(K_SYSCALL_DRIVER_EEPROM(dev, size));
34 return z_impl_eeprom_get_size((const struct device *)dev);
35 }
36 #include <syscalls/eeprom_get_size_mrsh.c>
37