diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-03-10 23:42:49 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-03-10 23:42:49 +0000 |
commit | 6157a0e4fd667b835dc74d291019dd61840213cd (patch) | |
tree | 029c000a13501c7904b1c5afa38ac99928540dac /nuttx/arch/arm/src/sam3u | |
parent | f6fffbd5b0a83bd161e8f6417a4d034f72268217 (diff) | |
download | px4-nuttx-6157a0e4fd667b835dc74d291019dd61840213cd.tar.gz px4-nuttx-6157a0e4fd667b835dc74d291019dd61840213cd.tar.bz2 px4-nuttx-6157a0e4fd667b835dc74d291019dd61840213cd.zip |
Remove user_map.h; replace with a header at the beginning of the user-space blob. User work queue no started by os_brinup() on behalf of the application
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5727 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/sam3u')
-rw-r--r-- | nuttx/arch/arm/src/sam3u/sam3u_allocateheap.c | 4 | ||||
-rw-r--r-- | nuttx/arch/arm/src/sam3u/sam3u_internal.h | 10 | ||||
-rw-r--r-- | nuttx/arch/arm/src/sam3u/sam3u_mpuinit.c | 20 | ||||
-rw-r--r-- | nuttx/arch/arm/src/sam3u/sam3u_userspace.c | 27 |
4 files changed, 28 insertions, 33 deletions
diff --git a/nuttx/arch/arm/src/sam3u/sam3u_allocateheap.c b/nuttx/arch/arm/src/sam3u/sam3u_allocateheap.c index 9ae97dfb4..5b5c6b810 100644 --- a/nuttx/arch/arm/src/sam3u/sam3u_allocateheap.c +++ b/nuttx/arch/arm/src/sam3u/sam3u_allocateheap.c @@ -223,10 +223,6 @@ void up_allocate_kheap(FAR void **heap_start, size_t *heap_size) *heap_start = (FAR void*)kbase; *heap_size = KHEAP_SIZE; - - /* Prohibit user access to the kernel heap memory */ - - sam3u_mpu_kheap((uintptr_t)kbase, KHEAP_SIZE); } #endif diff --git a/nuttx/arch/arm/src/sam3u/sam3u_internal.h b/nuttx/arch/arm/src/sam3u/sam3u_internal.h index b0cf83cb0..14857bcf8 100644 --- a/nuttx/arch/arm/src/sam3u/sam3u_internal.h +++ b/nuttx/arch/arm/src/sam3u/sam3u_internal.h @@ -477,10 +477,10 @@ void sam3u_mpuinitialize(void); #endif /**************************************************************************** - * Name: sam3u_mpu_uheap and sam3u_mpu_uheap + * Name: sam3u_mpu_uheap * * Description: - * Map a user- or kernel-heap region. + * Map the user heap region. * ****************************************************************************/ @@ -490,12 +490,6 @@ void sam3u_mpu_uheap(uintptr_t start, size_t size); # define sam3u_mpu_uheap(start,size) #endif -#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP) -void sam3u_mpu_kheap(uintptr_t start, size_t size); -#else -# define sam3u_mpu_kheap(start,size) -#endif - /************************************************************************************ * Name: sam3u_gpioirqinitialize * diff --git a/nuttx/arch/arm/src/sam3u/sam3u_mpuinit.c b/nuttx/arch/arm/src/sam3u/sam3u_mpuinit.c index b2d3850ea..1e1a564d5 100644 --- a/nuttx/arch/arm/src/sam3u/sam3u_mpuinit.c +++ b/nuttx/arch/arm/src/sam3u/sam3u_mpuinit.c @@ -41,7 +41,7 @@ #include <assert.h> -#include <arch/board/user_map.h> +#include <nuttx/userspace.h> #include "mpu.h" @@ -82,10 +82,11 @@ void sam3u_mpuinitialize(void) { - uintptr_t datastart = MIN(CONFIG_USER_DATADESTSTART, CONFIG_USER_BSSSTART); - uintptr_t dataend = MAX(CONFIG_USER_DATADESTEND, CONFIG_USER_BSSEND); + uintptr_t datastart = MIN(USERSPACE->us_datastart, USERSPACE->us_bssstart); + uintptr_t dataend = MAX(USERSPACE->us_dataend, USERSPACE->us_bssend); - DEBUGASSERT(CONFIG_USER_TEXTEND >= CONFIG_USER_TEXTSTART && dataend >= datastart); + DEBUGASSERT(USERSPACE->us_textend >= USERSPACE->us_textstart && + dataend >= datastart); /* Show MPU information */ @@ -93,7 +94,9 @@ void sam3u_mpuinitialize(void) /* Configure user flash and SRAM space */ - mpu_userflash(CONFIG_USER_TEXTSTART, CONFIG_USER_TEXTEND - CONFIG_USER_TEXTSTART); + mpu_userflash(USERSPACE->us_textstart, + USERSPACE->us_textend - USERSPACE->us_textstart); + mpu_userintsram(datastart, dataend - datastart); /* Then enable the MPU */ @@ -116,12 +119,5 @@ void sam3u_mpu_uheap(uintptr_t start, size_t size) mpu_userintsram(start, size); } -#ifdef CONFIG_MM_KERNEL_HEAP -void sam3u_mpu_kheap(uintptr_t start, size_t size) -{ - mpu_privintsram(start, size); -} -#endif - #endif /* CONFIG_NUTTX_KERNEL */ diff --git a/nuttx/arch/arm/src/sam3u/sam3u_userspace.c b/nuttx/arch/arm/src/sam3u/sam3u_userspace.c index 28f45afce..89a2a27ed 100644 --- a/nuttx/arch/arm/src/sam3u/sam3u_userspace.c +++ b/nuttx/arch/arm/src/sam3u/sam3u_userspace.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/common/sam3u_userspace.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -42,7 +42,9 @@ #include <stdint.h> #include <assert.h> -#include <arch/board/user_map.h> +#include <nuttx/userspace.h> + +#include "sam3u_internal.h" #ifdef CONFIG_NUTTX_KERNEL @@ -81,10 +83,11 @@ void sam3u_userspace(void) /* Clear all of user-space .bss */ - DEBUGASSERT((uintptr_t)CONFIG_USER_DATADESTSTART <= CONFIG_USER_DATADESTEND); + DEBUGASSERT(USERSPACE->us_bssstart != 0 && USERSPACE->us_bssend != 0 && + USERSPACE->us_bssstart <= USERSPACE->us_bssend); - dest = (uint8_t*)CONFIG_USER_BSSSTART; - end = (uint8_t*)CONFIG_USER_BSSEND; + dest = (uint8_t*)USERSPACE->us_bssstart; + end = (uint8_t*)USERSPACE->us_bssend; while (dest != end) { @@ -93,16 +96,22 @@ void sam3u_userspace(void) /* Initialize all of user-space .data */ - DEBUGASSERT((uintptr_t)CONFIG_USER_DATADESTSTART <= CONFIG_USER_DATADESTEND); + DEBUGASSERT(USERSPACE->us_datasource != 0 && + USERSPACE->us_datastart != 0 && USERSPACE->us_dataend != 0 && + USERSPACE->us_datastart <= USERSPACE->us_dataend); - src = (uint8_t*)CONFIG_USER_DATASOURCE; - dest = (uint8_t*)CONFIG_USER_DATADESTSTART; - end = (uint8_t*)CONFIG_USER_DATADESTEND; + src = (uint8_t*)USERSPACE->us_datasource; + dest = (uint8_t*)USERSPACE->us_datastart; + end = (uint8_t*)USERSPACE->us_dataend; while (dest != end) { *dest++ = *src++; } + + /* Configure the MPU to permit user-space access to its FLASH and RAM */ + + sam3u_mpuinitialize(); } #endif /* CONFIG_NUTTX_KERNEL */ |