/* auto-generated by gen_syscalls.py, don't edit */

#ifndef Z_INCLUDE_SYSCALLS_PSI5_H
#define Z_INCLUDE_SYSCALLS_PSI5_H


#include <zephyr/tracing/tracing_syscall.h>

#ifndef _ASMLANGUAGE

#include <stdarg.h>

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

#include <zephyr/linker/sections.h>


#ifdef __cplusplus
extern "C" {
#endif

extern int z_impl_psi5_start_sync(const struct device * dev, uint8_t channel);

static inline int psi5_start_sync(const struct device * dev, uint8_t channel)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		union { uintptr_t x; const struct device * val; } parm0 = { .val = dev };
		union { uintptr_t x; uint8_t val; } parm1 = { .val = channel };
		return (int) arch_syscall_invoke2(parm0.x, parm1.x, K_SYSCALL_PSI5_START_SYNC);
	}
#endif
	compiler_barrier();
	return z_impl_psi5_start_sync(dev, channel);
}

#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING

#define psi5_start_sync(dev, channel) ({ 	int syscall__retval; 	sys_port_trace_syscall_enter(K_SYSCALL_PSI5_START_SYNC, psi5_start_sync, dev, channel); 	syscall__retval = psi5_start_sync(dev, channel); 	sys_port_trace_syscall_exit(K_SYSCALL_PSI5_START_SYNC, psi5_start_sync, dev, channel, syscall__retval); 	syscall__retval; })
#endif
#endif


extern int z_impl_psi5_stop_sync(const struct device * dev, uint8_t channel);

static inline int psi5_stop_sync(const struct device * dev, uint8_t channel)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		union { uintptr_t x; const struct device * val; } parm0 = { .val = dev };
		union { uintptr_t x; uint8_t val; } parm1 = { .val = channel };
		return (int) arch_syscall_invoke2(parm0.x, parm1.x, K_SYSCALL_PSI5_STOP_SYNC);
	}
#endif
	compiler_barrier();
	return z_impl_psi5_stop_sync(dev, channel);
}

#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING

#define psi5_stop_sync(dev, channel) ({ 	int syscall__retval; 	sys_port_trace_syscall_enter(K_SYSCALL_PSI5_STOP_SYNC, psi5_stop_sync, dev, channel); 	syscall__retval = psi5_stop_sync(dev, channel); 	sys_port_trace_syscall_exit(K_SYSCALL_PSI5_STOP_SYNC, psi5_stop_sync, dev, channel, syscall__retval); 	syscall__retval; })
#endif
#endif


extern int z_impl_psi5_send(const struct device * dev, uint8_t channel, const uint64_t data, k_timeout_t timeout, psi5_tx_callback_t callback, void * user_data);

static inline int psi5_send(const struct device * dev, uint8_t channel, const uint64_t data, k_timeout_t timeout, psi5_tx_callback_t callback, void * user_data)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		union { uintptr_t x; const struct device * val; } parm0 = { .val = dev };
		union { uintptr_t x; uint8_t val; } parm1 = { .val = channel };
		union { uintptr_t x; const uint64_t val; } parm2 = { .val = data };
		union { struct { uintptr_t lo, hi; } split; k_timeout_t val; } parm3 = { .val = timeout };
		union { uintptr_t x; psi5_tx_callback_t val; } parm4 = { .val = callback };
		union { uintptr_t x; void * val; } parm5 = { .val = user_data };
		uintptr_t more[] = {
			parm4.x,
			parm5.x
		};
		return (int) arch_syscall_invoke6(parm0.x, parm1.x, parm2.x, parm3.split.lo, parm3.split.hi, (uintptr_t) &more, K_SYSCALL_PSI5_SEND);
	}
#endif
	compiler_barrier();
	return z_impl_psi5_send(dev, channel, data, timeout, callback, user_data);
}

#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING

#define psi5_send(dev, channel, data, timeout, callback, user_data) ({ 	int syscall__retval; 	sys_port_trace_syscall_enter(K_SYSCALL_PSI5_SEND, psi5_send, dev, channel, data, timeout, callback, user_data); 	syscall__retval = psi5_send(dev, channel, data, timeout, callback, user_data); 	sys_port_trace_syscall_exit(K_SYSCALL_PSI5_SEND, psi5_send, dev, channel, data, timeout, callback, user_data, syscall__retval); 	syscall__retval; })
#endif
#endif


extern int z_impl_psi5_register_callback(const struct device * dev, uint8_t channel, struct psi5_rx_callback_configs callback_configs);

static inline int psi5_register_callback(const struct device * dev, uint8_t channel, struct psi5_rx_callback_configs callback_configs)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		union { uintptr_t x; const struct device * val; } parm0 = { .val = dev };
		union { uintptr_t x; uint8_t val; } parm1 = { .val = channel };
		union { uintptr_t x; struct psi5_rx_callback_configs val; } parm2 = { .val = callback_configs };
		return (int) arch_syscall_invoke3(parm0.x, parm1.x, parm2.x, K_SYSCALL_PSI5_REGISTER_CALLBACK);
	}
#endif
	compiler_barrier();
	return z_impl_psi5_register_callback(dev, channel, callback_configs);
}

#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING

#define psi5_register_callback(dev, channel, callback_configs) ({ 	int syscall__retval; 	sys_port_trace_syscall_enter(K_SYSCALL_PSI5_REGISTER_CALLBACK, psi5_register_callback, dev, channel, callback_configs); 	syscall__retval = psi5_register_callback(dev, channel, callback_configs); 	sys_port_trace_syscall_exit(K_SYSCALL_PSI5_REGISTER_CALLBACK, psi5_register_callback, dev, channel, callback_configs, syscall__retval); 	syscall__retval; })
#endif
#endif


#ifdef __cplusplus
}
#endif

#endif
#endif /* include guard */
