aboutsummaryrefslogtreecommitdiff
path: root/riscv/plic.cc
diff options
context:
space:
mode:
authorLIU Yu <liuy@etech-inc.com>2024-04-30 09:50:09 +0800
committerLIU Yu <liuy@etech-inc.com>2024-04-30 09:56:24 +0800
commite7e039dece6bfb30c9f0d85856777aa3dace4b81 (patch)
treed593637619904f62869790e5b88ec9bd99c16550 /riscv/plic.cc
parentd39cbb3ad27b2de882260c0a22f11a59efebb151 (diff)
downloadriscv-isa-sim-e7e039dece6bfb30c9f0d85856777aa3dace4b81.zip
riscv-isa-sim-e7e039dece6bfb30c9f0d85856777aa3dace4b81.tar.gz
riscv-isa-sim-e7e039dece6bfb30c9f0d85856777aa3dace4b81.tar.bz2
Support per-device arguments and device factory reuse
As proposed in #1652, we made the following changes to MMIO device (factory) plugin API, to mitigate current limitations and facilitate factory reuse. - removed `sargs` from `device_factory_t`, and introduced a new type alias `device_factory_sargs_t` to capture `<device_factory_t *, sargs>` pairs, this is used to instantiate sim_t instances; - changed the signature of `device_factory_t::generate_fdt` and `device_factory_t::parse_from_fdt` to take on an extra `sargs` argument, for instantiating devices with per-device arguments; - made `device_factory_t` const and potentially resuable across multiple `sim_t` instances.
Diffstat (limited to 'riscv/plic.cc')
-rw-r--r--riscv/plic.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/riscv/plic.cc b/riscv/plic.cc
index 01def70..78eb1d2 100644
--- a/riscv/plic.cc
+++ b/riscv/plic.cc
@@ -401,7 +401,7 @@ bool plic_t::store(reg_t addr, size_t len, const uint8_t* bytes)
return ret;
}
-std::string plic_generate_dts(const sim_t* sim)
+std::string plic_generate_dts(const sim_t* sim, const std::vector<std::string>& UNUSED sargs)
{
std::stringstream s;
s << std::hex
@@ -424,7 +424,7 @@ std::string plic_generate_dts(const sim_t* sim)
return s.str();
}
-plic_t* plic_parse_from_fdt(const void* fdt, const sim_t* sim, reg_t* base, const std::vector<std::string>& sargs)
+plic_t* plic_parse_from_fdt(const void* fdt, const sim_t* sim, reg_t* base, const std::vector<std::string>& UNUSED sargs)
{
uint32_t plic_ndev;
if (fdt_parse_plic(fdt, base, &plic_ndev, "riscv,plic0") == 0 ||