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

#ifndef Z_INCLUDE_SYSCALLS_MEMC_H
#define Z_INCLUDE_SYSCALLS_MEMC_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_memc_read(const struct device * dev, uint32_t addr, uint8_t * data, size_t len);

static inline int memc_read(const struct device * dev, uint32_t addr, uint8_t * data, size_t len)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		union { uintptr_t x; const struct device * val; } parm0 = { .val = dev };
		union { uintptr_t x; uint32_t val; } parm1 = { .val = addr };
		union { uintptr_t x; uint8_t * val; } parm2 = { .val = data };
		union { uintptr_t x; size_t val; } parm3 = { .val = len };
		return (int) arch_syscall_invoke4(parm0.x, parm1.x, parm2.x, parm3.x, K_SYSCALL_MEMC_READ);
	}
#endif
	compiler_barrier();
	return z_impl_memc_read(dev, addr, data, len);
}

#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING

#define memc_read(dev, addr, data, len) ({ 	int syscall__retval; 	sys_port_trace_syscall_enter(K_SYSCALL_MEMC_READ, memc_read, dev, addr, data, len); 	syscall__retval = memc_read(dev, addr, data, len); 	sys_port_trace_syscall_exit(K_SYSCALL_MEMC_READ, memc_read, dev, addr, data, len, syscall__retval); 	syscall__retval; })
#endif
#endif


extern int z_impl_memc_write(const struct device * dev, uint32_t addr, const uint8_t * data, size_t len);

static inline int memc_write(const struct device * dev, uint32_t addr, const uint8_t * data, size_t len)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		union { uintptr_t x; const struct device * val; } parm0 = { .val = dev };
		union { uintptr_t x; uint32_t val; } parm1 = { .val = addr };
		union { uintptr_t x; const uint8_t * val; } parm2 = { .val = data };
		union { uintptr_t x; size_t val; } parm3 = { .val = len };
		return (int) arch_syscall_invoke4(parm0.x, parm1.x, parm2.x, parm3.x, K_SYSCALL_MEMC_WRITE);
	}
#endif
	compiler_barrier();
	return z_impl_memc_write(dev, addr, data, len);
}

#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING

#define memc_write(dev, addr, data, len) ({ 	int syscall__retval; 	sys_port_trace_syscall_enter(K_SYSCALL_MEMC_WRITE, memc_write, dev, addr, data, len); 	syscall__retval = memc_write(dev, addr, data, len); 	sys_port_trace_syscall_exit(K_SYSCALL_MEMC_WRITE, memc_write, dev, addr, data, len, syscall__retval); 	syscall__retval; })
#endif
#endif


extern int z_impl_memc_get_size(const struct device * dev, uint64_t * size);

static inline int memc_get_size(const struct device * dev, uint64_t * size)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		union { uintptr_t x; const struct device * val; } parm0 = { .val = dev };
		union { uintptr_t x; uint64_t * val; } parm1 = { .val = size };
		return (int) arch_syscall_invoke2(parm0.x, parm1.x, K_SYSCALL_MEMC_GET_SIZE);
	}
#endif
	compiler_barrier();
	return z_impl_memc_get_size(dev, size);
}

#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING

#define memc_get_size(dev, size) ({ 	int syscall__retval; 	sys_port_trace_syscall_enter(K_SYSCALL_MEMC_GET_SIZE, memc_get_size, dev, size); 	syscall__retval = memc_get_size(dev, size); 	sys_port_trace_syscall_exit(K_SYSCALL_MEMC_GET_SIZE, memc_get_size, dev, size, syscall__retval); 	syscall__retval; })
#endif
#endif


extern int z_impl_memc_read_id(const struct device * dev, uint8_t * id, size_t len);

static inline int memc_read_id(const struct device * dev, uint8_t * id, size_t len)
{
#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 = id };
		union { uintptr_t x; size_t val; } parm2 = { .val = len };
		return (int) arch_syscall_invoke3(parm0.x, parm1.x, parm2.x, K_SYSCALL_MEMC_READ_ID);
	}
#endif
	compiler_barrier();
	return z_impl_memc_read_id(dev, id, len);
}

#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING

#define memc_read_id(dev, id, len) ({ 	int syscall__retval; 	sys_port_trace_syscall_enter(K_SYSCALL_MEMC_READ_ID, memc_read_id, dev, id, len); 	syscall__retval = memc_read_id(dev, id, len); 	sys_port_trace_syscall_exit(K_SYSCALL_MEMC_READ_ID, memc_read_id, dev, id, len, syscall__retval); 	syscall__retval; })
#endif
#endif


#ifdef __cplusplus
}
#endif

#endif
#endif /* include guard */
