1 /*
2  * Copyright (c) 2018 Alexander Wachter
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <zephyr/internal/syscall_handler.h>
8 #include <zephyr/drivers/hwinfo.h>
9 
z_vrfy_hwinfo_get_device_id(uint8_t * buffer,size_t length)10 ssize_t z_vrfy_hwinfo_get_device_id(uint8_t *buffer, size_t length)
11 {
12 	K_OOPS(K_SYSCALL_MEMORY_WRITE(buffer, length));
13 
14 	return z_impl_hwinfo_get_device_id((uint8_t *)buffer, (size_t)length);
15 }
16 #include <zephyr/syscalls/hwinfo_get_device_id_mrsh.c>
17 
z_vrfy_hwinfo_get_device_eui64(uint8_t * buffer)18 ssize_t z_vrfy_hwinfo_get_device_eui64(uint8_t *buffer)
19 {
20 	K_OOPS(K_SYSCALL_MEMORY_WRITE(buffer, 8));
21 
22 	return z_impl_hwinfo_get_device_eui64((uint8_t *)buffer);
23 }
24 #include <zephyr/syscalls/hwinfo_get_device_eui64_mrsh.c>
25 
z_vrfy_hwinfo_get_reset_cause(uint32_t * cause)26 int z_vrfy_hwinfo_get_reset_cause(uint32_t *cause)
27 {
28 	int ret;
29 	uint32_t cause_copy;
30 
31 	ret = z_impl_hwinfo_get_reset_cause(&cause_copy);
32 	K_OOPS(k_usermode_to_copy(cause, &cause_copy, sizeof(uint32_t)));
33 
34 	return ret;
35 }
36 #include <zephyr/syscalls/hwinfo_get_reset_cause_mrsh.c>
37 
38 
z_vrfy_hwinfo_clear_reset_cause(void)39 int z_vrfy_hwinfo_clear_reset_cause(void)
40 {
41 	return z_impl_hwinfo_clear_reset_cause();
42 }
43 #include <zephyr/syscalls/hwinfo_clear_reset_cause_mrsh.c>
44 
z_vrfy_hwinfo_get_supported_reset_cause(uint32_t * supported)45 int z_vrfy_hwinfo_get_supported_reset_cause(uint32_t *supported)
46 {
47 	int ret;
48 	uint32_t supported_copy;
49 
50 	ret = z_impl_hwinfo_get_supported_reset_cause(&supported_copy);
51 	K_OOPS(k_usermode_to_copy(supported, &supported_copy, sizeof(uint32_t)));
52 
53 	return ret;
54 }
55 #include <zephyr/syscalls/hwinfo_get_supported_reset_cause_mrsh.c>
56