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/pjrc-8051/src | |
parent | 6f275ae53307d29e22fde024a6479f80e60baf41 (diff) | |
download | px4-nuttx-3b23ee2703a28a1b46bbd3eb4835b05ae321de29.tar.gz px4-nuttx-3b23ee2703a28a1b46bbd3eb4835b05ae321de29.tar.bz2 px4-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/pjrc-8051/src')
-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 |
5 files changed, 25 insertions, 3 deletions
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; } |