> compile NEMU

ysyx_22040000 李心杨
Linux calcite 6.6.19 #1-NixOS SMP PREEMPT_DYNAMIC Fri Mar  1 12:35:11 UTC 2024 x86_64 GNU/Linux
 18:10:09  up   7:46,  2 users,  load average: 0.58, 0.65, 0.58
This commit is contained in:
tracer-ysyx 2024-03-13 18:10:09 +08:00 committed by xinyangli
parent 5a5635e11f
commit 80e26a574b
2 changed files with 6 additions and 4 deletions

View file

@ -20,6 +20,9 @@
#include <stdio.h>
#include <utils.h>
#define Trace(format, ...) \
_Log("[TRACE] " format "\n", ## __VA_ARGS__)
#define Log(format, ...) \
_Log(ANSI_FMT("[INFO] %s:%d %s() ", ANSI_FG_BLUE) format "\n", \
__FILE__, __LINE__, __func__, ## __VA_ARGS__)

View file

@ -52,7 +52,7 @@ static void out_of_bound(paddr_t addr) {
static void mtrace_print(char type, word_t addr, int len, word_t data) {
for (int i = 0; i < range_count; i++)
if (addr <= mtrace_end[i] && addr >= mtrace_start[i] ) {
printf("[TRACE] Mem %c " FMT_PADDR "%d D " FMT_PADDR "\n", type, addr, len, data);
Trace("Mem %c " FMT_PADDR "%d D " FMT_PADDR "\n", type, addr, len, data);
break;
}
}
@ -77,11 +77,10 @@ void init_mem() {
ptr = strtok_r(NULL, ",", &saveptr);
if (!ptr) break;
}
puts("MTRACE ranges: ");
Trace("MTRACE ranges: ");
for (int i = 0; i < range_count; i++) {
printf("[0x%x, 0x%x], ", mtrace_start[i], mtrace_end[i]);
Trace("[0x%x, 0x%x]", mtrace_start[i], mtrace_end[i]);
}
puts("");
#endif
IFDEF(CONFIG_MEM_RANDOM, memset(pmem, rand(), CONFIG_MSIZE));
Log("physical memory area [" FMT_PADDR ", " FMT_PADDR "]", PMEM_LEFT, PMEM_RIGHT);