
/* auto-generated by gen_syscalls.py, don't edit */
#ifndef Z_INCLUDE_SYSCALLS_CACHE_H
#define Z_INCLUDE_SYSCALLS_CACHE_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 void z_impl_sys_cache_flush(void * addr, size_t size);
static inline void sys_cache_flush(void * addr, size_t size)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		arch_syscall_invoke2(*(uintptr_t *)&addr, *(uintptr_t *)&size, K_SYSCALL_SYS_CACHE_FLUSH);
		return;
	}
#endif
	compiler_barrier();
	z_impl_sys_cache_flush(addr, size);
}


extern void z_impl_sys_cache_invd(void * addr, size_t size);
static inline void sys_cache_invd(void * addr, size_t size)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		arch_syscall_invoke2(*(uintptr_t *)&addr, *(uintptr_t *)&size, K_SYSCALL_SYS_CACHE_INVD);
		return;
	}
#endif
	compiler_barrier();
	z_impl_sys_cache_invd(addr, size);
}


#ifdef __cplusplus
}
#endif

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

#endif
#endif /* include guard */
