Skip to content

Commit

Permalink
work with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
Phantom1003 committed Oct 12, 2023
1 parent a7e37d6 commit 64e181f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 6 additions & 4 deletions cosim/cj.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ cosim_cj_t::cosim_cj_t(config_t& cfg) :
// cj_debug = false;

// create memory and debug mmu
std::vector<std::pair<reg_t, mem_t*>> mems;
std::vector<std::pair<reg_t, abstract_mem_t*>> mems;
for (const auto &cfg : cfg.mem_layout())
mems.push_back(std::make_pair(cfg.get_base(), new mem_t(cfg.get_size())));

Expand Down Expand Up @@ -132,9 +132,11 @@ cosim_cj_t::cosim_cj_t(config_t& cfg) :
dtb = strstream.str();
} else {
std::pair<reg_t, reg_t> initrd_bounds = cfg.initrd_bounds();
std::string dump_serial0 = "SERIAL0: dummy_stdout {};";
dts = make_dts(cfg.time_freq_count(), cfg.cycle_freq(),
initrd_bounds.first, initrd_bounds.second,
cfg.bootargs(), cfg.pmpregions, procs, mems);
cfg.bootargs(), cfg.pmpregions, procs, mems,
dump_serial0);
dtb = dts_compile(dts);
}

Expand Down Expand Up @@ -536,10 +538,10 @@ void cosim_cj_t::handle_tohost() {
uint64_t len = magic_mem[3];
std::vector<char> buf(len);
tmp.read(magic_mem[2], len, buf.data());
write(1,buf.data(),len);
ssize_t ret = write(1,buf.data(),len);
}
else {
printf("[CJ] unsupported syscall #%d!\n", magic_mem[0]);
printf("[CJ] unsupported syscall #%ld!\n", magic_mem[0]);
}

}
Expand Down
1 change: 0 additions & 1 deletion cosim/cj.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ class cosim_cj_t : simif_t, chunked_memif_t {
std::string dtb;
std::string dtb_file;
std::unique_ptr<rom_device_t> boot_rom;
std::unique_ptr<clint_t> clint;
std::unique_ptr<magic_t> magic;
bus_t bus;

Expand Down

0 comments on commit 64e181f

Please sign in to comment.