[vmm] move most users of arch_mmu_query directly to vaddr_to_paddr()

This commit is contained in:
Travis Geiselbrecht
2016-02-14 12:45:53 -08:00
parent d569c090ea
commit a4ca0a6e00
14 changed files with 25 additions and 27 deletions

View File

@@ -110,7 +110,7 @@ static int do_boot(lkb_t *lkb, size_t len, const char **result)
*result = "not enough memory";
return -1;
}
arch_mmu_query((vaddr_t)buf, &buf_phys, NULL);
buf_phys = vaddr_to_paddr(buf);
LTRACEF("iobuffer %p (phys 0x%lx)\n", buf, buf_phys);
if (lkb_read(lkb, buf, len)) {
@@ -367,7 +367,7 @@ int lkb_handle_command(lkb_t *lkb, const char *cmd, const char *arg, size_t len,
}
/* translate to physical address */
paddr_t pa = kvaddr_to_paddr(buf);
paddr_t pa = vaddr_to_paddr(buf);
if (pa == 0) {
*result = "error allocating buffer";
free(buf);

View File

@@ -33,7 +33,7 @@
#include <lib/cbuf.h>
#include <app/lkboot.h>
#include <arch/arm/dcc.h>
#include <arch/mmu.h>
#include <kernel/vm.h>
#include <kernel/mutex.h>
#include "pdcc.h"
@@ -239,20 +239,20 @@ void lkboot_dcc_init(void)
buffer_desc.version = PDCC_VERSION;
err = arch_mmu_query((vaddr_t)htod_buffer, &pa, NULL);
DEBUG_ASSERT(err == NO_ERROR);
pa = vaddr_to_paddr(htod_buffer);
DEBUG_ASSERT(pa);
buffer_desc.htod_buffer_phys = pa;
buffer_desc.htod_buffer_len = DCC_BUFLEN;
err = arch_mmu_query((vaddr_t)dtoh_buffer, &pa, NULL);
DEBUG_ASSERT(err == NO_ERROR);
pa = vaddr_to_paddr(dtoh_buffer);
DEBUG_ASSERT(pa);
buffer_desc.dtoh_buffer_phys = pa;
buffer_desc.dtoh_buffer_len = DCC_BUFLEN;
err = arch_mmu_query((vaddr_t)&buffer_desc, &buffer_desc_phys, NULL);
DEBUG_ASSERT(err == NO_ERROR);
buffer_desc_phys = vaddr_to_paddr(&buffer_desc);
DEBUG_ASSERT(buffer_desc_phys);
arch_clean_cache_range((vaddr_t)&buffer_desc, sizeof(buffer_desc));
}

View File

@@ -201,7 +201,7 @@ usage:
}
paddr_t pa;
arch_mmu_query((vaddr_t)ptr, &pa, 0);
pa = vaddr_to_paddr(ptr);
printf("physical address 0x%lx\n", pa);
#else
/* allocate from the heap */

View File

@@ -136,7 +136,7 @@ static void zynq_common_target_init(uint level)
/* we have a fpga image */
/* lookup the physical address of the bitfile */
paddr_t pa = kvaddr_to_paddr((void *)fpga_ptr);
paddr_t pa = vaddr_to_paddr((void *)fpga_ptr);
if (pa != 0) {
/* program the fpga with it*/
printf("loading fpga image at %p (phys 0x%lx), len %zx\n", fpga_ptr, pa, fpga_len);