Add ygg_debug_trace(2)

This commit is contained in:
Mark
2020-07-20 17:08:08 +03:00
parent ee5b901eac
commit 1ab3bdff71
2 changed files with 22 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
#pragma once
void ygg_debug_trace(const char *msg, ...);
+19
View File
@@ -0,0 +1,19 @@
#include <_libc/syscalls.h>
#include <ygg/syscall.h>
#include <sys/ioctl.h>
#include <stdint.h>
#include <stdarg.h>
#include <errno.h>
void ygg_debug_trace(const char *fmt, ...) {
uintptr_t a0, a1, a2, a3, a4;
va_list args;
va_start(args, fmt);
a0 = va_arg(args, uintptr_t);
a1 = va_arg(args, uintptr_t);
a2 = va_arg(args, uintptr_t);
a3 = va_arg(args, uintptr_t);
a4 = va_arg(args, uintptr_t);
va_end(args);
__syscall6(SYSCALL_NRX_TRACE, (long) fmt, a0, a1, a2, a3, a4);
}