mirror of
https://github.com/apache/nuttx.git
synced 2026-05-25 01:39:44 +08:00
arch/risc-v/src/mpfs/mpfs_userspace.c: Map MTIME into userspace reserved IO area in protected build
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
This commit is contained in:
committed by
Alan C. Assis
parent
d62e500940
commit
85f6f4bca2
@@ -23,6 +23,12 @@
|
||||
#ifndef __ARCH_RISCV_SRC_MPFS_HARDWARE_MPFS_CLINT_H
|
||||
#define __ARCH_RISCV_SRC_MPFS_HARDWARE_MPFS_CLINT_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include "mpfs_memorymap.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <nuttx/userspace.h>
|
||||
|
||||
#include <arch/board/board_memorymap.h>
|
||||
#include "hardware/mpfs_clint.h"
|
||||
|
||||
#include "mpfs_userspace.h"
|
||||
#include "riscv_internal.h"
|
||||
@@ -250,6 +251,11 @@ static void configure_mmu(void)
|
||||
map_region(UFLASH_START, UFLASH_START, UFLASH_SIZE, MMU_UTEXT_FLAGS);
|
||||
map_region(USRAM_START, USRAM_START, USRAM_SIZE, MMU_UDATA_FLAGS);
|
||||
|
||||
/* Map the MTIME counter to the start of USR IO region */
|
||||
|
||||
map_region(MPFS_CLINT_MTIME & (~RV_MMU_PAGE_MASK), USRIO_START,
|
||||
RV_MMU_PAGE_SIZE, PTE_R | PTE_U | PTE_G);
|
||||
|
||||
/* Connect the L1 and L2 page tables */
|
||||
|
||||
mmu_ln_setentry(1, PGT_L1_VBASE, PGT_L2_PBASE, UFLASH_START, PTE_G);
|
||||
|
||||
Reference in New Issue
Block a user