summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-09-06 20:48:39 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-09-06 20:48:39 +0000
commit2939906ef52709a869fc46b289d0c0bffe9e8aba (patch)
tree4bf1bde6e98458f5e9a926a4282db8a39fafd256
parent74c1e661abf325a99cc8185492214a7bde852fd5 (diff)
downloadnuttx-2939906ef52709a869fc46b289d0c0bffe9e8aba.tar.gz
nuttx-2939906ef52709a869fc46b289d0c0bffe9e8aba.tar.bz2
nuttx-2939906ef52709a869fc46b289d0c0bffe9e8aba.zip
Fix heap layout issue
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2925 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/arch/arm/src/arm/pg_macros.h11
-rwxr-xr-xnuttx/arch/arm/src/lpc313x/lpc313x_allocateheap.c19
-rwxr-xr-xnuttx/configs/ea3131/src/up_fillpage.c2
3 files changed, 25 insertions, 7 deletions
diff --git a/nuttx/arch/arm/src/arm/pg_macros.h b/nuttx/arch/arm/src/arm/pg_macros.h
index 499093781..fc50f6146 100644
--- a/nuttx/arch/arm/src/arm/pg_macros.h
+++ b/nuttx/arch/arm/src/arm/pg_macros.h
@@ -281,9 +281,14 @@
/* This is the total number of pages used in the text/data mapping: */
-#define PG_TOTAL_NPPAGES (PG_TEXT_NPPAGES + PG_DATA_PAGES + PG_PGTABLE_NPAGES)
-#define PG_TOTAL_NVPAGES (PG_TEXT_NVPAGES + PG_DATA_PAGES + PG_PGTABLE_NPAGES)
-#if PG_TOTAL_NPPAGES >PG_RAM_PAGES
+#define PG_TOTAL_NPPAGES (PG_TEXT_NPPAGES + PG_DATA_NPAGES + PG_PGTABLE_NPAGES)
+#define PG_TOTAL_NVPAGES (PG_TEXT_NVPAGES + PG_DATA_NPAGES + PG_PGTABLE_NPAGES)
+#define PG_TOTAL_PSIZE (PG_TOTAL_NPPAGES << PAGESHIFT)
+#define PG_TOTAL_VSIZE (PG_TOTAL_NVPAGES << PAGESHIFT)
+
+/* Sanity check: */
+
+#if PG_TOTAL_NPPAGES > PG_RAM_PAGES
# error "Total pages required exceeds RAM size"
#endif
diff --git a/nuttx/arch/arm/src/lpc313x/lpc313x_allocateheap.c b/nuttx/arch/arm/src/lpc313x/lpc313x_allocateheap.c
index e6b587fd3..79ba8464e 100755
--- a/nuttx/arch/arm/src/lpc313x/lpc313x_allocateheap.c
+++ b/nuttx/arch/arm/src/lpc313x/lpc313x_allocateheap.c
@@ -51,6 +51,11 @@
#include "up_internal.h"
#include "lpc313x_memorymap.h"
+#ifdef CONFIG_PAGING
+# include <nuttx/page.h>
+# include "pg_macros.h"
+#endif
+
/************************************************************************
* Pre-processor Definitions
************************************************************************/
@@ -121,10 +126,18 @@
* will let the heap run all the way to the end of SRAM.
*/
-#ifdef PGTABLE_IN_HIGHSRAM
-# define LPC313X_HEAP_VEND (LPC313X_INTSRAM_VSECTION + LPC313X_ISRAM_SIZE - PGTABLE_SIZE)
+#ifdef CONFIG_PAGING
+# ifdef PGTABLE_IN_HIGHSRAM
+# define LPC313X_HEAP_VEND (PG_LOCKED_VBASE + PG_TOTAL_VSIZE - PGTABLE_SIZE)
+# else
+# define LPC313X_HEAP_VEND (PG_LOCKED_VBASE + PG_TOTAL_VSIZE)
+# endif
#else
-# define LPC313X_HEAP_VEND (LPC313X_INTSRAM_VSECTION + LPC313X_ISRAM_SIZE)
+# ifdef PGTABLE_IN_HIGHSRAM
+# define LPC313X_HEAP_VEND (LPC313X_INTSRAM_VSECTION + LPC313X_ISRAM_SIZE - PGTABLE_SIZE)
+# else
+# define LPC313X_HEAP_VEND (LPC313X_INTSRAM_VSECTION + LPC313X_ISRAM_SIZE)
+# endif
#endif
/************************************************************************
diff --git a/nuttx/configs/ea3131/src/up_fillpage.c b/nuttx/configs/ea3131/src/up_fillpage.c
index 04f2e8157..8f11dd48a 100755
--- a/nuttx/configs/ea3131/src/up_fillpage.c
+++ b/nuttx/configs/ea3131/src/up_fillpage.c
@@ -119,7 +119,7 @@
#ifdef CONFIG_PAGING_BLOCKINGFILL
int up_fillpage(FAR _TCB *tcb, FAR void *vpage)
{
- pglldbg("TCB: %p vpage: %d far: %08x\n", tcb, vpage, tcb->xcp.far);
+ pglldbg("TCB: %p vpage: %p far: %08x\n", tcb, vpage, tcb->xcp.far);
# warning "Not implemented"
return -ENOSYS;
}