mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 13:27:01 +08:00
Add capability to manager memory in discontiguous regions.
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@35 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -78,6 +78,10 @@ defconfig -- This is a configuration file similar to the Linux
|
|||||||
CONFIG_DEBUG_VERBOSE - enables verbose debug output
|
CONFIG_DEBUG_VERBOSE - enables verbose debug output
|
||||||
CONFIG_HAVE_LOWPUTC - architecture supports low-level, boot
|
CONFIG_HAVE_LOWPUTC - architecture supports low-level, boot
|
||||||
time console output
|
time console output
|
||||||
|
CONFIG_MM_REGIONS - If the architecture includes multiple
|
||||||
|
regions of memory to allocate from, this specifies the
|
||||||
|
number of memory regions that the memory manager must
|
||||||
|
handle and enables the API mm_addregion(start, end);
|
||||||
CONFIG_RR_INTERVAL - The round robin timeslice will be set
|
CONFIG_RR_INTERVAL - The round robin timeslice will be set
|
||||||
this number of milliseconds; Round robin scheduling can
|
this number of milliseconds; Round robin scheduling can
|
||||||
be disabled by setting this value to zero.
|
be disabled by setting this value to zero.
|
||||||
|
|||||||
@@ -81,6 +81,10 @@ CONFIG_UART_MODEM_2STOP=0
|
|||||||
# that will be used in the build
|
# that will be used in the build
|
||||||
# CONFIG_DEBUG - enables built-in debug options
|
# CONFIG_DEBUG - enables built-in debug options
|
||||||
# CONFIG_DEBUG_VERBOSE - enables verbose debug output
|
# CONFIG_DEBUG_VERBOSE - enables verbose debug output
|
||||||
|
# CONFIG_MM_REGIONS - If the architecture includes multiple
|
||||||
|
# regions of memory to allocate from, this specifies the
|
||||||
|
# number of memory regions that the memory manager must
|
||||||
|
# handle and enables the API mm_addregion(start, end);
|
||||||
# CONFIG_HAVE_LOWPUTC - architecture supports low-level, boot
|
# CONFIG_HAVE_LOWPUTC - architecture supports low-level, boot
|
||||||
# time console output
|
# time console output
|
||||||
# CONFIG_RR_INTERVAL - The round robin timeslice will be set
|
# CONFIG_RR_INTERVAL - The round robin timeslice will be set
|
||||||
@@ -100,6 +104,7 @@ CONFIG_UART_MODEM_2STOP=0
|
|||||||
CONFIG_EXAMPLE=ostest
|
CONFIG_EXAMPLE=ostest
|
||||||
CONFIG_DEBUG=y
|
CONFIG_DEBUG=y
|
||||||
CONFIG_DEBUG_VERBOSE=n
|
CONFIG_DEBUG_VERBOSE=n
|
||||||
|
CONFIG_MM_REGIONS=1
|
||||||
CONFIG_ARCH_LOWPUTC=y
|
CONFIG_ARCH_LOWPUTC=y
|
||||||
CONFIG_RR_INTERVAL=200
|
CONFIG_RR_INTERVAL=200
|
||||||
CONFIG_SCHED_INSTRUMENTATION=n
|
CONFIG_SCHED_INSTRUMENTATION=n
|
||||||
|
|||||||
@@ -48,6 +48,10 @@ CONFIG_ARCH_8051=y
|
|||||||
# that will be used in the build
|
# that will be used in the build
|
||||||
# CONFIG_DEBUG - enables built-in debug options
|
# CONFIG_DEBUG - enables built-in debug options
|
||||||
# CONFIG_DEBUG_VERBOSE - enables verbose debug output
|
# CONFIG_DEBUG_VERBOSE - enables verbose debug output
|
||||||
|
# CONFIG_MM_REGIONS - If the architecture includes multiple
|
||||||
|
# regions of memory to allocate from, this specifies the
|
||||||
|
# number of memory regions that the memory manager must
|
||||||
|
# handle and enables the API mm_addregion(start, end);
|
||||||
# CONFIG_HAVE_LOWPUTC - architecture supports low-level, boot
|
# CONFIG_HAVE_LOWPUTC - architecture supports low-level, boot
|
||||||
# time console output
|
# time console output
|
||||||
# CONFIG_RR_INTERVAL - The round robin timeslice will be set
|
# CONFIG_RR_INTERVAL - The round robin timeslice will be set
|
||||||
@@ -67,8 +71,9 @@ CONFIG_ARCH_8051=y
|
|||||||
CONFIG_EXAMPLE=ostest
|
CONFIG_EXAMPLE=ostest
|
||||||
CONFIG_DEBUG=n
|
CONFIG_DEBUG=n
|
||||||
CONFIG_DEBUG_VERBOSE=n
|
CONFIG_DEBUG_VERBOSE=n
|
||||||
|
CONFIG_MM_REGIONS=2
|
||||||
CONFIG_ARCH_LOWPUTC=y
|
CONFIG_ARCH_LOWPUTC=y
|
||||||
CONFIG_RR_INTERVAL=200
|
CONFIG_RR_INTERVAL=0
|
||||||
CONFIG_SCHED_INSTRUMENTATION=n
|
CONFIG_SCHED_INSTRUMENTATION=n
|
||||||
CONFIG_TASK_NAME_SIZE=0
|
CONFIG_TASK_NAME_SIZE=0
|
||||||
CONFIG_START_YEAR=2007
|
CONFIG_START_YEAR=2007
|
||||||
|
|||||||
@@ -78,3 +78,10 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
|
|||||||
*heap_start = (FAR void*)UP_HEAP1_BASE;
|
*heap_start = (FAR void*)UP_HEAP1_BASE;
|
||||||
*heap_size = UP_HEAP1_END - UP_HEAP1_BASE;
|
*heap_size = UP_HEAP1_END - UP_HEAP1_BASE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if CONFIG_MM_REGIONS > 1
|
||||||
|
void up_addregion(void)
|
||||||
|
{
|
||||||
|
mm_addregion((FAR void*)UP_HEAP2_BASE, UP_HEAP2_END - UP_HEAP2_BASE);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -75,6 +75,6 @@ void up_assert(void)
|
|||||||
|
|
||||||
void up_assert_code(int errorcode)
|
void up_assert_code(int errorcode)
|
||||||
{
|
{
|
||||||
dbg("Assertion failed with error code: %d\n", errcode);
|
dbg("Assertion failed with error code: %d\n", errorcode);
|
||||||
exit(errorcode);
|
exit(errorcode);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,6 +93,12 @@ void up_initialize(void)
|
|||||||
|
|
||||||
g_irqtos = 0;
|
g_irqtos = 0;
|
||||||
|
|
||||||
|
/* Add extra memory fragments to the memory manager */
|
||||||
|
|
||||||
|
#if CONFIG_MM_REGIONS > 1
|
||||||
|
up_addregion();
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Initialize the interrupt subsystem */
|
/* Initialize the interrupt subsystem */
|
||||||
|
|
||||||
up_irqinitialize();
|
up_irqinitialize();
|
||||||
|
|||||||
@@ -102,7 +102,9 @@
|
|||||||
* when the following simple addtions do the job).
|
* when the following simple addtions do the job).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef __ASSEMBLY__
|
||||||
sfr at 0xc9 T2MOD ;
|
sfr at 0xc9 T2MOD ;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Timing information.
|
/* Timing information.
|
||||||
*
|
*
|
||||||
@@ -175,9 +177,12 @@ extern ubyte g_irqtos;
|
|||||||
|
|
||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
|
#if CONFIG_MM_REGIONS > 1
|
||||||
|
extern void up_addregion(void);
|
||||||
|
#endif
|
||||||
extern void up_irqinitialize(void);
|
extern void up_irqinitialize(void);
|
||||||
extern void up_restorecontext(FAR struct xcptcontext *context);
|
extern void up_restorecontext(FAR struct xcptcontext *context);
|
||||||
extern void up_restorestack(FAR struct xcptcontext *context);
|
extern void up_restorestack(FAR struct xcptcontext *context);
|
||||||
extern ubyte up_savecontext(FAR struct xcptcontext *context);
|
extern ubyte up_savecontext(FAR struct xcptcontext *context);
|
||||||
extern void up_savestack(FAR struct xcptcontext *context);
|
extern void up_savestack(FAR struct xcptcontext *context);
|
||||||
extern void up_timerinit(void);
|
extern void up_timerinit(void);
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
static void _up_putc(int ch) __naked
|
static void _up_putc(int ch) __naked
|
||||||
{
|
{
|
||||||
#if 0
|
#if 1
|
||||||
ch; /* To avoid unreferenced argument warning */
|
ch; /* To avoid unreferenced argument warning */
|
||||||
_asm
|
_asm
|
||||||
mov a, dpl
|
mov a, dpl
|
||||||
@@ -73,6 +73,10 @@ cout: jnb ti, cout
|
|||||||
int up_putc(int ch)
|
int up_putc(int ch)
|
||||||
{
|
{
|
||||||
_up_putc(ch);
|
_up_putc(ch);
|
||||||
|
if (ch == '\n')
|
||||||
|
{
|
||||||
|
_up_putc('\r');
|
||||||
|
}
|
||||||
return ch;
|
return ch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,10 @@ CONFIG_ARCH_SIM=y
|
|||||||
# that will be used in the build
|
# that will be used in the build
|
||||||
# CONFIG_DEBUG - enables built-in debug options
|
# CONFIG_DEBUG - enables built-in debug options
|
||||||
# CONFIG_DEBUG_VERBOSE - enables verbose debug output
|
# CONFIG_DEBUG_VERBOSE - enables verbose debug output
|
||||||
|
# CONFIG_MM_REGIONS - If the architecture includes multiple
|
||||||
|
# regions of memory to allocate from, this specifies the
|
||||||
|
# number of memory regions that the memory manager must
|
||||||
|
# handle and enables the API mm_addregion(start, end);
|
||||||
# CONFIG_HAVE_LOWPUTC - architecture supports low-level, boot
|
# CONFIG_HAVE_LOWPUTC - architecture supports low-level, boot
|
||||||
# time console output
|
# time console output
|
||||||
# CONFIG_RR_INTERVAL - The round robin timeslice will be set
|
# CONFIG_RR_INTERVAL - The round robin timeslice will be set
|
||||||
@@ -67,6 +71,7 @@ CONFIG_ARCH_SIM=y
|
|||||||
CONFIG_EXAMPLE=ostest
|
CONFIG_EXAMPLE=ostest
|
||||||
CONFIG_DEBUG=y
|
CONFIG_DEBUG=y
|
||||||
CONFIG_DEBUG_VERBOSE=y
|
CONFIG_DEBUG_VERBOSE=y
|
||||||
|
CONFIG_MM_REGIONS=1
|
||||||
CONFIG_ARCH_LOWPUTC=y
|
CONFIG_ARCH_LOWPUTC=y
|
||||||
CONFIG_RR_INTERVAL=200
|
CONFIG_RR_INTERVAL=200
|
||||||
CONFIG_SCHED_INSTRUMENTATION=n
|
CONFIG_SCHED_INSTRUMENTATION=n
|
||||||
|
|||||||
Reference in New Issue
Block a user