2023-08-25 04:05:38 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2023, Laczen
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <zephyr/drivers/bbram.h>
|
2023-09-27 06:46:01 +08:00
|
|
|
#include <zephyr/internal/syscall_handler.h>
|
2023-08-25 04:05:38 +08:00
|
|
|
|
|
|
|
static inline int z_vrfy_bbram_check_invalid(const struct device *dev)
|
|
|
|
{
|
2023-09-27 19:20:28 +08:00
|
|
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
2023-08-25 04:05:38 +08:00
|
|
|
return z_impl_bbram_check_invalid(dev);
|
|
|
|
}
|
|
|
|
#include <syscalls/bbram_check_invalid_mrsh.c>
|
|
|
|
|
|
|
|
static inline int z_vrfy_bbram_check_standby_power(const struct device *dev)
|
|
|
|
{
|
2023-09-27 19:20:28 +08:00
|
|
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
2023-08-25 04:05:38 +08:00
|
|
|
return z_impl_bbram_check_standby_power(dev);
|
|
|
|
}
|
|
|
|
#include <syscalls/bbram_check_standby_power_mrsh.c>
|
|
|
|
|
|
|
|
static inline int z_vrfy_bbram_check_power(const struct device *dev)
|
|
|
|
{
|
2023-09-27 19:20:28 +08:00
|
|
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
2023-08-25 04:05:38 +08:00
|
|
|
return z_impl_bbram_check_power(dev);
|
|
|
|
}
|
|
|
|
#include <syscalls/bbram_check_power_mrsh.c>
|
|
|
|
|
|
|
|
static inline int z_vrfy_bbram_get_size(const struct device *dev, size_t *size)
|
|
|
|
{
|
2023-09-27 19:20:28 +08:00
|
|
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
|
|
|
K_OOPS(K_SYSCALL_MEMORY_WRITE(size, sizeof(size_t)));
|
2023-08-25 04:05:38 +08:00
|
|
|
return z_impl_bbram_get_size(dev, size);
|
|
|
|
}
|
|
|
|
#include <syscalls/bbram_get_size_mrsh.c>
|
|
|
|
|
|
|
|
static inline int z_vrfy_bbram_read(const struct device *dev, size_t offset,
|
|
|
|
size_t size, uint8_t *data)
|
|
|
|
{
|
2023-09-27 19:20:28 +08:00
|
|
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
|
|
|
K_OOPS(K_SYSCALL_MEMORY_WRITE(data, size));
|
2023-08-25 04:05:38 +08:00
|
|
|
return z_impl_bbram_read(dev, offset, size, data);
|
|
|
|
}
|
|
|
|
#include <syscalls/bbram_read_mrsh.c>
|
|
|
|
|
|
|
|
static inline int z_vrfy_bbram_write(const struct device *dev, size_t offset,
|
|
|
|
size_t size, const uint8_t *data)
|
|
|
|
{
|
2023-09-27 19:20:28 +08:00
|
|
|
K_OOPS(K_SYSCALL_OBJ(dev, K_OBJ_DRIVER_BBRAM));
|
|
|
|
K_OOPS(K_SYSCALL_MEMORY_READ(data, size));
|
2023-08-25 04:05:38 +08:00
|
|
|
return z_impl_bbram_write(dev, offset, size, data);
|
|
|
|
}
|
|
|
|
#include <syscalls/bbram_write_mrsh.c>
|