
/* auto-generated by gen_syscalls.py, don't edit */
#ifndef Z_INCLUDE_SYSCALLS_GPIO_H
#define Z_INCLUDE_SYSCALLS_GPIO_H


#ifndef _ASMLANGUAGE

#include <syscall_list.h>
#include <syscall.h>

#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
#pragma GCC diagnostic push
#endif

#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif

#ifdef __cplusplus
extern "C" {
#endif

extern int z_impl_gpio_config(struct device * port, gpio_pin_t pin, gpio_flags_t flags);
static inline int gpio_config(struct device * port, gpio_pin_t pin, gpio_flags_t flags)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		return (int) arch_syscall_invoke3(*(uintptr_t *)&port, *(uintptr_t *)&pin, *(uintptr_t *)&flags, K_SYSCALL_GPIO_CONFIG);
	}
#endif
	compiler_barrier();
	return z_impl_gpio_config(port, pin, flags);
}


extern int z_impl_gpio_enable_callback(struct device * port, gpio_pin_t pin);
static inline int gpio_enable_callback(struct device * port, gpio_pin_t pin)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		return (int) arch_syscall_invoke2(*(uintptr_t *)&port, *(uintptr_t *)&pin, K_SYSCALL_GPIO_ENABLE_CALLBACK);
	}
#endif
	compiler_barrier();
	return z_impl_gpio_enable_callback(port, pin);
}


extern int z_impl_gpio_disable_callback(struct device * port, gpio_pin_t pin);
static inline int gpio_disable_callback(struct device * port, gpio_pin_t pin)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		return (int) arch_syscall_invoke2(*(uintptr_t *)&port, *(uintptr_t *)&pin, K_SYSCALL_GPIO_DISABLE_CALLBACK);
	}
#endif
	compiler_barrier();
	return z_impl_gpio_disable_callback(port, pin);
}


extern int z_impl_gpio_pin_interrupt_configure(struct device * port, gpio_pin_t pin, gpio_flags_t flags);
static inline int gpio_pin_interrupt_configure(struct device * port, gpio_pin_t pin, gpio_flags_t flags)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		return (int) arch_syscall_invoke3(*(uintptr_t *)&port, *(uintptr_t *)&pin, *(uintptr_t *)&flags, K_SYSCALL_GPIO_PIN_INTERRUPT_CONFIGURE);
	}
#endif
	compiler_barrier();
	return z_impl_gpio_pin_interrupt_configure(port, pin, flags);
}


extern int z_impl_gpio_port_get_raw(struct device * port, gpio_port_value_t * value);
static inline int gpio_port_get_raw(struct device * port, gpio_port_value_t * value)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		return (int) arch_syscall_invoke2(*(uintptr_t *)&port, *(uintptr_t *)&value, K_SYSCALL_GPIO_PORT_GET_RAW);
	}
#endif
	compiler_barrier();
	return z_impl_gpio_port_get_raw(port, value);
}


extern int z_impl_gpio_port_set_masked_raw(struct device * port, gpio_port_pins_t mask, gpio_port_value_t value);
static inline int gpio_port_set_masked_raw(struct device * port, gpio_port_pins_t mask, gpio_port_value_t value)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		return (int) arch_syscall_invoke3(*(uintptr_t *)&port, *(uintptr_t *)&mask, *(uintptr_t *)&value, K_SYSCALL_GPIO_PORT_SET_MASKED_RAW);
	}
#endif
	compiler_barrier();
	return z_impl_gpio_port_set_masked_raw(port, mask, value);
}


extern int z_impl_gpio_port_set_bits_raw(struct device * port, gpio_port_pins_t pins);
static inline int gpio_port_set_bits_raw(struct device * port, gpio_port_pins_t pins)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		return (int) arch_syscall_invoke2(*(uintptr_t *)&port, *(uintptr_t *)&pins, K_SYSCALL_GPIO_PORT_SET_BITS_RAW);
	}
#endif
	compiler_barrier();
	return z_impl_gpio_port_set_bits_raw(port, pins);
}


extern int z_impl_gpio_port_clear_bits_raw(struct device * port, gpio_port_pins_t pins);
static inline int gpio_port_clear_bits_raw(struct device * port, gpio_port_pins_t pins)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		return (int) arch_syscall_invoke2(*(uintptr_t *)&port, *(uintptr_t *)&pins, K_SYSCALL_GPIO_PORT_CLEAR_BITS_RAW);
	}
#endif
	compiler_barrier();
	return z_impl_gpio_port_clear_bits_raw(port, pins);
}


extern int z_impl_gpio_port_toggle_bits(struct device * port, gpio_port_pins_t pins);
static inline int gpio_port_toggle_bits(struct device * port, gpio_port_pins_t pins)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		return (int) arch_syscall_invoke2(*(uintptr_t *)&port, *(uintptr_t *)&pins, K_SYSCALL_GPIO_PORT_TOGGLE_BITS);
	}
#endif
	compiler_barrier();
	return z_impl_gpio_port_toggle_bits(port, pins);
}


extern int z_impl_gpio_get_pending_int(struct device * dev);
static inline int gpio_get_pending_int(struct device * dev)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		return (int) arch_syscall_invoke1(*(uintptr_t *)&dev, K_SYSCALL_GPIO_GET_PENDING_INT);
	}
#endif
	compiler_barrier();
	return z_impl_gpio_get_pending_int(dev);
}


#ifdef __cplusplus
}
#endif

#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
#pragma GCC diagnostic pop
#endif

#endif
#endif /* include guard */
