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


#include <tracing/tracing_syscall.h>

#ifndef _ASMLANGUAGE

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

#include <linker/sections.h>


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

#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#if !defined(__XCC__)
#pragma GCC diagnostic ignored "-Warray-bounds"
#endif
#endif

#ifdef __cplusplus
extern "C" {
#endif

extern int z_impl_phy_configure_link(const struct device * dev, enum phy_link_speed speeds);

__pinned_func
static inline int phy_configure_link(const struct device * dev, enum phy_link_speed speeds)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		/* coverity[OVERRUN] */
		return (int) arch_syscall_invoke2(*(uintptr_t *)&dev, *(uintptr_t *)&speeds, K_SYSCALL_PHY_CONFIGURE_LINK);
	}
#endif
	compiler_barrier();
	return z_impl_phy_configure_link(dev, speeds);
}

#if (CONFIG_TRACING_SYSCALL == 1)
#ifndef DISABLE_SYSCALL_TRACING

#define phy_configure_link(dev, speeds) ({ 	int retval; 	sys_port_trace_syscall_enter(K_SYSCALL_PHY_CONFIGURE_LINK, phy_configure_link, dev, speeds); 	retval = phy_configure_link(dev, speeds); 	sys_port_trace_syscall_exit(K_SYSCALL_PHY_CONFIGURE_LINK, phy_configure_link, dev, speeds, retval); 	retval; })
#endif
#endif


extern int z_impl_phy_get_link_state(const struct device * dev, struct phy_link_state * state);

__pinned_func
static inline int phy_get_link_state(const struct device * dev, struct phy_link_state * state)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		/* coverity[OVERRUN] */
		return (int) arch_syscall_invoke2(*(uintptr_t *)&dev, *(uintptr_t *)&state, K_SYSCALL_PHY_GET_LINK_STATE);
	}
#endif
	compiler_barrier();
	return z_impl_phy_get_link_state(dev, state);
}

#if (CONFIG_TRACING_SYSCALL == 1)
#ifndef DISABLE_SYSCALL_TRACING

#define phy_get_link_state(dev, state) ({ 	int retval; 	sys_port_trace_syscall_enter(K_SYSCALL_PHY_GET_LINK_STATE, phy_get_link_state, dev, state); 	retval = phy_get_link_state(dev, state); 	sys_port_trace_syscall_exit(K_SYSCALL_PHY_GET_LINK_STATE, phy_get_link_state, dev, state, retval); 	retval; })
#endif
#endif


extern int z_impl_phy_link_callback_set(const struct device * dev, phy_callback_t callback, void * user_data);

__pinned_func
static inline int phy_link_callback_set(const struct device * dev, phy_callback_t callback, void * user_data)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		/* coverity[OVERRUN] */
		return (int) arch_syscall_invoke3(*(uintptr_t *)&dev, *(uintptr_t *)&callback, *(uintptr_t *)&user_data, K_SYSCALL_PHY_LINK_CALLBACK_SET);
	}
#endif
	compiler_barrier();
	return z_impl_phy_link_callback_set(dev, callback, user_data);
}

#if (CONFIG_TRACING_SYSCALL == 1)
#ifndef DISABLE_SYSCALL_TRACING

#define phy_link_callback_set(dev, callback, user_data) ({ 	int retval; 	sys_port_trace_syscall_enter(K_SYSCALL_PHY_LINK_CALLBACK_SET, phy_link_callback_set, dev, callback, user_data); 	retval = phy_link_callback_set(dev, callback, user_data); 	sys_port_trace_syscall_exit(K_SYSCALL_PHY_LINK_CALLBACK_SET, phy_link_callback_set, dev, callback, user_data, retval); 	retval; })
#endif
#endif


extern int z_impl_phy_read(const struct device * dev, uint16_t reg_addr, uint32_t * value);

__pinned_func
static inline int phy_read(const struct device * dev, uint16_t reg_addr, uint32_t * value)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		/* coverity[OVERRUN] */
		return (int) arch_syscall_invoke3(*(uintptr_t *)&dev, *(uintptr_t *)&reg_addr, *(uintptr_t *)&value, K_SYSCALL_PHY_READ);
	}
#endif
	compiler_barrier();
	return z_impl_phy_read(dev, reg_addr, value);
}

#if (CONFIG_TRACING_SYSCALL == 1)
#ifndef DISABLE_SYSCALL_TRACING

#define phy_read(dev, reg_addr, value) ({ 	int retval; 	sys_port_trace_syscall_enter(K_SYSCALL_PHY_READ, phy_read, dev, reg_addr, value); 	retval = phy_read(dev, reg_addr, value); 	sys_port_trace_syscall_exit(K_SYSCALL_PHY_READ, phy_read, dev, reg_addr, value, retval); 	retval; })
#endif
#endif


extern int z_impl_phy_write(const struct device * dev, uint16_t reg_addr, uint32_t value);

__pinned_func
static inline int phy_write(const struct device * dev, uint16_t reg_addr, uint32_t value)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		/* coverity[OVERRUN] */
		return (int) arch_syscall_invoke3(*(uintptr_t *)&dev, *(uintptr_t *)&reg_addr, *(uintptr_t *)&value, K_SYSCALL_PHY_WRITE);
	}
#endif
	compiler_barrier();
	return z_impl_phy_write(dev, reg_addr, value);
}

#if (CONFIG_TRACING_SYSCALL == 1)
#ifndef DISABLE_SYSCALL_TRACING

#define phy_write(dev, reg_addr, value) ({ 	int retval; 	sys_port_trace_syscall_enter(K_SYSCALL_PHY_WRITE, phy_write, dev, reg_addr, value); 	retval = phy_write(dev, reg_addr, value); 	sys_port_trace_syscall_exit(K_SYSCALL_PHY_WRITE, phy_write, dev, reg_addr, value, retval); 	retval; })
#endif
#endif


#ifdef __cplusplus
}
#endif

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

#endif
#endif /* include guard */
