From 64e181f581aadc294d745203e914e99c9b3e1715 Mon Sep 17 00:00:00 2001 From: Phantom1003 Date: Thu, 12 Oct 2023 17:06:19 +0800 Subject: [PATCH] work with upstream --- cosim/cj.cc | 10 ++++++---- cosim/cj.h | 1 - 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cosim/cj.cc b/cosim/cj.cc index 9440d042..0fdd3895 100755 --- a/cosim/cj.cc +++ b/cosim/cj.cc @@ -91,7 +91,7 @@ cosim_cj_t::cosim_cj_t(config_t& cfg) : // cj_debug = false; // create memory and debug mmu - std::vector> mems; + std::vector> mems; for (const auto &cfg : cfg.mem_layout()) mems.push_back(std::make_pair(cfg.get_base(), new mem_t(cfg.get_size()))); @@ -132,9 +132,11 @@ cosim_cj_t::cosim_cj_t(config_t& cfg) : dtb = strstream.str(); } else { std::pair 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); } @@ -536,10 +538,10 @@ void cosim_cj_t::handle_tohost() { uint64_t len = magic_mem[3]; std::vector 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]); } } diff --git a/cosim/cj.h b/cosim/cj.h index c2db67c0..9b08389e 100755 --- a/cosim/cj.h +++ b/cosim/cj.h @@ -202,7 +202,6 @@ class cosim_cj_t : simif_t, chunked_memif_t { std::string dtb; std::string dtb_file; std::unique_ptr boot_rom; - std::unique_ptr clint; std::unique_ptr magic; bus_t bus;