60fillCopy(
void *dest,
size_t dest_size,
const void *src,
size_t src_size)
62 src_size = std::min(src_size, dest_size);
63 const size_t zero_size = dest_size - src_size;
65 uint8_t *pos = (uint8_t *)dest;
67 std::memcpy(pos, src, src_size);
70 std::memset(pos, 0, zero_size);
74fillCopy(
void *dest,
size_t dest_size,
const std::string &src)
76 fillCopy(dest, dest_size, src.c_str(), src.length());
85 for (
unsigned i = 0;
i < size; ++
i)
117 static_assert(
sizeof(
signature) - 1 ==
sizeof(
data->signature),
118 "signature length mismatch");
125 data->rsdtAddress =
rsdt->write(phys_proxy, alloc);
129 data->xsdtAddress =
xsdt->write(phys_proxy, alloc);
149 assert(
mem.size() >=
sizeof(
Mem));
154 DPRINTF(
ACPI,
"Writing system description table [%llx - %llx]\n",
addr,
165 header->oemRevision =
p.oem_revision;
166 header->creatorID =
p.creator_id;
167 header->creatorRevision =
p.creator_revision;
194 auto base_size =
mem.size();
197 Ptr* ptr_array =
reinterpret_cast<Ptr*
>(
mem.data() + base_size);
200 for (
const auto *entry :
entries) {
201 Addr entry_addr = entry->write(phys_proxy, alloc);
203 "RXSDT: Entry address doesn't fit in pointer type.");
204 DPRINTF(
ACPI,
"RXSDT: wrote entry @ %llx\n", entry_addr);
205 *ptr_array++ = entry_addr;
241 for (
const auto& record :
records) {
242 auto entry = record->prepare();
243 mem.insert(
mem.end(), entry.begin(), entry.end());
246 DPRINTF(
ACPI,
"MADT: writing %d records (size: %d)\n",
255 assert(
mem.size() >=
sizeof(
Mem));
256 DPRINTF(
ACPI,
"MADT: writing record type %d (size: %d)\n",
271 data->acpiProcessorId =
params().acpi_processor_id;
301 data->globalSystemInterrupt =
params().sys_int;
314 data->acpiProcessorId =
params().acpi_processor_id;
This object is a proxy for a port or other object which implements the functional response protocol,...
void writeBlob(Addr addr, const void *p, uint64_t size) const
Same as tryWriteBlob, but insists on success.
void prepareBuf(std::vector< uint8_t > &mem) const override
void prepareBuf(std::vector< uint8_t > &mem) const override
void prepareBuf(std::vector< uint8_t > &mem) const override
void prepareBuf(std::vector< uint8_t > &mem) const override
std::vector< Record * > records
Addr writeBuf(PortProxy &phys_proxy, Allocator &alloc, std::vector< uint8_t > &mem) const override
void prepareBuf(std::vector< uint8_t > &mem) const override
virtual void prepareBuf(std::vector< uint8_t > &mem) const =0
static const char signature[]
Addr write(PortProxy &phys_proxy, Allocator &alloc) const
std::vector< SysDescTable * > entries
Addr writeBuf(PortProxy &phys_proxy, Allocator &alloc, std::vector< uint8_t > &mem) const override
RXSDT(const Params &p, const char *_signature, uint8_t _revision)
virtual Addr writeBuf(PortProxy &phys_proxy, Allocator &alloc, std::vector< uint8_t > &mem) const =0
SysDescTable(const Params &p, const char *_signature, uint8_t _revision)
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
const Params & params() const
SimObject(const Params &p)
static uint8_t apic_checksum(uint8_t *ptr, std::size_t size)
static void fillCopy(void *dest, size_t dest_size, const void *src, size_t src_size)
This is exposed globally, independent of the ISA.
Copyright (c) 2024 Arm Limited All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
PortProxy Object Declaration.
virtual Addr alloc(std::size_t size, unsigned align=1)=0
Addr alloc(std::size_t size, unsigned align) override