diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-09-01 20:20:07 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-09-01 20:20:07 +0000 |
commit | 6a0c71965915af63afa7bafbcf9b26d37fd31ea7 (patch) | |
tree | 8c38c2bb2f4471efa93e1f93ad054c40f42ecc50 /nuttx/arch/arm/src/lpc313x | |
parent | 6814cba4709369f643ed97cad2c09793f84a9482 (diff) | |
download | px4-nuttx-6a0c71965915af63afa7bafbcf9b26d37fd31ea7.tar.gz px4-nuttx-6a0c71965915af63afa7bafbcf9b26d37fd31ea7.tar.bz2 px4-nuttx-6a0c71965915af63afa7bafbcf9b26d37fd31ea7.zip |
Fix virtual address of page table
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2907 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/lpc313x')
-rwxr-xr-x | nuttx/arch/arm/src/lpc313x/lpc313x_memorymap.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/nuttx/arch/arm/src/lpc313x/lpc313x_memorymap.h b/nuttx/arch/arm/src/lpc313x/lpc313x_memorymap.h index d7989870d..e4693a859 100755 --- a/nuttx/arch/arm/src/lpc313x/lpc313x_memorymap.h +++ b/nuttx/arch/arm/src/lpc313x/lpc313x_memorymap.h @@ -283,6 +283,22 @@ # error "CONFIG_ARCH_ROMPGTABLE defined; PGTABLE_BASE_P/VADDR not defined" # else + /* If CONFIG_PAGING is selected, then parts of the 1-to-1 virtual memory + * map probably do not apply because paging logic will probably partition + * the SRAM section differently. In particular, if the page table is located + * at the end of SRAM, then the virtual page table address defined below + * will probably be in error. + * + * We work around this header file interdependency by (1) insisting that + * pg_macros.h be included AFTER this header file, then (2) allowing the + * pg_macros.h header file to redefine PGTABLE_BASE_VADDR. + */ + +# if defined(CONFIG_PAGING) && defined(__ARCH_ARM_SRC_ARM_PG_MACROS_H) +# error "pg_macros.h must be included AFTER this header file" +# endif + + /* We must declare the page table in ISRAM0 or 1. We decide depending upon * where the vector table was place. */ @@ -301,6 +317,14 @@ # define PGTABLE_BASE_VADDR (LPC313X_INTSRAM0_VADDR+LPC313X_INTSRAM0_SIZE-PGTABLE_SIZE) # endif # define PGTABLE_IN_HIGHSRAM 1 + + /* If CONFIG_PAGING is defined, insisted that pg_macros.h assign the virtual + * address of the page table. + */ + +# ifdef CONFIG_PAGING +# undef PGTABLE_BASE_VADDR +# endif # else /* Otherwise, ISRAM1 (or ISRAM0 for the LPC3130) will be mapped so that |