diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-03-04 15:23:22 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-03-04 15:23:22 +0000 |
commit | 3b23ee2703a28a1b46bbd3eb4835b05ae321de29 (patch) | |
tree | 08c2619903b1002ca7f846dbcf5258e4f7f1a964 /nuttx/arch | |
parent | 6f275ae53307d29e22fde024a6479f80e60baf41 (diff) | |
download | nuttx-3b23ee2703a28a1b46bbd3eb4835b05ae321de29.tar.gz nuttx-3b23ee2703a28a1b46bbd3eb4835b05ae321de29.tar.bz2 nuttx-3b23ee2703a28a1b46bbd3eb4835b05ae321de29.zip |
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
Diffstat (limited to 'nuttx/arch')
-rw-r--r-- | nuttx/arch/README.txt | 4 | ||||
-rw-r--r-- | nuttx/arch/c5471/defconfig | 5 | ||||
-rw-r--r-- | nuttx/arch/pjrc-8051/defconfig | 7 | ||||
-rw-r--r-- | nuttx/arch/pjrc-8051/src/up_allocateheap.c | 7 | ||||
-rw-r--r-- | nuttx/arch/pjrc-8051/src/up_assert.c | 2 | ||||
-rw-r--r-- | nuttx/arch/pjrc-8051/src/up_initialize.c | 6 | ||||
-rw-r--r-- | nuttx/arch/pjrc-8051/src/up_internal.h | 7 | ||||
-rw-r--r-- | nuttx/arch/pjrc-8051/src/up_putc.c | 6 | ||||
-rw-r--r-- | nuttx/arch/sim/defconfig | 5 |
9 files changed, 45 insertions, 4 deletions
diff --git a/nuttx/arch/README.txt b/nuttx/arch/README.txt index c01215963..64a77e924 100644 --- a/nuttx/arch/README.txt +++ b/nuttx/arch/README.txt @@ -78,6 +78,10 @@ defconfig -- This is a configuration file similar to the Linux CONFIG_DEBUG_VERBOSE - enables verbose debug output CONFIG_HAVE_LOWPUTC - architecture supports low-level, boot 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 this number of milliseconds; Round robin scheduling can be disabled by setting this value to zero. diff --git a/nuttx/arch/c5471/defconfig b/nuttx/arch/c5471/defconfig index 90ae4c898..1ce7dd879 100644 --- a/nuttx/arch/c5471/defconfig +++ b/nuttx/arch/c5471/defconfig @@ -81,6 +81,10 @@ CONFIG_UART_MODEM_2STOP=0 # that will be used in the build # CONFIG_DEBUG - enables built-in debug options # 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 # time console output # CONFIG_RR_INTERVAL - The round robin timeslice will be set @@ -100,6 +104,7 @@ CONFIG_UART_MODEM_2STOP=0 CONFIG_EXAMPLE=ostest CONFIG_DEBUG=y CONFIG_DEBUG_VERBOSE=n +CONFIG_MM_REGIONS=1 CONFIG_ARCH_LOWPUTC=y CONFIG_RR_INTERVAL=200 CONFIG_SCHED_INSTRUMENTATION=n diff --git a/nuttx/arch/pjrc-8051/defconfig b/nuttx/arch/pjrc-8051/defconfig index d40be28da..508440c27 100644 --- a/nuttx/arch/pjrc-8051/defconfig +++ b/nuttx/arch/pjrc-8051/defconfig @@ -48,6 +48,10 @@ CONFIG_ARCH_8051=y # that will be used in the build # CONFIG_DEBUG - enables built-in debug options # 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 # time console output # CONFIG_RR_INTERVAL - The round robin timeslice will be set @@ -67,8 +71,9 @@ CONFIG_ARCH_8051=y CONFIG_EXAMPLE=ostest CONFIG_DEBUG=n CONFIG_DEBUG_VERBOSE=n +CONFIG_MM_REGIONS=2 CONFIG_ARCH_LOWPUTC=y -CONFIG_RR_INTERVAL=200 +CONFIG_RR_INTERVAL=0 CONFIG_SCHED_INSTRUMENTATION=n CONFIG_TASK_NAME_SIZE=0 CONFIG_START_YEAR=2007 diff --git a/nuttx/arch/pjrc-8051/src/up_allocateheap.c b/nuttx/arch/pjrc-8051/src/up_allocateheap.c index 6f164f0d3..b6e6a0208 100644 --- a/nuttx/arch/pjrc-8051/src/up_allocateheap.c +++ b/nuttx/arch/pjrc-8051/src/up_allocateheap.c @@ -78,3 +78,10 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size) *heap_start = (FAR void*)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
\ No newline at end of file diff --git a/nuttx/arch/pjrc-8051/src/up_assert.c b/nuttx/arch/pjrc-8051/src/up_assert.c index b9ac5db43..0234e9ecd 100644 --- a/nuttx/arch/pjrc-8051/src/up_assert.c +++ b/nuttx/arch/pjrc-8051/src/up_assert.c @@ -75,6 +75,6 @@ void up_assert(void) 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); } diff --git a/nuttx/arch/pjrc-8051/src/up_initialize.c b/nuttx/arch/pjrc-8051/src/up_initialize.c index ae297d585..5388882da 100644 --- a/nuttx/arch/pjrc-8051/src/up_initialize.c +++ b/nuttx/arch/pjrc-8051/src/up_initialize.c @@ -93,6 +93,12 @@ void up_initialize(void) g_irqtos = 0; + /* Add extra memory fragments to the memory manager */ + +#if CONFIG_MM_REGIONS > 1 + up_addregion(); +#endif + /* Initialize the interrupt subsystem */ up_irqinitialize(); diff --git a/nuttx/arch/pjrc-8051/src/up_internal.h b/nuttx/arch/pjrc-8051/src/up_internal.h index 54320a288..25fa06243 100644 --- a/nuttx/arch/pjrc-8051/src/up_internal.h +++ b/nuttx/arch/pjrc-8051/src/up_internal.h @@ -102,7 +102,9 @@ * when the following simple addtions do the job). */ +#ifndef __ASSEMBLY__ sfr at 0xc9 T2MOD ; +#endif /* Timing information. * @@ -175,9 +177,12 @@ extern ubyte g_irqtos; #ifndef __ASSEMBLY__ +#if CONFIG_MM_REGIONS > 1 +extern void up_addregion(void); +#endif extern void up_irqinitialize(void); 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 void up_savestack(FAR struct xcptcontext *context); extern void up_timerinit(void); diff --git a/nuttx/arch/pjrc-8051/src/up_putc.c b/nuttx/arch/pjrc-8051/src/up_putc.c index d2e486829..95f25aa3b 100644 --- a/nuttx/arch/pjrc-8051/src/up_putc.c +++ b/nuttx/arch/pjrc-8051/src/up_putc.c @@ -48,7 +48,7 @@ static void _up_putc(int ch) __naked { -#if 0 +#if 1 ch; /* To avoid unreferenced argument warning */ _asm mov a, dpl @@ -73,6 +73,10 @@ cout: jnb ti, cout int up_putc(int ch) { _up_putc(ch); + if (ch == '\n') + { + _up_putc('\r'); + } return ch; } diff --git a/nuttx/arch/sim/defconfig b/nuttx/arch/sim/defconfig index 9a3cb893c..9d8aab7aa 100644 --- a/nuttx/arch/sim/defconfig +++ b/nuttx/arch/sim/defconfig @@ -48,6 +48,10 @@ CONFIG_ARCH_SIM=y # that will be used in the build # CONFIG_DEBUG - enables built-in debug options # 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 # time console output # CONFIG_RR_INTERVAL - The round robin timeslice will be set @@ -67,6 +71,7 @@ CONFIG_ARCH_SIM=y CONFIG_EXAMPLE=ostest CONFIG_DEBUG=y CONFIG_DEBUG_VERBOSE=y +CONFIG_MM_REGIONS=1 CONFIG_ARCH_LOWPUTC=y CONFIG_RR_INTERVAL=200 CONFIG_SCHED_INSTRUMENTATION=n |