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

#ifndef Z_INCLUDE_SYSCALLS_CLOCK_H
#define Z_INCLUDE_SYSCALLS_CLOCK_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 void z_impl_sys_clock_getrtoffset(struct timespec * tp);

static inline void sys_clock_getrtoffset(struct timespec * tp)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		union { uintptr_t x; struct timespec * val; } parm0 = { .val = tp };
		(void) arch_syscall_invoke1(parm0.x, K_SYSCALL_SYS_CLOCK_GETRTOFFSET);
		return;
	}
#endif
	compiler_barrier();
	z_impl_sys_clock_getrtoffset(tp);
}

#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING

#define sys_clock_getrtoffset(tp) do { 	sys_port_trace_syscall_enter(K_SYSCALL_SYS_CLOCK_GETRTOFFSET, sys_clock_getrtoffset, tp); 	sys_clock_getrtoffset(tp); 	sys_port_trace_syscall_exit(K_SYSCALL_SYS_CLOCK_GETRTOFFSET, sys_clock_getrtoffset, tp); } while(false)
#endif
#endif


extern int z_impl_sys_clock_settime(int clock_id, const struct timespec * tp);

static inline int sys_clock_settime(int clock_id, const struct timespec * tp)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		union { uintptr_t x; int val; } parm0 = { .val = clock_id };
		union { uintptr_t x; const struct timespec * val; } parm1 = { .val = tp };
		return (int) arch_syscall_invoke2(parm0.x, parm1.x, K_SYSCALL_SYS_CLOCK_SETTIME);
	}
#endif
	compiler_barrier();
	return z_impl_sys_clock_settime(clock_id, tp);
}

#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING

#define sys_clock_settime(clock_id, tp) ({ 	int syscall__retval; 	sys_port_trace_syscall_enter(K_SYSCALL_SYS_CLOCK_SETTIME, sys_clock_settime, clock_id, tp); 	syscall__retval = sys_clock_settime(clock_id, tp); 	sys_port_trace_syscall_exit(K_SYSCALL_SYS_CLOCK_SETTIME, sys_clock_settime, clock_id, tp, syscall__retval); 	syscall__retval; })
#endif
#endif


extern int z_impl_sys_clock_nanosleep(int clock_id, int flags, const struct timespec * rqtp, struct timespec * rmtp);

static inline int sys_clock_nanosleep(int clock_id, int flags, const struct timespec * rqtp, struct timespec * rmtp)
{
#ifdef CONFIG_USERSPACE
	if (z_syscall_trap()) {
		union { uintptr_t x; int val; } parm0 = { .val = clock_id };
		union { uintptr_t x; int val; } parm1 = { .val = flags };
		union { uintptr_t x; const struct timespec * val; } parm2 = { .val = rqtp };
		union { uintptr_t x; struct timespec * val; } parm3 = { .val = rmtp };
		return (int) arch_syscall_invoke4(parm0.x, parm1.x, parm2.x, parm3.x, K_SYSCALL_SYS_CLOCK_NANOSLEEP);
	}
#endif
	compiler_barrier();
	return z_impl_sys_clock_nanosleep(clock_id, flags, rqtp, rmtp);
}

#if defined(CONFIG_TRACING_SYSCALL)
#ifndef DISABLE_SYSCALL_TRACING

#define sys_clock_nanosleep(clock_id, flags, rqtp, rmtp) ({ 	int syscall__retval; 	sys_port_trace_syscall_enter(K_SYSCALL_SYS_CLOCK_NANOSLEEP, sys_clock_nanosleep, clock_id, flags, rqtp, rmtp); 	syscall__retval = sys_clock_nanosleep(clock_id, flags, rqtp, rmtp); 	sys_port_trace_syscall_exit(K_SYSCALL_SYS_CLOCK_NANOSLEEP, sys_clock_nanosleep, clock_id, flags, rqtp, rmtp, syscall__retval); 	syscall__retval; })
#endif
#endif


#ifdef __cplusplus
}
#endif

#endif
#endif /* include guard */
