28#ifndef __DEV_QEMU_FW_CFG_HH__
29#define __DEV_QEMU_FW_CFG_HH__
40#include "params/QemuFwCfg.hh"
41#include "params/QemuFwCfgIo.hh"
42#include "params/QemuFwCfgItem.hh"
43#include "params/QemuFwCfgItemBytes.hh"
44#include "params/QemuFwCfgItemFile.hh"
45#include "params/QemuFwCfgItemString.hh"
46#include "params/QemuFwCfgMmio.hh"
65 FwCfgItem(
const std::string &new_path,
bool arch_specific,
66 uint16_t new_index=0) :
79 virtual void read(
void *buf, uint64_t
offset, uint32_t to_read) = 0;
86 virtual const void *
bytes()
const = 0;
91 void read(
void *buf, uint64_t
offset, uint32_t to_read)
override;
102 const std::string
path, uint16_t new_index=0) :
122 const std::string _str, uint16_t new_index=0) :
130 const void *
bytes()
const override {
return (
void *)
str.data(); }
134 return sizeof(std::string::value_type) *
str.length();
154 const void *
bytes()
const override {
return (
void *)
data.data(); }
171template <
class ItemType>
178 template <
class PType,
class =
typename std::enable_if_t<
179 std::is_base_of_v<SimObjectParams, PType>>>
193 std::map<std::string, uint16_t>
names;
213 void update(
const std::map<std::string, uint16_t> &
names,
214 const std::map<uint16_t, FwCfgItem *> &
numbers);
216 const void *
bytes()
const override {
return (
void *)
data.data(); }
229 void select(uint16_t key);
237 void readItem(
void *buf, uint32_t length);
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
void update() const
Align cycle and tick to the next clock edge if not already done.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
This device is the base class which all devices senstive to an address range inherit from.
Abstract superclass for simulation objects.
uint8_t const * data() const
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
const void * bytes() const override
FwCfgItemBytes(const std::string &new_path, bool arch_specific, const std::vector< uint8_t > &_data, uint16_t new_index=0)
FwCfgItemBytes(const QemuFwCfgItemBytesParams &p)
std::vector< uint8_t > data
uint64_t length() const override
FwCfgItemFactoryBase(const Params &p)
virtual FwCfgItem & item()=0
FwCfgItem & item() override
FwCfgItemFactory(const PType &p)
uint64_t length() const override
FwCfgItemFile(const QemuFwCfgItemFileParams &p)
const gem5::loader::ImageFileData data
FwCfgItemFile(const std::string &new_path, bool arch_specific, const std::string path, uint16_t new_index=0)
const void * bytes() const override
virtual const void * bytes() const =0
void read(void *buf, uint64_t offset, uint32_t to_read) override
uint64_t length() const override
FwCfgItemString(const std::string &new_path, bool arch_specific, const std::string _str, uint16_t new_index=0)
FwCfgItemString(const QemuFwCfgItemStringParams &p)
const void * bytes() const override
virtual void read(void *buf, uint64_t offset, uint32_t to_read)=0
bool archSpecific() const
virtual uint64_t length() const =0
void index(uint16_t new_index)
const std::string & path() const
FwCfgItem(const std::string &new_path, bool arch_specific, uint16_t new_index=0)
FwCfgMmio(const Params &p)
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
uint64_t length() const override
const void * bytes() const override
std::vector< uint8_t > data
FwCfg(const Params &p, const AddrRangeList &addr_ranges)
AddrRangeList getAddrRanges() const override
Every PIO device is obliged to provide an implementation that returns the address ranges the device r...
void readItem(void *buf, uint32_t length)
uint32_t nextGenericIndex
std::map< uint16_t, FwCfgItem * > numbers
const AddrRangeList addrRanges
static const uint32_t MaxGenericIndex
static const uint32_t MaxArchIndex
void select(uint16_t key)
FwCfgItemString signature
std::map< std::string, uint16_t > names
void addItem(FwCfgItem *item)
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint64_t Tick
Tick count type.