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
This commit is contained in:
patacongo
2013-03-10 23:42:49 +00:00
parent 34e3bb60ce
commit ec51159d18
4 changed files with 28 additions and 33 deletions
-4
View File
@@ -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
+2 -8
View File
@@ -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
*
+8 -12
View File
@@ -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 */
+18 -9
View File
@@ -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 */