2019-10-21 03:22:03 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2019 Vestas Wind Systems A/S
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2023-09-27 06:46:01 +08:00
|
|
|
#include <zephyr/internal/syscall_handler.h>
|
2022-05-06 16:25:46 +08:00
|
|
|
#include <zephyr/drivers/eeprom.h>
|
2019-10-21 03:22:03 +08:00
|
|
|
|
2020-05-01 02:33:38 +08:00
|
|
|
static inline int z_vrfy_eeprom_read(const struct device *dev, off_t offset,
|
2019-10-21 03:22:03 +08:00
|
|
|
void *data, size_t len)
|
|
|
|
{
|
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_EEPROM(dev, read));
|
|
|
|
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(data, len));
|
2020-05-01 02:33:38 +08:00
|
|
|
return z_impl_eeprom_read((const struct device *)dev, offset,
|
|
|
|
(void *)data,
|
2019-10-21 03:22:03 +08:00
|
|
|
len);
|
|
|
|
}
|
|
|
|
#include <syscalls/eeprom_read_mrsh.c>
|
|
|
|
|
2020-05-01 02:33:38 +08:00
|
|
|
static inline int z_vrfy_eeprom_write(const struct device *dev, off_t offset,
|
2019-10-21 03:22:03 +08:00
|
|
|
const void *data, size_t len)
|
|
|
|
{
|
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_EEPROM(dev, write));
|
|
|
|
Z_OOPS(Z_SYSCALL_MEMORY_READ(data, len));
|
2020-05-01 02:33:38 +08:00
|
|
|
return z_impl_eeprom_write((const struct device *)dev, offset,
|
2019-10-21 03:22:03 +08:00
|
|
|
(const void *)data, len);
|
|
|
|
}
|
|
|
|
#include <syscalls/eeprom_write_mrsh.c>
|
|
|
|
|
2020-05-01 02:33:38 +08:00
|
|
|
static inline size_t z_vrfy_eeprom_get_size(const struct device *dev)
|
2019-10-21 03:22:03 +08:00
|
|
|
{
|
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_EEPROM(dev, size));
|
2020-05-01 02:33:38 +08:00
|
|
|
return z_impl_eeprom_get_size((const struct device *)dev);
|
2019-10-21 03:22:03 +08:00
|
|
|
}
|
|
|
|
#include <syscalls/eeprom_get_size_mrsh.c>
|