diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-08-31 04:05:28 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-08-31 04:05:28 +0000 |
commit | c29904c8d42b2ca273cbb1d7e6990453ce14d2e9 (patch) | |
tree | 47eaa85752b91e38138bdf58a30d243bd492a035 | |
parent | ad3e797c6fe0a8a3841aff26818ff312774118d3 (diff) | |
download | px4-nuttx-c29904c8d42b2ca273cbb1d7e6990453ce14d2e9.tar.gz px4-nuttx-c29904c8d42b2ca273cbb1d7e6990453ce14d2e9.tar.bz2 px4-nuttx-c29904c8d42b2ca273cbb1d7e6990453ce14d2e9.zip |
Fix page table size calculation
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2901 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r-- | nuttx/arch/arm/src/dm320/dm320_memorymap.h | 10 | ||||
-rwxr-xr-x | nuttx/arch/arm/src/lpc313x/lpc313x_memorymap.h | 14 |
2 files changed, 18 insertions, 6 deletions
diff --git a/nuttx/arch/arm/src/dm320/dm320_memorymap.h b/nuttx/arch/arm/src/dm320/dm320_memorymap.h index f9ee22b03..8b8e9c447 100644 --- a/nuttx/arch/arm/src/dm320/dm320_memorymap.h +++ b/nuttx/arch/arm/src/dm320/dm320_memorymap.h @@ -207,11 +207,15 @@ #define PGTABLE_L2_FINE_VBASE (PGTABLE_BASE_VADDR+0x00001000) #define PGTABLE_L2_END_VADDR (PGTABLE_BASE_VADDR+PGTABLE_SIZE) -#define PGTABLE_L2_ALLOC (PGTABLE_L2_END_VADDR-PGTABLE_L2_BASE_VADDR) +/* Page table sizes */ + +#define PGTABLE_L2_COARSE_ALLOC (PGTABLE_L2_END_VADDR-PGTABLE_L2_COARSE_VBASE) #define PGTABLE_COARSE_TABLE_SIZE (4*256) -#define PGTABLE_NCOARSE_TABLES (PGTABLE_L2_ALLOC / PGTABLE_COARSE_TABLE_SIZE) +#define PGTABLE_NCOARSE_TABLES (PGTABLE_L2_COARSE_ALLOC / PGTABLE_COARSE_TABLE_SIZE) + +#define PGTABLE_L2_FINE_ALLOC (PGTABLE_L2_END_VADDR-PGTABLE_L2_FINE_VBASE) #define PGTABLE_FINE_TABLE_SIZE (4*1024) -#define PGTABLE_NFINE_TABLES (PGTABLE_L2_ALLOC / PGTABLE_FINE_TABLE_SIZE) +#define PGTABLE_NFINE_TABLES (PGTABLE_L2_FINE_ALLOC / PGTABLE_FINE_TABLE_SIZE) /* This is the base address of the interrupt vectors on the ARM926 */ diff --git a/nuttx/arch/arm/src/lpc313x/lpc313x_memorymap.h b/nuttx/arch/arm/src/lpc313x/lpc313x_memorymap.h index 06773ff0a..d7989870d 100755 --- a/nuttx/arch/arm/src/lpc313x/lpc313x_memorymap.h +++ b/nuttx/arch/arm/src/lpc313x/lpc313x_memorymap.h @@ -319,6 +319,8 @@ /* 16Kb of memory is reserved hold the page table for the virtual mappings. A * portion of this table is not accessible in the virtual address space (for * normal operation). We will reuse this memory for coarse page tables as follows: + * + * Page table start addresses: */ #define PGTABLE_L2_COARSE_OFFSET ((((LPC313X_LAST_PSECTION >> 20) + 255) & ~255) << 2) @@ -329,14 +331,20 @@ #define PGTABLE_L2_FINE_PBASE (PGTABLE_BASE_PADDR+PGTABLE_L2_FINE_OFFSET) #define PGTABLE_L2_FINE_VBASE (PGTABLE_BASE_VADDR+PGTABLE_L2_FINE_OFFSET) +/* Page table end addresses: */ + #define PGTABLE_L2_END_PADDR (PGTABLE_BASE_PADDR+PGTABLE_SIZE) #define PGTABLE_L2_END_VADDR (PGTABLE_BASE_VADDR+PGTABLE_SIZE) -#define PGTABLE_L2_ALLOC (PGTABLE_L2_END_VADDR-PGTABLE_L2_BASE_VADDR) +/* Page table sizes */ + +#define PGTABLE_L2_COARSE_ALLOC (PGTABLE_L2_END_VADDR-PGTABLE_L2_COARSE_VBASE) #define PGTABLE_COARSE_TABLE_SIZE (4*256) -#define PGTABLE_NCOARSE_TABLES (PGTABLE_L2_ALLOC / PGTABLE_COARSE_TABLE_SIZE) +#define PGTABLE_NCOARSE_TABLES (PGTABLE_L2_COARSE_ALLOC / PGTABLE_COARSE_TABLE_SIZE) + +#define PGTABLE_L2_FINE_ALLOC (PGTABLE_L2_END_VADDR-PGTABLE_L2_FINE_VBASE) #define PGTABLE_FINE_TABLE_SIZE (4*1024) -#define PGTABLE_NFINE_TABLES (PGTABLE_L2_ALLOC / PGTABLE_FINE_TABLE_SIZE) +#define PGTABLE_NFINE_TABLES (PGTABLE_L2_FINE_ALLOC / PGTABLE_FINE_TABLE_SIZE) /* Determine the base address of the vector table: * |