From 6aa5aa20e1d5c813dbb3e65d032fcb4a5880139b Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 2 Sep 2010 17:43:52 +0000 Subject: [PATCH] Missed definition for 4Kb page case git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2910 42af7a65-404d-4744-a932-0658087f49c3 --- arch/arm/src/arm/pg_macros.h | 1 + arch/arm/src/arm/up_allocpage.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/arch/arm/src/arm/pg_macros.h b/arch/arm/src/arm/pg_macros.h index d30adeb106f..efc3a4faa6d 100644 --- a/arch/arm/src/arm/pg_macros.h +++ b/arch/arm/src/arm/pg_macros.h @@ -121,6 +121,7 @@ # define MMU_L2_TEXTFLAGS (PTE_TYPE_SMALL|PTE_SMALL_AP_UNO_SRO|PTE_CACHEABLE) # define MMU_L1_DATAFLAGS (PMD_TYPE_COARSE|PMD_BIT4) # define MMU_L2_DATAFLAGS (PTE_TYPE_SMALL|PTE_SMALL_AP_UNO_SRW|PTE_CACHEABLE|PTE_BUFFERABLE) +# define MMU_L2_ALLOCFLAGS (PTE_TYPE_SMALL|PTE_SMALL_AP_UNO_SRW) # define MMU_L1_PGTABFLAGS (PMD_TYPE_COARSE|PMD_BIT4) # define MMU_L2_PGTABFLAGS (PTE_TYPE_SMALL|PTE_SMALL_AP_UNO_SRW) diff --git a/arch/arm/src/arm/up_allocpage.c b/arch/arm/src/arm/up_allocpage.c index 1db32592c68..c2a31d09c0a 100755 --- a/arch/arm/src/arm/up_allocpage.c +++ b/arch/arm/src/arm/up_allocpage.c @@ -209,6 +209,12 @@ int up_allocpage(FAR _TCB *tcb, FAR void **vpage) /* Invalidate the instruction TLB corresponding to the virtual address */ tlb_inst_invalidate_single(oldvaddr); + + /* I do not believe that it is necessary to flush the I-Cache in this + * case: The I-Cache uses a virtual address index and, hence, since the + * NuttX address space is flat, the cached instruction value should be + * correct even if the page mapping is no longer in place. + */ } /* Then convert the index to a (physical) page address. */