1 /*
2 * Copyright (c) 2017 Intel Corporation
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7 #include <drivers/gpio.h>
8 #include <syscall_handler.h>
9
z_vrfy_gpio_pin_configure(const struct device * port,gpio_pin_t pin,gpio_flags_t flags)10 static inline int z_vrfy_gpio_pin_configure(const struct device *port,
11 gpio_pin_t pin,
12 gpio_flags_t flags)
13 {
14 Z_OOPS(Z_SYSCALL_DRIVER_GPIO(port, pin_configure));
15 return z_impl_gpio_pin_configure((const struct device *)port,
16 pin,
17 flags);
18 }
19 #include <syscalls/gpio_pin_configure_mrsh.c>
20
z_vrfy_gpio_port_get_raw(const struct device * port,gpio_port_value_t * value)21 static inline int z_vrfy_gpio_port_get_raw(const struct device *port,
22 gpio_port_value_t *value)
23 {
24 Z_OOPS(Z_SYSCALL_DRIVER_GPIO(port, port_get_raw));
25 Z_OOPS(Z_SYSCALL_MEMORY_WRITE(value, sizeof(gpio_port_value_t)));
26 return z_impl_gpio_port_get_raw((const struct device *)port,
27 (gpio_port_value_t *)value);
28 }
29 #include <syscalls/gpio_port_get_raw_mrsh.c>
30
z_vrfy_gpio_port_set_masked_raw(const struct device * port,gpio_port_pins_t mask,gpio_port_value_t value)31 static inline int z_vrfy_gpio_port_set_masked_raw(const struct device *port,
32 gpio_port_pins_t mask,
33 gpio_port_value_t value)
34 {
35 Z_OOPS(Z_SYSCALL_DRIVER_GPIO(port, port_set_masked_raw));
36 return z_impl_gpio_port_set_masked_raw((const struct device *)port,
37 mask,
38 value);
39 }
40 #include <syscalls/gpio_port_set_masked_raw_mrsh.c>
41
z_vrfy_gpio_port_set_bits_raw(const struct device * port,gpio_port_pins_t pins)42 static inline int z_vrfy_gpio_port_set_bits_raw(const struct device *port,
43 gpio_port_pins_t pins)
44 {
45 Z_OOPS(Z_SYSCALL_DRIVER_GPIO(port, port_set_bits_raw));
46 return z_impl_gpio_port_set_bits_raw((const struct device *)port,
47 pins);
48 }
49 #include <syscalls/gpio_port_set_bits_raw_mrsh.c>
50
z_vrfy_gpio_port_clear_bits_raw(const struct device * port,gpio_port_pins_t pins)51 static inline int z_vrfy_gpio_port_clear_bits_raw(const struct device *port,
52 gpio_port_pins_t pins)
53 {
54 Z_OOPS(Z_SYSCALL_DRIVER_GPIO(port, port_clear_bits_raw));
55 return z_impl_gpio_port_clear_bits_raw((const struct device *)port,
56 pins);
57 }
58 #include <syscalls/gpio_port_clear_bits_raw_mrsh.c>
59
z_vrfy_gpio_port_toggle_bits(const struct device * port,gpio_port_pins_t pins)60 static inline int z_vrfy_gpio_port_toggle_bits(const struct device *port,
61 gpio_port_pins_t pins)
62 {
63 Z_OOPS(Z_SYSCALL_DRIVER_GPIO(port, port_toggle_bits));
64 return z_impl_gpio_port_toggle_bits((const struct device *)port, pins);
65 }
66 #include <syscalls/gpio_port_toggle_bits_mrsh.c>
67
z_vrfy_gpio_pin_interrupt_configure(const struct device * port,gpio_pin_t pin,gpio_flags_t flags)68 static inline int z_vrfy_gpio_pin_interrupt_configure(const struct device *port,
69 gpio_pin_t pin,
70 gpio_flags_t flags)
71 {
72 Z_OOPS(Z_SYSCALL_DRIVER_GPIO(port, pin_interrupt_configure));
73 return z_impl_gpio_pin_interrupt_configure((const struct device *)port,
74 pin,
75 flags);
76 }
77 #include <syscalls/gpio_pin_interrupt_configure_mrsh.c>
78
z_vrfy_gpio_get_pending_int(const struct device * dev)79 static inline int z_vrfy_gpio_get_pending_int(const struct device *dev)
80 {
81 Z_OOPS(Z_SYSCALL_DRIVER_GPIO(dev, get_pending_int));
82
83 return z_impl_gpio_get_pending_int((const struct device *)dev);
84 }
85 #include <syscalls/gpio_get_pending_int_mrsh.c>
86