Skip to content

Commit 403b4ef

Browse files
Fymytejhedberg
authored andcommitted
drivers: hwspinlock: remove syscall support
HW spinlocks are not supposed to be used by user application. They are used to protect shared resources between clusters. Consumer of such spinlocks should be other drivers in kernel space. Moreover, syscalls were actually not generated properly because of a missing call to zephyr_syscall_header() in CMakeLists.txt. Signed-off-by: Pierrick Guillaume <[email protected]>
1 parent 3cd292a commit 403b4ef

File tree

3 files changed

+4
-55
lines changed

3 files changed

+4
-55
lines changed

drivers/hwspinlock/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@
33
zephyr_library()
44

55
zephyr_library_sources_ifdef(CONFIG_SQN_HWSPINLOCK sqn_hwspinlock.c)
6-
zephyr_library_sources_ifdef(CONFIG_USERSPACE hwspinlock_handlers.c)

drivers/hwspinlock/hwspinlock_handlers.c

Lines changed: 0 additions & 40 deletions
This file was deleted.

include/zephyr/drivers/hwspinlock.h

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ __subsystem struct hwspinlock_driver_api {
7777
* @retval 0 If successful.
7878
* @retval -errno In case of any failure.
7979
*/
80-
__syscall int hwspinlock_trylock(const struct device *dev, uint32_t id);
81-
82-
static inline int z_impl_hwspinlock_trylock(const struct device *dev, uint32_t id)
80+
static inline int hwspinlock_trylock(const struct device *dev, uint32_t id)
8381
{
8482
const struct hwspinlock_driver_api *api =
8583
(const struct hwspinlock_driver_api *)dev->api;
@@ -100,9 +98,7 @@ static inline int z_impl_hwspinlock_trylock(const struct device *dev, uint32_t i
10098
* @param dev HW spinlock device instance.
10199
* @param id Spinlock identifier.
102100
*/
103-
__syscall void hwspinlock_lock(const struct device *dev, uint32_t id);
104-
105-
static inline void z_impl_hwspinlock_lock(const struct device *dev, uint32_t id)
101+
static inline void hwspinlock_lock(const struct device *dev, uint32_t id)
106102
{
107103
const struct hwspinlock_driver_api *api =
108104
(const struct hwspinlock_driver_api *)dev->api;
@@ -121,9 +117,7 @@ static inline void z_impl_hwspinlock_lock(const struct device *dev, uint32_t id)
121117
* @param dev HW spinlock device instance.
122118
* @param id Spinlock identifier.
123119
*/
124-
__syscall void hwspinlock_unlock(const struct device *dev, uint32_t id);
125-
126-
static inline void z_impl_hwspinlock_unlock(const struct device *dev, uint32_t id)
120+
static inline void hwspinlock_unlock(const struct device *dev, uint32_t id)
127121
{
128122
const struct hwspinlock_driver_api *api =
129123
(const struct hwspinlock_driver_api *)dev->api;
@@ -144,9 +138,7 @@ static inline void z_impl_hwspinlock_unlock(const struct device *dev, uint32_t i
144138
* @retval HW spinlock max ID.
145139
* @retval 0 if the function is not implemented by the driver.
146140
*/
147-
__syscall uint32_t hwspinlock_get_max_id(const struct device *dev);
148-
149-
static inline uint32_t z_impl_hwspinlock_get_max_id(const struct device *dev)
141+
static inline uint32_t hwspinlock_get_max_id(const struct device *dev)
150142
{
151143
const struct hwspinlock_driver_api *api =
152144
(const struct hwspinlock_driver_api *)dev->api;
@@ -164,6 +156,4 @@ static inline uint32_t z_impl_hwspinlock_get_max_id(const struct device *dev)
164156

165157
/** @} */
166158

167-
#include <zephyr/syscalls/hwspinlock.h>
168-
169159
#endif /* ZEPHYR_INCLUDE_DRIVERS_HWSPINLOCK_H_ */

0 commit comments

Comments
 (0)