Skip to content

Commit

Permalink
Log MMU
Browse files Browse the repository at this point in the history
  • Loading branch information
lupyuen committed Nov 11, 2023
1 parent ee55af0 commit ea6dc5d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions arch/risc-v/src/common/riscv_mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
****************************************************************************/

#include <assert.h>
#include <debug.h>

#include <nuttx/config.h>
#include <nuttx/arch.h>
Expand Down Expand Up @@ -62,6 +63,7 @@ static const size_t g_pgt_sizes[] =
void mmu_ln_setentry(uint32_t ptlevel, uintptr_t lnvaddr, uintptr_t paddr,
uintptr_t vaddr, uint32_t mmuflags)
{
_info("ptlevel=%d, lnvaddr=%p, paddr=%p, vaddr=%p, mmuflags=0x%x\n", ptlevel, lnvaddr, paddr, vaddr, mmuflags);////
uintptr_t *lntable = (uintptr_t *)lnvaddr;
uint32_t index;

Expand Down Expand Up @@ -138,6 +140,7 @@ void mmu_ln_restore(uint32_t ptlevel, uintptr_t lnvaddr, uintptr_t vaddr,
void mmu_ln_map_region(uint32_t ptlevel, uintptr_t lnvaddr, uintptr_t paddr,
uintptr_t vaddr, size_t size, uint32_t mmuflags)
{
_info("ptlevel=%d, lnvaddr=%p, paddr=%p, vaddr=%p, size=0x%x, mmuflags=0x%x\n", ptlevel, lnvaddr, paddr, vaddr, size, mmuflags);////
uintptr_t end_paddr = paddr + size;
size_t page_size = g_pgt_sizes[ptlevel - 1];

Expand Down
8 changes: 4 additions & 4 deletions arch/risc-v/src/jh7110/jh7110_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,16 +232,16 @@ static void jh7110_copy_ramdisk(void)
// Filesystem Size must be less than RAM Disk Memory Region
DEBUGASSERT(size <= (size_t)__ramdisk_size);

_info("Before Copy: ramdisk_addr=%p\n", ramdisk_addr);////
verify_image(ramdisk_addr);////
// _info("Before Copy: ramdisk_addr=%p\n", ramdisk_addr);////
// verify_image(ramdisk_addr);////

// Copy the Filesystem Size to RAM Disk Start
// Warning: __ramdisk_start overlaps with ramdisk_addr + size
// memmove is aliased to memcpy, so we implement memmove ourselves
local_memmove((void *)__ramdisk_start, ramdisk_addr, size);

_info("After Copy: __ramdisk_start=%p\n", __ramdisk_start);////
verify_image(__ramdisk_start);////
// _info("After Copy: __ramdisk_start=%p\n", __ramdisk_start);////
// verify_image(__ramdisk_start);////
}

// grep --binary-files=text -b -o A initrd >/tmp/a
Expand Down

0 comments on commit ea6dc5d

Please sign in to comment.