chore: fix
This commit is contained in:
@@ -14,7 +14,7 @@ struct device
|
|||||||
const char *arch;
|
const char *arch;
|
||||||
const char *name;
|
const char *name;
|
||||||
void *mapped_addr;
|
void *mapped_addr;
|
||||||
void *phys_addr;
|
uint32_t phys_addr;
|
||||||
uint32_t base_offset;
|
uint32_t base_offset;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ void gddr6_memory_map(void)
|
|||||||
{
|
{
|
||||||
for (uint32_t i = 0; i < ctx.num_devices; i++)
|
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].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);
|
ctx.devices[i].mapped_addr = mmap(0, PG_SZ, PROT_READ, MAP_SHARED, ctx.fd, ctx.devices[i].base_offset);
|
||||||
|
|||||||
Reference in New Issue
Block a user