- Timestamp:
- 05/18/11 05:26:53 (13 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 7383b644
- Parents:
- 42ba091
- Location:
- c/src/lib/libbsp
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/ChangeLog
r42ba091 r4f599ed 1 2011-05-17 Till Straumann <strauman@slac.stanford.edu> 2 3 PR1797/bsps 4 * shared/bootcard.c, shared/include/bootcard.h: cleaned-up and 5 applied fixes proposed by PR#1797. 6 7 2011-05-12 Joel Sherrill <joel.sherrill@OARcorp.com> 8 9 PR1797/bsps 10 * bootcard.c: 11 Added #ifdef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK to minimize code 12 for small targets. 13 14 2011-05-12 Kate Feng <feng@bnl.gov> 15 16 PR1797/bsps 17 * bootcard.c: 18 Fixed the value of heap_start & heap_size for the single-heap case. 19 Added bsp_sbrk_init() to fix PPC memory allocation beyond 32 MB. 20 1 21 2010-04-14 Ralf Corsépius <ralf.corsepius@rtems.org> 2 22 -
c/src/lib/libbsp/powerpc/ChangeLog
r42ba091 r4f599ed 1 2011-05-17 Till Straumann <strauman@slac.stanford.edu> 2 3 PR1797/bsps 4 * shared/startup/sbrk.c: Cleanup; changed default 5 BSP_sbrk_policy to yield all memory to the heap. 6 App must specify a different policy if desired. 7 8 2011-05-13 Gedare Bloom <gedare@gwmail.gwu.edu> 9 10 PR1797/bsps 11 * shared/startup/sbrk.c : Renamed bsp_sbrk_init(). 12 13 2011-05-07 Kate Feng <feng@bnl.gov> 14 15 PR1797/bsps 16 * shared/startup/bspgetworkarea.c: Removed _bsp_sbrk_init(). 17 * shared/startup/pretaskinghook.c: Removed rtems/malloc.h. 18 1 19 2011-02-11 Ralf Corsépius <ralf.corsepius@rtems.org> 2 20 -
c/src/lib/libbsp/powerpc/beatnik/ChangeLog
r42ba091 r4f599ed 1 2011-05-17 Till Straumann <strauman@slac.stanford.edu> 2 3 PR1797/bsps 4 * configure.ac, include/bsp.h: Made 5 CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK a bspopts.h setting. 6 1 7 2011-05-16 Till Straumann <strauman@slac.stanford.edu> 2 8 -
c/src/lib/libbsp/powerpc/beatnik/configure.ac
r42ba091 r4f599ed 33 33 The BSP actually contains the call that enables this.]) 34 34 35 RTEMS_BSPOPTS_SET([CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK], [*], [1]) 36 RTEMS_BSPOPTS_HELP([CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK], 37 [If defined then the BSP may reduce the available memory size 38 initially. This can be useful for debugging (reduce the core 39 size) or dynamic loading (std gcc text offsets/jumps are < +/-32M). 40 Note that the policy can still be defined by the application 41 (see sbrk.c, BSP_sbrk_policy). By undefining 42 CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK this feature is removed 43 and a little memory is saved.]) 44 35 45 # Explicitly list all Makefiles here 36 46 AC_CONFIG_FILES([Makefile]) -
c/src/lib/libbsp/powerpc/beatnik/include/bsp.h
r42ba091 r4f599ed 64 64 #define BSP_INTERRUPT_STACK_SIZE (16 * 1024) 65 65 66 #define CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK67 68 66 /* 69 67 * base address definitions for several devices -
c/src/lib/libbsp/powerpc/ep1a/ChangeLog
r42ba091 r4f599ed 1 2011-05-17 Till Straumann <strauman@slac.stanford.edu> 2 3 PR1797/bsps 4 * configure.ac: Made CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK 5 a bspopts.h setting. 6 1 7 2011-03-04 Joel Sherrill <joel.sherrilL@OARcorp.com> 2 8 -
c/src/lib/libbsp/powerpc/ep1a/configure.ac
r42ba091 r4f599ed 34 34 [whether using console interrupts]) 35 35 36 RTEMS_BSPOPTS_SET([CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK], [*], [1]) 37 RTEMS_BSPOPTS_HELP([CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK], 38 [If defined then the BSP may reduce the available memory size 39 initially. This can be useful for debugging (reduce the core 40 size) or dynamic loading (std gcc text offsets/jumps are < +/-32M). 41 Note that the policy can still be defined by the application 42 (see sbrk.c, BSP_sbrk_policy). By undefining 43 CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK this feature is removed 44 and a little memory is saved.]) 45 36 46 RTEMS_CHECK_NETWORKING 37 47 AM_CONDITIONAL(HAS_NETWORKING,test "$HAS_NETWORKING" = "yes") -
c/src/lib/libbsp/powerpc/motorola_powerpc/ChangeLog
r42ba091 r4f599ed 1 2011-05-17 Till Straumann <strauman@slac.stanford.edu> 2 3 PR1797/bsps 4 * configure.ac, include/bsp.h: Made 5 CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK a bspopts.h setting. 6 1 7 2011-02-11 Ralf Corsépius <ralf.corsepius@rtems.org> 2 8 -
c/src/lib/libbsp/powerpc/motorola_powerpc/configure.ac
r42ba091 r4f599ed 32 32 The BSP actually contains the call that enables this.]) 33 33 34 RTEMS_BSPOPTS_SET([CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK], [*], [1]) 35 RTEMS_BSPOPTS_HELP([CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK], 36 [If defined then the BSP may reduce the available memory size 37 initially. This can be useful for debugging (reduce the core 38 size) or dynamic loading (std gcc text offsets/jumps are < +/-32M). 39 Note that the policy can still be defined by the application 40 (see sbrk.c, BSP_sbrk_policy). By undefining 41 CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK this feature is removed 42 and a little memory is saved.]) 43 34 44 RTEMS_BSPOPTS_SET([mvme2100],[mvme2100],[1]) 35 45 RTEMS_BSPOPTS_SET([mvme2100],[*],[]) -
c/src/lib/libbsp/powerpc/motorola_powerpc/include/bsp.h
r42ba091 r4f599ed 24 24 * confdefs.h overrides for this BSP: 25 25 */ 26 #define CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK27 26 28 27 /* -
c/src/lib/libbsp/powerpc/mvme3100/ChangeLog
r42ba091 r4f599ed 1 2011-05-17 Till Straumann <strauman@slac.stanford.edu> 2 3 PR1797/bsps 4 * configure.ac, include/bsp.h: Made 5 CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK a bspopts.h setting. 6 1 7 2011-02-11 Ralf Corsépius <ralf.corsepius@rtems.org> 2 8 -
c/src/lib/libbsp/powerpc/mvme3100/configure.ac
r42ba091 r4f599ed 36 36 The BSP actually contains the call that enables this.]) 37 37 38 RTEMS_BSPOPTS_SET([CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK], [*], [1]) 39 RTEMS_BSPOPTS_HELP([CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK], 40 [If defined then the BSP may reduce the available memory size 41 initially. This can be useful for debugging (reduce the core 42 size) or dynamic loading (std gcc text offsets/jumps are < +/-32M). 43 Note that the policy can still be defined by the application 44 (see sbrk.c, BSP_sbrk_policy). By undefining 45 CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK this feature is removed 46 and a little memory is saved.]) 47 38 48 RTEMS_BSP_CLEANUP_OPTIONS(0, 1) 39 49 -
c/src/lib/libbsp/powerpc/mvme3100/include/bsp.h
r42ba091 r4f599ed 26 26 * confdefs.h overrides for this BSP: 27 27 */ 28 #define CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK29 28 30 29 #define BSP_INTERRUPT_STACK_SIZE (16 * 1024) -
c/src/lib/libbsp/powerpc/mvme5500/ChangeLog
r42ba091 r4f599ed 1 2011-05-17 Till Straumann <strauman@slac.stanford.edu> 2 3 PR1797/bsps 4 * configure.ac, include/bsp.h: Made 5 CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK a bspopts.h setting. 6 1 7 2011-02-11 Ralf Corsépius <ralf.corsepius@rtems.org> 2 8 -
c/src/lib/libbsp/powerpc/mvme5500/configure.ac
r42ba091 r4f599ed 32 32 The BSP actually contains the call that enables this.]) 33 33 34 RTEMS_BSPOPTS_SET([CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK], [*], [1]) 35 RTEMS_BSPOPTS_HELP([CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK], 36 [If defined then the BSP may reduce the available memory size 37 initially. This can be useful for debugging (reduce the core 38 size) or dynamic loading (std gcc text offsets/jumps are < +/-32M). 39 Note that the policy can still be defined by the application 40 (see sbrk.c, BSP_sbrk_policy). By undefining 41 CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK this feature is removed 42 and a little memory is saved.]) 43 34 44 RTEMS_BSP_CLEANUP_OPTIONS(0, 0) 35 45 -
c/src/lib/libbsp/powerpc/mvme5500/include/bsp.h
r42ba091 r4f599ed 117 117 #define BSP_INTERRUPT_STACK_SIZE (16 * 1024) /* <skf> 2/09 wants it to be adjustable by BSP */ 118 118 119 #define CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK /* <skf> 4/09 see shared/startup/sbrk.c and rtems/confdefs.h */120 121 119 /* uart.c uses out_8 instead of outb */ 122 120 #define BSP_UART_IOBASE_COM1 GT64x60_DEV1_BASE + 0x20000 -
c/src/lib/libbsp/powerpc/psim/ChangeLog
r42ba091 r4f599ed 1 2011-05-17 Till Straumann <strauman@slac.stanford.edu> 2 3 PR1797/bsps 4 * configure.ac: Made CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK 5 a bspopts.h setting. 6 1 7 2011-02-11 Ralf Corsépius <ralf.corsepius@rtems.org> 2 8 -
c/src/lib/libbsp/powerpc/psim/configure.ac
r42ba091 r4f599ed 40 40 significantly reduce simulation times.]) 41 41 42 RTEMS_BSPOPTS_SET([CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK], [*], [1]) 43 RTEMS_BSPOPTS_HELP([CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK], 44 [If defined then the BSP may reduce the available memory size 45 initially. This can be useful for debugging (reduce the core 46 size) or dynamic loading (std gcc text offsets/jumps are < +/-32M). 47 Note that the policy can still be defined by the application 48 (see sbrk.c, BSP_sbrk_policy). By undefining 49 CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK this feature is removed 50 and a little memory is saved.]) 51 42 52 RTEMS_BSP_CLEANUP_OPTIONS(0, 0) 43 53 -
c/src/lib/libbsp/powerpc/score603e/ChangeLog
r42ba091 r4f599ed 1 2011-05-17 Till Straumann <strauman@slac.stanford.edu> 2 3 PR1797/bsps 4 * configure.ac: Made CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK 5 a bspopts.h setting. 6 1 7 2011-02-11 Ralf Corsépius <ralf.corsepius@rtems.org> 2 8 -
c/src/lib/libbsp/powerpc/score603e/configure.ac
r42ba091 r4f599ed 62 62 The BSP actually contains the call that enables this.]) 63 63 64 RTEMS_BSPOPTS_SET([CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK], [*], [1]) 65 RTEMS_BSPOPTS_HELP([CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK], 66 [If defined then the BSP may reduce the available memory size 67 initially. This can be useful for debugging (reduce the core 68 size) or dynamic loading (std gcc text offsets/jumps are < +/-32M). 69 Note that the policy can still be defined by the application 70 (see sbrk.c, BSP_sbrk_policy). By undefining 71 CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK this feature is removed 72 and a little memory is saved.]) 73 64 74 RTEMS_BSPOPTS_SET([PPC_VECTOR_FILE_BASE],[*],[0x0100]) 65 75 RTEMS_BSPOPTS_HELP([PPC_VECTOR_FILE_BASE], -
c/src/lib/libbsp/powerpc/shared/startup/bspgetworkarea.c
r42ba091 r4f599ed 17 17 18 18 extern void *__rtems_end; 19 extern uintptr_t _bsp_sbrk_init(uintptr_t, uintptr_t*);20 19 21 20 /* … … 32 31 { 33 32 uintptr_t work_size; 34 uintptr_t spared;35 33 uintptr_t work_area; 36 34 … … 38 36 rtems_configuration_get_interrupt_stack_size(); 39 37 work_size = (uintptr_t)BSP_mem_size - work_area; 40 41 spared = _bsp_sbrk_init( work_area, &work_size );42 38 43 39 *work_area_start = (void *)work_area, -
c/src/lib/libbsp/powerpc/shared/startup/pretaskinghook.c
r42ba091 r4f599ed 26 26 #include <rtems/bspIo.h> 27 27 #endif 28 29 #include <rtems/malloc.h>30 28 31 29 /* -
c/src/lib/libbsp/powerpc/shared/startup/sbrk.c
r42ba091 r4f599ed 71 71 #include <unistd.h> 72 72 73 static uint32_t remaining_start=0;74 static uint 32_tremaining_size=0;73 static void * remaining_start=(void*)-1LL; 74 static uintptr_t remaining_size=0; 75 75 76 76 /* App. may provide a value by defining the BSP_sbrk_policy … … 82 82 * 83 83 */ 84 extern uint 32_tBSP_sbrk_policy __attribute__((weak));84 extern uintptr_t BSP_sbrk_policy __attribute__((weak)); 85 85 86 #define LIMIT_32M 0x0200000086 #define LIMIT_32M ((void*)0x02000000) 87 87 88 uintptr_t _bsp_sbrk_init(89 uintptr_theap_start,88 uintptr_t bsp_sbrk_init( 89 void *heap_start, 90 90 uintptr_t *heap_size_p 91 91 ) 92 92 { 93 93 uintptr_t rval=0; 94 uintptr_t policy; 94 95 95 96 remaining_start = heap_start; … … 105 106 } 106 107 107 if ( 0 != &BSP_sbrk_policy ) { 108 switch ( BSP_sbrk_policy ) { 109 case (uint32_t)(-1): 110 *heap_size_p += rval; 111 remaining_start = heap_start + *heap_size_p; 112 remaining_size = 0; 113 /* return a nonzero sbrk_amount because the libsupport code 114 * at some point divides by this number prior to trying an 115 * sbrk() which will fail. 116 */ 117 rval = 1; 118 break; 108 policy = (0 == &BSP_sbrk_policy ? (uintptr_t)(-1) : BSP_sbrk_policy); 109 switch ( policy ) { 110 case (uintptr_t)(-1): 111 *heap_size_p += rval; 112 remaining_start = heap_start + *heap_size_p; 113 remaining_size = 0; 114 break; 119 115 120 116 case 0: 121 remaining_size = 0; 122 /* see above for why we return 1 */ 123 rval = 1; 124 break; 117 remaining_size = 0; 118 break; 125 119 126 120 default: 127 if ( rval > BSP_sbrk_policy )128 rval = BSP_sbrk_policy;129 121 if ( rval > policy ) 122 rval = policy; 123 break; 130 124 } 131 125 } … … 144 138 145 139 /* FIXME: BEWARE if size >2G */ 146 if ( incr <= remaining_size) {140 if ( remaining_start != (void*)-1LL && incr <= remaining_size) { 147 141 remaining_size-=incr; 148 rval = (void*)remaining_start;142 rval = remaining_start; 149 143 remaining_start += incr; 150 144 } else { -
c/src/lib/libbsp/shared/bootcard.c
r42ba091 r4f599ed 54 54 #include <bsp/bootcard.h> 55 55 #include <rtems/bspIo.h> 56 #include <rtems/malloc.h> 57 58 #ifdef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK 59 #include <unistd.h> /* for sbrk() */ 60 #endif 56 61 57 62 /* … … 75 80 uintptr_t work_area_size, 76 81 void *heap_start, 77 uintptr_t heap_size 82 uintptr_t heap_size, 83 uintptr_t sbrk_amount 78 84 ) 79 85 { 80 if ( !rtems_unified_work_area && 81 heap_start == BSP_BOOTCARD_HEAP_USES_WORK_AREA) { 82 uintptr_t work_space_size = rtems_configuration_get_work_space_size(); 83 84 heap_start = (char *) work_area_start + work_space_size; 85 86 if (heap_size == BSP_BOOTCARD_HEAP_SIZE_DEFAULT) { 87 uintptr_t heap_size_default = work_area_size - work_space_size; 88 89 heap_size = heap_size_default; 86 if ( heap_start == BSP_BOOTCARD_HEAP_USES_WORK_AREA ) { 87 if ( rtems_unified_work_area ) { 88 uintptr_t work_space_size = rtems_configuration_get_work_space_size(); 89 90 heap_start = (char *) work_area_start + work_space_size; 91 92 if (heap_size == BSP_BOOTCARD_HEAP_SIZE_DEFAULT) { 93 uintptr_t heap_size_default = work_area_size - work_space_size; 94 95 heap_size = heap_size_default; 96 } 97 } else { 98 heap_start = work_area_start; 99 if (heap_size == BSP_BOOTCARD_HEAP_SIZE_DEFAULT) { 100 heap_size = work_area_size; 101 } 90 102 } 91 103 } 92 104 93 bsp_libc_init(heap_start, heap_size, 0);105 bsp_libc_init(heap_start, heap_size, sbrk_amount); 94 106 } 95 107 … … 109 121 void *heap_start = NULL; 110 122 uintptr_t heap_size = 0; 123 uintptr_t sbrk_amount = 0; 111 124 112 125 /* … … 136 149 bsp_get_work_area(&work_area_start, &work_area_size, 137 150 &heap_start, &heap_size); 151 152 #ifdef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK 153 /* This routine may reduce the work area size with the 154 * option to extend it later via sbrk(). If the application 155 * was configured w/o CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK then 156 * omit this step. 157 */ 158 if ( rtems_malloc_sbrk_helpers ) { 159 sbrk_amount = bsp_sbrk_init(work_area_start, &work_area_size); 160 if ( work_area_size < Configuration.work_space_size && sbrk_amount > 0 ) { 161 /* Need to use sbrk right now */ 162 uintptr_t sbrk_now; 163 164 sbrk_now = (Configuration.work_space_size - work_area_size) / sbrk_amount; 165 sbrk( sbrk_now * sbrk_amount ); 166 } 167 } 168 #else 169 if ( rtems_malloc_sbrk_helpers ) { 170 printk("Configuration error!\n" 171 "Application was configured with CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK\n" 172 "but BSP was configured w/o sbrk support\n"); 173 bsp_cleanup(); 174 return -1; 175 } 176 #endif 138 177 139 178 if ( work_area_size <= Configuration.work_space_size ) { … … 171 210 work_area_size, 172 211 heap_start, 173 heap_size 212 heap_size, 213 sbrk_amount 174 214 ); 175 215 -
c/src/lib/libbsp/shared/include/bootcard.h
r42ba091 r4f599ed 90 90 91 91 /** 92 * @brief Gives the BSP a chance to reduce the work area size with sbrk() adding more later. 93 * 94 * bsp_sbrk_init() may reduce the work area size passed in. The routine 95 * returns the 'sbrk_amount' to be used when extending the heap. 96 * Note that the return value may be zero. 97 * 98 */ 99 100 #ifdef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK 101 uintptr_t bsp_sbrk_init( 102 void *work_area_begin, 103 uintptr_t *work_area_size_p 104 ); 105 #endif 106 107 108 /** 92 109 * @brief Standard system initialization procedure. 93 110 *
Note: See TracChangeset
for help on using the changeset viewer.