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);
|
|
|
|
}
|
2024-01-24 17:35:04 +08:00
|
|
|
#include <zephyr/syscalls/bbram_check_invalid_mrsh.c>
|
2023-08-25 04:05:38 +08:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
2024-01-24 17:35:04 +08:00
|
|
|
#include <zephyr/syscalls/bbram_check_standby_power_mrsh.c>
|
2023-08-25 04:05:38 +08:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
2024-01-24 17:35:04 +08:00
|
|
|
#include <zephyr/syscalls/bbram_check_power_mrsh.c>
|
2023-08-25 04:05:38 +08:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
2024-01-24 17:35:04 +08:00
|
|
|
#include <zephyr/syscalls/bbram_get_size_mrsh.c>
|
2023-08-25 04:05:38 +08:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
2024-01-24 17:35:04 +08:00
|
|
|
#include <zephyr/syscalls/bbram_read_mrsh.c>
|
2023-08-25 04:05:38 +08:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
2024-01-24 17:35:04 +08:00
|
|
|
#include <zephyr/syscalls/bbram_write_mrsh.c>
|