chore: fix

This commit is contained in:
Ole Algoritme
2024-03-24 13:20:18 +01:00
parent 1ca8020db0
commit fb2fed6963
2 changed files with 2 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ struct device
const char *arch;
const char *name;
void *mapped_addr;
void *phys_addr;
uint32_t phys_addr;
uint32_t base_offset;
};

View File

@@ -102,7 +102,7 @@ void gddr6_memory_map(void)
{
for (uint32_t i = 0; i < ctx.num_devices; i++)
{
ctx.devices[i].phys_addr = (void *) (ctx.devices[i].bar0 + ctx.devices[i].offset);
ctx.devices[i].phys_addr = (ctx.devices[i].bar0 + ctx.devices[i].offset);
ctx.devices[i].base_offset = ctx.devices[i].phys_addr & ~(PG_SZ - 1);
ctx.devices[i].mapped_addr = mmap(0, PG_SZ, PROT_READ, MAP_SHARED, ctx.fd, ctx.devices[i].base_offset);