1 /*
2 * Copyright (c) 2023 Sequans Communications
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7 #include <zephyr/drivers/hwspinlock.h>
8 #include <zephyr/internal/syscall_handler.h>
9
z_vrfy_hwspinlock_trylock(const struct device * dev,uint32_t id)10 static inline int z_vrfy_hwspinlock_trylock(const struct device *dev, uint32_t id)
11 {
12 K_OOPS(K_SYSCALL_DRIVER_HWSPINLOCK(dev, trylock));
13 return z_impl_hwspinlock_trylock(dev, id);
14 }
15
16 #include <syscalls/hwspinlock_trylock_mrsh.c>
17
z_vrfy_hwspinlock_lock(const struct device * dev,uint32_t id)18 static inline void z_vrfy_hwspinlock_lock(const struct device *dev, uint32_t id)
19 {
20 K_OOPS(K_SYSCALL_DRIVER_HWSPINLOCK(dev, lock));
21 z_impl_hwspinlock_lock(dev, id);
22 }
23
24 #include <syscalls/hwspinlock_lock_mrsh.c>
25
z_vrfy_hwspinlock_unlock(const struct device * dev,uint32_t id)26 static inline void z_vrfy_hwspinlock_unlock(const struct device *dev, uint32_t id)
27 {
28 K_OOPS(K_SYSCALL_DRIVER_HWSPINLOCK(dev, unlock));
29 z_impl_hwspinlock_unlock(dev, id);
30 }
31
32 #include <syscalls/hwspinlock_unlock_mrsh.c>
33
z_vrfy_hwspinlock_get_max_id(const struct device * dev)34 static inline uint32_t z_vrfy_hwspinlock_get_max_id(const struct device *dev)
35 {
36 K_OOPS(K_SYSCALL_DRIVER_HWSPINLOCK(dev, get_max_id));
37 return z_impl_hwspinlock_get_max_id(dev);
38 }
39
40 #include <syscalls/hwspinlock_get_max_id_mrsh.c>
41