kernel: Port remaining buildable syscalls to new API
These calls are buildable on common sanitycheck platforms, but are not invoked at runtime in any tests accessible to CI. The changes are mostly mechanical, so the risk is low, but this commit is separated from the main API change to allow for more careful review. Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
parent
4723def90d
commit
346cce31d8
8 changed files with 102 additions and 41 deletions
|
@ -8,35 +8,37 @@
|
|||
#include <syscall_handler.h>
|
||||
|
||||
#define UART_SIMPLE(op_) \
|
||||
Z_SYSCALL_HANDLER(uart_ ## op_, dev) { \
|
||||
static inline int z_vrfy_uart_##op_(struct device *dev) { \
|
||||
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, op_)); \
|
||||
return z_impl_uart_ ## op_((struct device *)dev); \
|
||||
return z_impl_uart_ ## op_(dev); \
|
||||
}
|
||||
|
||||
#define UART_SIMPLE_VOID(op_) \
|
||||
Z_SYSCALL_HANDLER(uart_ ## op_, dev) { \
|
||||
static inline void z_vrfy_uart_##op_(struct device *dev) { \
|
||||
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, op_)); \
|
||||
z_impl_uart_ ## op_((struct device *)dev); \
|
||||
return 0; \
|
||||
z_impl_uart_ ## op_(dev); \
|
||||
}
|
||||
|
||||
UART_SIMPLE(err_check)
|
||||
#include <syscalls/uart_err_check_mrsh.c>
|
||||
|
||||
Z_SYSCALL_HANDLER(uart_poll_in, dev, p_char)
|
||||
static inline int z_vrfy_uart_poll_in(struct device *dev,
|
||||
unsigned char *p_char)
|
||||
{
|
||||
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, poll_in));
|
||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(p_char, sizeof(unsigned char)));
|
||||
return z_impl_uart_poll_in((struct device *)dev,
|
||||
(unsigned char *)p_char);
|
||||
return z_impl_uart_poll_in(dev, p_char);
|
||||
}
|
||||
#include <syscalls/uart_poll_in_mrsh.c>
|
||||
|
||||
Z_SYSCALL_HANDLER(uart_poll_out, dev, out_char)
|
||||
static inline void z_vrfy_uart_poll_out(struct device *dev,
|
||||
unsigned char out_char)
|
||||
{
|
||||
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, poll_out));
|
||||
z_impl_uart_poll_out((struct device *)dev, out_char);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#include <syscalls/uart_poll_out_mrsh.c>
|
||||
|
||||
|
||||
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
|
||||
UART_SIMPLE_VOID(irq_tx_enable)
|
||||
|
@ -47,28 +49,41 @@ UART_SIMPLE_VOID(irq_err_enable)
|
|||
UART_SIMPLE_VOID(irq_err_disable)
|
||||
UART_SIMPLE(irq_is_pending)
|
||||
UART_SIMPLE(irq_update)
|
||||
#include <syscalls/uart_irq_tx_enable_mrsh.c>
|
||||
#include <syscalls/uart_irq_tx_disable_mrsh.c>
|
||||
#include <syscalls/uart_irq_rx_enable_mrsh.c>
|
||||
#include <syscalls/uart_irq_rx_disable_mrsh.c>
|
||||
#include <syscalls/uart_irq_err_enable_mrsh.c>
|
||||
#include <syscalls/uart_irq_err_disable_mrsh.c>
|
||||
#include <syscalls/uart_irq_is_pending_mrsh.c>
|
||||
#include <syscalls/uart_irq_update_mrsh.c>
|
||||
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */
|
||||
|
||||
#ifdef CONFIG_UART_LINE_CTRL
|
||||
Z_SYSCALL_HANDLER(uart_line_ctrl_set, dev, ctrl, val)
|
||||
static inline int z_vrfy_uart_line_ctrl_set(struct device *dev,
|
||||
u32_t ctrl, u32_t val)
|
||||
{
|
||||
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, line_ctrl_set));
|
||||
return z_impl_uart_line_ctrl_set((struct device *)dev, ctrl, val);
|
||||
}
|
||||
#include <syscalls/uart_line_ctrl_set_mrsh.c>
|
||||
|
||||
Z_SYSCALL_HANDLER(uart_line_ctrl_get, dev, ctrl, val)
|
||||
static inline int z_vrfy_uart_line_ctrl_get(struct device *dev,
|
||||
u32_t ctrl, u32_t *val)
|
||||
{
|
||||
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, line_ctrl_get));
|
||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(val, sizeof(u32_t)));
|
||||
return z_impl_uart_line_ctrl_get((struct device *)dev, ctrl,
|
||||
(u32_t *)val);
|
||||
}
|
||||
#include <syscalls/uart_line_ctrl_get_mrsh.c>
|
||||
#endif /* CONFIG_UART_LINE_CTRL */
|
||||
|
||||
#ifdef CONFIG_UART_DRV_CMD
|
||||
Z_SYSCALL_HANDLER(uart_drv_cmd, dev, cmd, p)
|
||||
static inline int z_vrfy_uart_drv_cmd(struct device *dev, u32_t cmd, u32_t p)
|
||||
{
|
||||
Z_OOPS(Z_SYSCALL_DRIVER_UART(dev, drv_cmd));
|
||||
return z_impl_uart_drv_cmd((struct device *)dev, cmd, p);
|
||||
}
|
||||
#include <syscalls/uart_drv_cmd_mrsh.c>
|
||||
#endif /* CONFIG_UART_DRV_CMD */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue