fixed: compare virtual address instead of physical in lookup_mapping()
This commit is contained in:
@@ -347,7 +347,7 @@ static struct mmu_mapping memory_map[] =
|
||||
{ CACHE_NOCACHE_PRECISE, SV_PROTECT, 0, ACCESS_READ | ACCESS_WRITE },
|
||||
},
|
||||
{
|
||||
/* the same, but different mapping */
|
||||
/* the same, but different virtual address */
|
||||
(uint32_t) 0x00f00000,
|
||||
(uint32_t) 0xfff00000,
|
||||
(uint32_t) 0x100000,
|
||||
@@ -358,7 +358,7 @@ static struct mmu_mapping memory_map[] =
|
||||
|
||||
static int num_mmu_maps = sizeof(memory_map) / sizeof(struct mmu_mapping);
|
||||
|
||||
static struct mmu_mapping *lookup_mapping(uint32_t address)
|
||||
static struct mmu_mapping *lookup_mapping(uint32_t virt)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -368,7 +368,7 @@ static struct mmu_mapping *lookup_mapping(uint32_t address)
|
||||
|
||||
for (i = 0; i < num_mmu_maps; i++)
|
||||
{
|
||||
if (address >= memory_map[i].phys && address <= memory_map[i].phys + memory_map[i].length - 1)
|
||||
if (virt >= memory_map[i].virt && virt <= memory_map[i].virt + memory_map[i].length - 1)
|
||||
return &memory_map[i];
|
||||
}
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user