nemu,chore: reformat c/c++ code

This commit is contained in:
xinyangli 2024-08-13 18:49:08 +08:00
parent a5790308f0
commit 96ae890632
Signed by: xin
SSH key fingerprint: SHA256:qZ/tzd8lYRtUFSrfBDBMcUqV4GHKxqeqRA3huItgvbk
8 changed files with 84 additions and 96 deletions

View file

@ -15,6 +15,7 @@
#include "common.h"
#include "debug.h"
#include "utils.h"
#include <device/mmio.h>
#include <isa.h>
#include <memory/host.h>
@ -44,9 +45,14 @@ static void pmem_write(paddr_t addr, int len, word_t data) {
}
static void out_of_bound(paddr_t addr) {
#ifdef CONFIG_TARGET_SHARE
// Do not panic when used as a library. Give an error in log
Error("Out of bound at 0x%x", addr);
#else
panic("address = " FMT_PADDR " is out of bound of pmem [" FMT_PADDR
", " FMT_PADDR "] at pc = " FMT_WORD,
addr, PMEM_LEFT, PMEM_RIGHT, cpu.pc);
#endif
}
#ifdef CONFIG_MTRACE