2018-12-21 11:58:41 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018 Alexander Wachter
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2023-09-27 00:46:01 +02:00
|
|
|
#include <zephyr/internal/syscall_handler.h>
|
2022-05-06 10:25:46 +02:00
|
|
|
#include <zephyr/drivers/hwinfo.h>
|
2018-12-21 11:58:41 +01:00
|
|
|
|
2020-05-27 18:26:57 +02:00
|
|
|
ssize_t z_vrfy_hwinfo_get_device_id(uint8_t *buffer, size_t length)
|
2019-08-13 21:58:38 +02:00
|
|
|
{
|
2023-09-27 13:20:28 +02:00
|
|
|
K_OOPS(K_SYSCALL_MEMORY_WRITE(buffer, length));
|
2018-12-21 11:58:41 +01:00
|
|
|
|
2020-05-27 18:26:57 +02:00
|
|
|
return z_impl_hwinfo_get_device_id((uint8_t *)buffer, (size_t)length);
|
2018-12-21 11:58:41 +01:00
|
|
|
}
|
2019-08-13 20:34:34 +02:00
|
|
|
#include <syscalls/hwinfo_get_device_id_mrsh.c>
|
2020-05-01 04:32:52 +02:00
|
|
|
|
2024-04-28 21:00:55 +02:00
|
|
|
ssize_t z_vrfy_hwinfo_get_device_eui64(uint8_t *buffer)
|
|
|
|
{
|
|
|
|
K_OOPS(K_SYSCALL_MEMORY_WRITE(buffer, 8));
|
|
|
|
|
|
|
|
return z_impl_hwinfo_get_device_eui64((uint8_t *)buffer);
|
|
|
|
}
|
|
|
|
#include <syscalls/hwinfo_get_device_eui64_mrsh.c>
|
|
|
|
|
2020-05-01 04:32:52 +02:00
|
|
|
int z_vrfy_hwinfo_get_reset_cause(uint32_t *cause)
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
uint32_t cause_copy;
|
|
|
|
|
|
|
|
ret = z_impl_hwinfo_get_reset_cause(&cause_copy);
|
2023-09-27 13:20:28 +02:00
|
|
|
K_OOPS(k_usermode_to_copy(cause, &cause_copy, sizeof(uint32_t)));
|
2020-05-01 04:32:52 +02:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
#include <syscalls/hwinfo_get_reset_cause_mrsh.c>
|
|
|
|
|
|
|
|
|
|
|
|
int z_vrfy_hwinfo_clear_reset_cause(void)
|
|
|
|
{
|
|
|
|
return z_impl_hwinfo_clear_reset_cause();
|
|
|
|
}
|
|
|
|
#include <syscalls/hwinfo_clear_reset_cause_mrsh.c>
|
|
|
|
|
|
|
|
int z_vrfy_hwinfo_get_supported_reset_cause(uint32_t *supported)
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
uint32_t supported_copy;
|
|
|
|
|
|
|
|
ret = z_impl_hwinfo_get_supported_reset_cause(&supported_copy);
|
2023-09-27 13:20:28 +02:00
|
|
|
K_OOPS(k_usermode_to_copy(supported, &supported_copy, sizeof(uint32_t)));
|
2020-05-01 04:32:52 +02:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
#include <syscalls/hwinfo_get_supported_reset_cause_mrsh.c>
|