kernel: syscalls: Whitespace fixups
The semi-automated API changes weren't checkpatch aware. Fix up whitespace warnings that snuck into the previous patches. Really this should be squashed, but that's somewhat difficult given the structure of the series. Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
parent
075c94f6e2
commit
643701aaf8
14 changed files with 55 additions and 29 deletions
|
@ -7,7 +7,8 @@
|
||||||
#include <syscall_handler.h>
|
#include <syscall_handler.h>
|
||||||
#include <drivers/hwinfo.h>
|
#include <drivers/hwinfo.h>
|
||||||
|
|
||||||
ssize_t z_vrfy_hwinfo_get_device_id(u8_t *buffer, size_t length) {
|
ssize_t z_vrfy_hwinfo_get_device_id(u8_t *buffer, size_t length)
|
||||||
|
{
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(buffer, length));
|
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(buffer, length));
|
||||||
|
|
||||||
return z_impl_hwinfo_get_device_id((u8_t *)buffer, (size_t)length);
|
return z_impl_hwinfo_get_device_id((u8_t *)buffer, (size_t)length);
|
||||||
|
|
|
@ -8,13 +8,15 @@
|
||||||
#include <syscall_handler.h>
|
#include <syscall_handler.h>
|
||||||
|
|
||||||
#define UART_SIMPLE(op_) \
|
#define UART_SIMPLE(op_) \
|
||||||
static inline int z_vrfy_uart_##op_(struct device *dev) { \
|
static inline int z_vrfy_uart_##op_(struct device *dev) \
|
||||||
|
{ \
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, op_)); \
|
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, op_)); \
|
||||||
return z_impl_uart_ ## op_(dev); \
|
return z_impl_uart_ ## op_(dev); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define UART_SIMPLE_VOID(op_) \
|
#define UART_SIMPLE_VOID(op_) \
|
||||||
static inline void z_vrfy_uart_##op_(struct device *dev) { \
|
static inline void z_vrfy_uart_##op_(struct device *dev) \
|
||||||
|
{ \
|
||||||
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, op_)); \
|
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, op_)); \
|
||||||
z_impl_uart_ ## op_(dev); \
|
z_impl_uart_ ## op_(dev); \
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,13 +39,16 @@ static struct k_spinlock lock;
|
||||||
#include <syscall_handler.h>
|
#include <syscall_handler.h>
|
||||||
|
|
||||||
#define ATOMIC_SYSCALL_HANDLER_TARGET(name) \
|
#define ATOMIC_SYSCALL_HANDLER_TARGET(name) \
|
||||||
static inline atomic_val_t z_vrfy_##name(atomic_t target) { \
|
static inline atomic_val_t z_vrfy_##name(atomic_t target) \
|
||||||
|
{ \
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(target, sizeof(atomic_t))); \
|
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(target, sizeof(atomic_t))); \
|
||||||
return z_impl_##name((atomic_t *)target); \
|
return z_impl_##name((atomic_t *)target); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define ATOMIC_SYSCALL_HANDLER_TARGET_VALUE(name) \
|
#define ATOMIC_SYSCALL_HANDLER_TARGET_VALUE(name) \
|
||||||
static inline atomic_val_t z_vrfy_##name(atomic_t target, u32_t value) { \
|
static inline atomic_val_t z_vrfy_##name(atomic_t target, \
|
||||||
|
u32_t value) \
|
||||||
|
{ \
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(target, sizeof(atomic_t))); \
|
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(target, sizeof(atomic_t))); \
|
||||||
return z_impl_##name((atomic_t *)target, value); \
|
return z_impl_##name((atomic_t *)target, value); \
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,8 @@ int z_impl_k_futex_wait(struct k_futex *futex, int expected, s32_t timeout)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int z_vrfy_k_futex_wait(struct k_futex *futex, int expected, s32_t timeout)
|
static inline int z_vrfy_k_futex_wait(struct k_futex *futex, int expected,
|
||||||
|
s32_t timeout)
|
||||||
{
|
{
|
||||||
if (Z_SYSCALL_MEMORY_WRITE(futex, sizeof(struct k_futex)) != 0) {
|
if (Z_SYSCALL_MEMORY_WRITE(futex, sizeof(struct k_futex)) != 0) {
|
||||||
return -EACCES;
|
return -EACCES;
|
||||||
|
|
|
@ -173,7 +173,8 @@ void z_impl_k_msgq_get_attrs(struct k_msgq *msgq, struct k_msgq_attrs *attrs)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline void z_vrfy_k_msgq_get_attrs(struct k_msgq *q, struct k_msgq_attrs *attrs)
|
static inline void z_vrfy_k_msgq_get_attrs(struct k_msgq *q,
|
||||||
|
struct k_msgq_attrs *attrs)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(q, K_OBJ_MSGQ));
|
Z_OOPS(Z_SYSCALL_OBJ(q, K_OBJ_MSGQ));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(attrs, sizeof(struct k_msgq_attrs)));
|
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(attrs, sizeof(struct k_msgq_attrs)));
|
||||||
|
|
|
@ -259,7 +259,8 @@ int z_impl_k_poll(struct k_poll_event *events, int num_events, s32_t timeout)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline int z_vrfy_k_poll(struct k_poll_event *events, int num_events, s32_t timeout)
|
static inline int z_vrfy_k_poll(struct k_poll_event *events,
|
||||||
|
int num_events, s32_t timeout)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
k_spinlock_key_t key;
|
k_spinlock_key_t key;
|
||||||
|
@ -438,7 +439,8 @@ int z_impl_k_poll_signal_raise(struct k_poll_signal *signal, int result)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline int z_vrfy_k_poll_signal_raise(struct k_poll_signal *signal, int result)
|
static inline int z_vrfy_k_poll_signal_raise(struct k_poll_signal *signal,
|
||||||
|
int result)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(signal, K_OBJ_POLL_SIGNAL));
|
Z_OOPS(Z_SYSCALL_OBJ(signal, K_OBJ_POLL_SIGNAL));
|
||||||
return z_impl_k_poll_signal_raise(signal, result);
|
return z_impl_k_poll_signal_raise(signal, result);
|
||||||
|
|
|
@ -205,7 +205,8 @@ s32_t z_impl_k_queue_alloc_append(struct k_queue *queue, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline s32_t z_vrfy_k_queue_alloc_append(struct k_queue *queue, void *data)
|
static inline s32_t z_vrfy_k_queue_alloc_append(struct k_queue *queue,
|
||||||
|
void *data)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(queue, K_OBJ_QUEUE));
|
Z_OOPS(Z_SYSCALL_OBJ(queue, K_OBJ_QUEUE));
|
||||||
return z_impl_k_queue_alloc_append(queue, data);
|
return z_impl_k_queue_alloc_append(queue, data);
|
||||||
|
@ -219,7 +220,8 @@ s32_t z_impl_k_queue_alloc_prepend(struct k_queue *queue, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline s32_t z_vrfy_k_queue_alloc_prepend(struct k_queue *queue, void *data)
|
static inline s32_t z_vrfy_k_queue_alloc_prepend(struct k_queue *queue,
|
||||||
|
void *data)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(queue, K_OBJ_QUEUE));
|
Z_OOPS(Z_SYSCALL_OBJ(queue, K_OBJ_QUEUE));
|
||||||
return z_impl_k_queue_alloc_prepend(queue, data);
|
return z_impl_k_queue_alloc_prepend(queue, data);
|
||||||
|
|
|
@ -71,7 +71,8 @@ s32_t z_impl_k_stack_alloc_init(struct k_stack *stack, u32_t num_entries)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline s32_t z_vrfy_k_stack_alloc_init(struct k_stack *stack, u32_t num_entries)
|
static inline s32_t z_vrfy_k_stack_alloc_init(struct k_stack *stack,
|
||||||
|
u32_t num_entries)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ_NEVER_INIT(stack, K_OBJ_STACK));
|
Z_OOPS(Z_SYSCALL_OBJ_NEVER_INIT(stack, K_OBJ_STACK));
|
||||||
Z_OOPS(Z_SYSCALL_VERIFY(num_entries > 0));
|
Z_OOPS(Z_SYSCALL_VERIFY(num_entries > 0));
|
||||||
|
@ -157,7 +158,8 @@ int z_impl_k_stack_pop(struct k_stack *stack, stack_data_t *data, s32_t timeout)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline int z_vrfy_k_stack_pop(struct k_stack *stack, stack_data_t *data, s32_t timeout)
|
static inline int z_vrfy_k_stack_pop(struct k_stack *stack,
|
||||||
|
stack_data_t *data, s32_t timeout)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(stack, K_OBJ_STACK));
|
Z_OOPS(Z_SYSCALL_OBJ(stack, K_OBJ_STACK));
|
||||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(data, sizeof(stack_data_t)));
|
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(data, sizeof(stack_data_t)));
|
||||||
|
|
|
@ -122,7 +122,8 @@ void z_impl_k_timer_start(struct k_timer *timer, s32_t duration, s32_t period)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline void z_vrfy_k_timer_start(struct k_timer *timer, s32_t duration, s32_t period)
|
static inline void z_vrfy_k_timer_start(struct k_timer *timer,
|
||||||
|
s32_t duration, s32_t period)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_VERIFY(duration >= 0 && period >= 0 &&
|
Z_OOPS(Z_SYSCALL_VERIFY(duration >= 0 && period >= 0 &&
|
||||||
(duration != 0 || period != 0)));
|
(duration != 0 || period != 0)));
|
||||||
|
@ -231,7 +232,8 @@ static inline void *z_vrfy_k_timer_user_data_get(struct k_timer *timer)
|
||||||
}
|
}
|
||||||
#include <syscalls/k_timer_user_data_get_mrsh.c>
|
#include <syscalls/k_timer_user_data_get_mrsh.c>
|
||||||
|
|
||||||
static inline void z_vrfy_k_timer_user_data_set(struct k_timer *timer, void *user_data)
|
static inline void z_vrfy_k_timer_user_data_set(struct k_timer *timer,
|
||||||
|
void *user_data)
|
||||||
{
|
{
|
||||||
Z_OOPS(Z_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
Z_OOPS(Z_SYSCALL_OBJ(timer, K_OBJ_TIMER));
|
||||||
z_impl_k_timer_user_data_set(timer, user_data);
|
z_impl_k_timer_user_data_set(timer, user_data);
|
||||||
|
|
|
@ -36,7 +36,8 @@ static struct _k_object *validate_any_object(void *obj)
|
||||||
* To avoid double z_object_find() lookups, we don't call the implementation
|
* To avoid double z_object_find() lookups, we don't call the implementation
|
||||||
* function, but call a level deeper.
|
* function, but call a level deeper.
|
||||||
*/
|
*/
|
||||||
static inline void z_vrfy_k_object_access_grant(void *object, struct k_thread *thread)
|
static inline void z_vrfy_k_object_access_grant(void *object,
|
||||||
|
struct k_thread *thread)
|
||||||
{
|
{
|
||||||
struct _k_object *ko;
|
struct _k_object *ko;
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,8 @@ int z_impl_z_sys_mutex_kernel_lock(struct sys_mutex *mutex, s32_t timeout)
|
||||||
return k_mutex_lock(kernel_mutex, timeout);
|
return k_mutex_lock(kernel_mutex, timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int z_vrfy_z_sys_mutex_kernel_lock(struct sys_mutex *mutex, s32_t timeout)
|
static inline int z_vrfy_z_sys_mutex_kernel_lock(struct sys_mutex *mutex,
|
||||||
|
s32_t timeout)
|
||||||
{
|
{
|
||||||
if (check_sys_mutex_addr((u32_t) mutex)) {
|
if (check_sys_mutex_addr((u32_t) mutex)) {
|
||||||
return -EACCES;
|
return -EACCES;
|
||||||
|
|
|
@ -1148,7 +1148,8 @@ int z_impl_net_if_ipv6_addr_lookup_by_index(const struct in6_addr *addr)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline int z_vrfy_net_if_ipv6_addr_lookup_by_index(const struct in6_addr *addr)
|
static inline int z_vrfy_net_if_ipv6_addr_lookup_by_index(
|
||||||
|
const struct in6_addr *addr)
|
||||||
{
|
{
|
||||||
struct in6_addr addr_v6;
|
struct in6_addr addr_v6;
|
||||||
|
|
||||||
|
@ -2801,7 +2802,8 @@ int z_impl_net_if_ipv4_addr_lookup_by_index(const struct in_addr *addr)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline int z_vrfy_net_if_ipv4_addr_lookup_by_index(const struct in_addr *addr)
|
static inline int z_vrfy_net_if_ipv4_addr_lookup_by_index(
|
||||||
|
const struct in_addr *addr)
|
||||||
{
|
{
|
||||||
struct in_addr addr_v4;
|
struct in_addr addr_v4;
|
||||||
|
|
||||||
|
|
|
@ -307,7 +307,8 @@ int z_impl_zsock_bind(int sock, const struct sockaddr *addr, socklen_t addrlen)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline int z_vrfy_zsock_bind(int sock, const struct sockaddr *addr, socklen_t addrlen)
|
static inline int z_vrfy_zsock_bind(int sock, const struct sockaddr *addr,
|
||||||
|
socklen_t addrlen)
|
||||||
{
|
{
|
||||||
struct sockaddr_storage dest_addr_copy;
|
struct sockaddr_storage dest_addr_copy;
|
||||||
|
|
||||||
|
@ -441,7 +442,8 @@ int z_impl_zsock_accept(int sock, struct sockaddr *addr, socklen_t *addrlen)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline int z_vrfy_zsock_accept(int sock, struct sockaddr *addr, socklen_t *addrlen)
|
static inline int z_vrfy_zsock_accept(int sock, struct sockaddr *addr,
|
||||||
|
socklen_t *addrlen)
|
||||||
{
|
{
|
||||||
socklen_t addrlen_copy;
|
socklen_t addrlen_copy;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -557,7 +559,9 @@ ssize_t z_impl_zsock_sendmsg(int sock, const struct msghdr *msg, int flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline ssize_t z_vrfy_zsock_sendmsg(int sock, const struct msghdr *msg, int flags)
|
static inline ssize_t z_vrfy_zsock_sendmsg(int sock,
|
||||||
|
const struct msghdr *msg,
|
||||||
|
int flags)
|
||||||
{
|
{
|
||||||
/* TODO: Create a copy of msg_buf and copy the data there */
|
/* TODO: Create a copy of msg_buf and copy the data there */
|
||||||
|
|
||||||
|
@ -1090,7 +1094,8 @@ int z_impl_zsock_poll(struct zsock_pollfd *fds, int nfds, int timeout)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline int z_vrfy_zsock_poll(struct zsock_pollfd *fds, int nfds, int timeout)
|
static inline int z_vrfy_zsock_poll(struct zsock_pollfd *fds,
|
||||||
|
int nfds, int timeout)
|
||||||
{
|
{
|
||||||
struct zsock_pollfd *fds_copy;
|
struct zsock_pollfd *fds_copy;
|
||||||
size_t fds_size;
|
size_t fds_size;
|
||||||
|
@ -1129,7 +1134,8 @@ int z_impl_zsock_inet_pton(sa_family_t family, const char *src, void *dst)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_USERSPACE
|
#ifdef CONFIG_USERSPACE
|
||||||
static inline int z_vrfy_zsock_inet_pton(sa_family_t family, const char *src, void *dst)
|
static inline int z_vrfy_zsock_inet_pton(sa_family_t family,
|
||||||
|
const char *src, void *dst)
|
||||||
{
|
{
|
||||||
int dst_size;
|
int dst_size;
|
||||||
char src_copy[NET_IPV6_ADDR_LEN];
|
char src_copy[NET_IPV6_ADDR_LEN];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue