> compile NEMU

221220000 张三
Linux zzy 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
 21:40:08 up 6 days, 16:45,  1 user,  load average: 0.58, 0.58, 0.61
This commit is contained in:
tracer-ics2023
2024-09-23 21:40:10 +08:00
committed by zzy
parent 45429cb392
commit 2f71760552
3 changed files with 6 additions and 2 deletions

View File

@ -7,6 +7,10 @@
printf("\33[1;35m[%s,%d,%s] " format "\33[0m\n", \
__FILE__, __LINE__, __func__, ## __VA_ARGS__)
#define TRACE(format, ...) \
printf("\33[1;36m" format "\33[0m\n", \
## __VA_ARGS__)
#undef panic
#define panic(format, ...) \
do { \

View File

@ -3,7 +3,7 @@
void do_syscall(Context *c);
static Context* do_event(Event e, Context* c) {
switch (e.event) {
case EVENT_YIELD: printf("EVENT_YIELD\n"); break;
case EVENT_YIELD: TRACE("EVENT_YIELD"); break;
case EVENT_SYSCALL: do_syscall(c); break;
default: panic("Unhandled event ID = %d", e.event);
}

View File

@ -7,7 +7,7 @@ void do_syscall(Context *c) {
a[2] = c->GPR3;
a[3] = c->GPR4;
printf("syscall %d: %s\n", a[0], __syscall_names[a[0]]);
TRACE("syscall %d: %s", a[0], __syscall_names[a[0]]);
switch (a[0]) {
case SYS_yield: yield(); break;
case SYS_exit: halt(0); break;