kernel: Add missing verification for device_usable_check() system call

so that this function and also device_is_ready() can be called from
user mode.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit is contained in:
Andrzej Głąbek 2021-03-12 16:25:59 +01:00 committed by Kumar Gala
commit 6de16d0013

View file

@ -149,6 +149,14 @@ static inline const struct device *z_vrfy_device_get_binding(const char *name)
return z_impl_device_get_binding(name_copy); return z_impl_device_get_binding(name_copy);
} }
#include <syscalls/device_get_binding_mrsh.c> #include <syscalls/device_get_binding_mrsh.c>
static inline int z_vrfy_device_usable_check(const struct device *dev)
{
Z_OOPS(Z_SYSCALL_OBJ_INIT(dev, K_OBJ_ANY));
return z_impl_device_usable_check(dev);
}
#include <syscalls/device_usable_check_mrsh.c>
#endif /* CONFIG_USERSPACE */ #endif /* CONFIG_USERSPACE */
size_t z_device_get_all_static(struct device const **devices) size_t z_device_get_all_static(struct device const **devices)