> 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:
parent
5a5635e11f
commit
80e26a574b
2 changed files with 6 additions and 4 deletions
|
@ -20,6 +20,9 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <utils.h>
|
#include <utils.h>
|
||||||
|
|
||||||
|
#define Trace(format, ...) \
|
||||||
|
_Log("[TRACE] " format "\n", ## __VA_ARGS__)
|
||||||
|
|
||||||
#define Log(format, ...) \
|
#define Log(format, ...) \
|
||||||
_Log(ANSI_FMT("[INFO] %s:%d %s() ", ANSI_FG_BLUE) format "\n", \
|
_Log(ANSI_FMT("[INFO] %s:%d %s() ", ANSI_FG_BLUE) format "\n", \
|
||||||
__FILE__, __LINE__, __func__, ## __VA_ARGS__)
|
__FILE__, __LINE__, __func__, ## __VA_ARGS__)
|
||||||
|
|
|
@ -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) {
|
static void mtrace_print(char type, word_t addr, int len, word_t data) {
|
||||||
for (int i = 0; i < range_count; i++)
|
for (int i = 0; i < range_count; i++)
|
||||||
if (addr <= mtrace_end[i] && addr >= mtrace_start[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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,11 +77,10 @@ void init_mem() {
|
||||||
ptr = strtok_r(NULL, ",", &saveptr);
|
ptr = strtok_r(NULL, ",", &saveptr);
|
||||||
if (!ptr) break;
|
if (!ptr) break;
|
||||||
}
|
}
|
||||||
puts("MTRACE ranges: ");
|
Trace("MTRACE ranges: ");
|
||||||
for (int i = 0; i < range_count; i++) {
|
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
|
#endif
|
||||||
IFDEF(CONFIG_MEM_RANDOM, memset(pmem, rand(), CONFIG_MSIZE));
|
IFDEF(CONFIG_MEM_RANDOM, memset(pmem, rand(), CONFIG_MSIZE));
|
||||||
Log("physical memory area [" FMT_PADDR ", " FMT_PADDR "]", PMEM_LEFT, PMEM_RIGHT);
|
Log("physical memory area [" FMT_PADDR ", " FMT_PADDR "]", PMEM_LEFT, PMEM_RIGHT);
|
||||||
|
|
Loading…
Reference in a new issue