Fix Gossamer system register.

This commit is contained in:
Maxim Poliakovski 2023-01-11 23:49:20 +01:00
parent 8d01440558
commit 136aeca8f2
2 changed files with 2 additions and 2 deletions

View File

@ -82,7 +82,7 @@ public:
~GossamerID() = default;
uint32_t read(uint32_t rgn_start, uint32_t offset, int size) {
return ((!offset && size == 2) ? this->id : 0);
return ((offset == 4 && size == 2) ? this->id : 0);
};
/* not writable */

View File

@ -109,7 +109,7 @@ int initialize_gossamer(std::string& id)
gMachineObj->add_device("MachineID", std::unique_ptr<GossamerID>(new GossamerID(sys_reg)));
grackle_obj->add_mmio_region(
0xFF000000 + 4, 4096 - 4, dynamic_cast<MMIODevice*>(gMachineObj->get_comp_by_name("MachineID")));
0xFF000000, 4096, dynamic_cast<MMIODevice*>(gMachineObj->get_comp_by_name("MachineID")));
// allocate ROM region
if (!grackle_obj->add_rom_region(0xFFC00000, 0x400000)) {