diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-09-23 07:11:47 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-09-23 07:11:47 -0600 |
commit | 0f3f2d5095043776fc32c2f802bbbf2ed3865533 (patch) | |
tree | 599ec7c7ad4de4cbba8ba9d034f065204395191e /nuttx/include/nuttx/addrenv.h | |
parent | 28d43328a09aa47e58def877d6102bdf8b8bbb87 (diff) | |
download | nuttx-0f3f2d5095043776fc32c2f802bbbf2ed3865533.tar.gz nuttx-0f3f2d5095043776fc32c2f802bbbf2ed3865533.tar.bz2 nuttx-0f3f2d5095043776fc32c2f802bbbf2ed3865533.zip |
Add README files and configuration support for the shared memory logic
Diffstat (limited to 'nuttx/include/nuttx/addrenv.h')
-rw-r--r-- | nuttx/include/nuttx/addrenv.h | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/nuttx/include/nuttx/addrenv.h b/nuttx/include/nuttx/addrenv.h index 77c7463a6..586afbf7d 100644 --- a/nuttx/include/nuttx/addrenv.h +++ b/nuttx/include/nuttx/addrenv.h @@ -168,11 +168,42 @@ /* A single page scratch region used for temporary mappings */ -# define ARCH_SCRATCH_VBASE ARCH_STACK_VEND +# define __ARCH_SHM_VBASE ARCH_STACK_VEND #else /* A single page scratch region used for temporary mappings */ -# define ARCH_SCRATCH_VBASE ARCH_HEAP_VEND +# define __ARCH_SHM_VBASE ARCH_HEAP_VEND +#endif + +/* Shared memory regions */ + +#ifdef CONFIG_MM_SHM +# ifndef CONFIG_ARCH_SHM_VBASE +# error CONFIG_ARCH_SHM_VBASE not defined +# define CONFIG_ARCH_SHM_VBASE __ARCH_SHM_VBASE +# endif + +# if (CONFIG_ARCH_SHM_VBASE & CONFIG_MM_MASK) != 0 +# error CONFIG_ARCH_SHM_VBASE not aligned to page boundary +# endif + +# ifndef CONFIG_ARCH_SHM_MAXREGIONS +# warning CONFIG_ARCH_SHM_MAXREGIONS not defined +# define CONFIG_ARCH_SHM_MAXREGIONS 1 +# endif + +# ifndef CONFIG_ARCH_SHM_NPAGES +# warning CONFIG_ARCH_SHM_NPAGES not defined +# define CONFIG_ARCH_SHM_NPAGES 1 +# endif + +# define ARCH_SHM_REGIONSIZE (CONFIG_ARCH_SHM_NPAGES * CONFIG_MM_PGSIZE) +# define ARCH_SHM_SIZE (CONFIG_ARCH_SHM_MAXREGIONS * ARCH_SHM_REGIONSIZE) +# define ARCH_SHM_VEND (CONFIG_ARCH_SHM_VBASE + ARCH_SHM_SIZE) + +# define ARCH_SCRATCH_VBASE ARCH_SHM_VEND +#else +# define ARCH_SCRATCH_VBASE __ARCH_SHM_VBASE #endif /* There is no need to use the scratch memory region if the page pool memory |