From 6456b5ad25a2b7efb6c4f9ccd28e00a5408eb743 Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Fri, 2 Jun 2023 09:27:09 -0700 Subject: sim_t: Remove boot_rom/ns16550 members of sim_t These are redundant with sim_t::devices --- riscv/sim.cc | 6 +++--- riscv/sim.h | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/riscv/sim.cc b/riscv/sim.cc index 9d0bfb8..4fa49b2 100644 --- a/riscv/sim.cc +++ b/riscv/sim.cc @@ -145,8 +145,8 @@ sim_t::sim_t(const cfg_t *cfg, bool halted, if (fdt_parse_ns16550(fdt, &ns16550_base, &ns16550_shift, &ns16550_io_width, "ns16550a") == 0) { assert(intctrl); - ns16550.reset(new ns16550_t(&bus, intctrl, NS16550_INTERRUPT_ID, - ns16550_shift, ns16550_io_width)); + std::shared_ptr ns16550(new ns16550_t(&bus, intctrl, NS16550_INTERRUPT_ID, + ns16550_shift, ns16550_io_width)); bus.add_device(ns16550_base, ns16550.get()); devices.push_back(ns16550); } @@ -377,7 +377,7 @@ void sim_t::set_rom() const int align = 0x1000; rom.resize((rom.size() + align - 1) / align * align); - boot_rom.reset(new rom_device_t(rom)); + std::shared_ptr boot_rom(new rom_device_t(rom)); bus.add_device(DEFAULT_RSTVEC, boot_rom.get()); devices.push_back(boot_rom); } diff --git a/riscv/sim.h b/riscv/sim.h index 3afeedd..a851643 100644 --- a/riscv/sim.h +++ b/riscv/sim.h @@ -71,10 +71,8 @@ private: std::string dtb; bool dtb_enabled; std::vector> devices; - std::shared_ptr boot_rom; std::shared_ptr clint; std::shared_ptr plic; - std::shared_ptr ns16550; bus_t bus; log_file_t log_file; -- cgit v1.1