Changeset eea21eac in rtems
- Timestamp:
- Dec 13, 2019, 5:18:36 AM (14 months ago)
- Branches:
- 5, master
- Children:
- f7c5f94
- Parents:
- 07e2eac
- git-author:
- Sebastian Huber <sebastian.huber@…> (12/13/19 05:18:36)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (02/04/20 05:06:41)
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
bsps/arm/altera-cyclone-v/start/bspgetworkarea.c
r07e2eac reea21eac 6 6 7 7 /* 8 * Copyright (c) 2017 embedded brains GmbH8 * Copyright (c) 2017, 2019 embedded brains GmbH 9 9 * 10 10 * The license and distribution terms for this file may be … … 14 14 15 15 #include <bsp/bootcard.h> 16 #include <bsp/arm-cp15-start.h>17 16 #include <bsp/fdt.h> 18 17 #include <bsp/linker-symbols.h> 19 18 19 #ifdef BSP_FDT_IS_SUPPORTED 20 21 #include <bsp/arm-cp15-start.h> 22 20 23 #include <libcpu/arm-cp15.h> 21 24 22 25 #include <libfdt.h> 23 26 24 #i fdef BSP_FDT_IS_SUPPORTED27 #include <rtems/sysinit.h> 25 28 26 29 #define AREA_COUNT_MAX 16 … … 30 33 static const char reserved_memory_path[] = "/reserved-memory"; 31 34 32 static void adjust_memory_size(const void *fdt, Heap_Area *area)35 static void adjust_memory_size(const void *fdt, Memory_Area *area) 33 36 { 34 37 int node; … … 71 74 < (uintptr_t) bsp_section_work_end 72 75 ) { 73 area->size += size - (uintptr_t) bsp_section_work_end;74 } 75 } 76 } 77 78 static Heap_Area *find_area(79 Heap_Area *areas,76 _Memory_Set_end(area, (void *) (begin + size)); 77 } 78 } 79 } 80 81 static Memory_Area *find_area( 82 Memory_Area *areas, 80 83 size_t area_count, 81 84 uint32_t begin … … 88 91 uintptr_t e; 89 92 90 b = (uintptr_t) areas[i].begin;91 e = b + (uintptr_t) areas[i].size;93 b = (uintptr_t) _Memory_Get_begin(&areas[i]); 94 e = (uintptr_t) _Memory_Get_end(&areas[i]); 92 95 93 96 if (b <= begin && begin < e) { … … 101 104 static size_t remove_reserved_memory( 102 105 const void *fdt, 103 Heap_Area *areas,106 Memory_Area *areas, 104 107 size_t area_count 105 108 ) … … 119 122 int len; 120 123 const void *val; 121 uintptr_t area_begin;122 124 uintptr_t area_end; 123 125 uintptr_t hole_begin; 124 126 uintptr_t hole_end; 125 Heap_Area *area;127 Memory_Area *area; 126 128 127 129 val = fdt_getprop(fdt, node, "reg", &len); … … 134 136 135 137 area = find_area(areas, area_count, hole_begin); 136 area_begin = (uintptr_t) area->begin; 137 area_end = area_begin + (uintptr_t) area->size; 138 area->size = hole_begin - area_begin; 138 area_end = (uintptr_t) _Memory_Get_end(area); 139 _Memory_Set_end(area, (void *) hole_end); 139 140 140 141 if (hole_end <= area_end) { … … 145 146 area = &areas[area_count]; 146 147 ++area_count; 147 area->begin = (void *) hole_end; 148 area->size = area_end - hole_end; 148 _Memory_Initialize(area, (void *) hole_end, (void *) area_end); 149 149 } 150 150 … … 156 156 } 157 157 158 #else /* !BSP_FDT_IS_SUPPORTED */ 159 160 #define AREA_COUNT_MAX 1 161 162 #endif /* BSP_FDT_IS_SUPPORTED */ 163 164 void bsp_work_area_initialize(void) 165 { 166 Heap_Area areas[AREA_COUNT_MAX]; 158 static Memory_Area _Memory_Areas[AREA_COUNT_MAX]; 159 160 static void bsp_memory_initialize(void) 161 { 167 162 size_t area_count; 168 #ifdef BSP_FDT_IS_SUPPORTED169 163 const void *fdt; 170 164 size_t i; 171 #endif 172 173 areas[0].begin = bsp_section_work_begin; 174 areas[0].size = (uintptr_t) bsp_section_work_size; 165 166 _Memory_Initialize( 167 &_Memory_Areas[0], 168 bsp_section_work_begin, 169 bsp_section_work_end 170 ); 171 175 172 area_count = 1; 176 177 #ifdef BSP_FDT_IS_SUPPORTED178 173 fdt = bsp_fdt_get(); 179 180 adjust_memory_size(fdt, &areas[0]); 181 area_count = remove_reserved_memory(fdt, areas, area_count); 174 adjust_memory_size(fdt, &_Memory_Areas[0]); 175 area_count = remove_reserved_memory(fdt, &_Memory_Areas[0], area_count); 182 176 183 177 for (i = 0; i < area_count; ++i) { 184 178 arm_cp15_set_translation_table_entries( 185 areas[i].begin,186 (void *) ((uintptr_t) areas[i].begin + areas[i].size),179 _Memory_Get_begin(&_Memory_Areas[i]), 180 _Memory_Get_end(&_Memory_Areas[i]), 187 181 ARMV7_MMU_READ_WRITE_CACHED 188 182 ); 189 183 } 190 #endif 191 192 bsp_work_area_initialize_with_table(areas, area_count); 193 } 184 } 185 186 RTEMS_SYSINIT_ITEM( 187 bsp_memory_initialize, 188 RTEMS_SYSINIT_MEMORY, 189 RTEMS_SYSINIT_ORDER_MIDDLE 190 ); 191 192 #else /* !BSP_FDT_IS_SUPPORTED */ 193 194 static Memory_Area _Memory_Areas[] = { 195 MEMORY_INITIALIZER(bsp_section_work_begin, bsp_section_work_end) 196 }; 197 198 #endif /* BSP_FDT_IS_SUPPORTED */ 199 200 static const Memory_Information _Memory_Information = 201 MEMORY_INFORMATION_INITIALIZER( _Memory_Areas ); 202 203 const Memory_Information *_Memory_Get( void ) 204 { 205 return &_Memory_Information; 206 } -
bsps/arm/imx/start/bspstarthooks.c
r07e2eac reea21eac 22 22 #include <bsp/arm-cp15-start.h> 23 23 #include <bsp/arm-a9mpcore-start.h> 24 25 #include <rtems/sysinit.h> 24 26 25 27 #include <libfdt.h> … … 107 109 } 108 110 109 void bsp_work_area_initialize(void) 111 static Memory_Area _Memory_Areas[1]; 112 113 static void bsp_memory_initialize(void) 110 114 { 111 uintptr_t begin; 112 uintptr_t end; 115 _Memory_Initialize( 116 &_Memory_Areas[0], 117 imx_mmu_config_table[ARMV7_CP15_START_WORKSPACE_ENTRY_INDEX].begin, 118 imx_mmu_config_table[ARMV7_CP15_START_WORKSPACE_ENTRY_INDEX].end 119 ); 120 } 113 121 114 begin = imx_mmu_config_table[ARMV7_CP15_START_WORKSPACE_ENTRY_INDEX].begin; 115 end = imx_mmu_config_table[ARMV7_CP15_START_WORKSPACE_ENTRY_INDEX].end; 122 RTEMS_SYSINIT_ITEM( 123 bsp_memory_initialize, 124 RTEMS_SYSINIT_MEMORY, 125 RTEMS_SYSINIT_ORDER_MIDDLE 126 ); 116 127 117 bsp_work_area_initialize_default((void *) begin, end - begin); 128 static const Memory_Information _Memory_Information = 129 MEMORY_INFORMATION_INITIALIZER(_Memory_Areas); 130 131 const Memory_Information *_Memory_Get(void) 132 { 133 return &_Memory_Information; 118 134 } -
bsps/arm/raspberrypi/start/bspstarthooks.c
r07e2eac reea21eac 32 32 #include <bsp/arm-cp15-start.h> 33 33 34 #include <rtems/sysinit.h> 35 34 36 #ifdef RTEMS_SMP 35 37 #include <rtems/score/smp.h> … … 177 179 } 178 180 179 void bsp_work_area_initialize(void) 180 { 181 uintptr_t begin; 182 uintptr_t end; 183 184 begin = raspberrypi_mmu_config_table[ARMV7_CP15_START_WORKSPACE_ENTRY_INDEX] 185 .begin; 186 end = raspberrypi_mmu_config_table[ARMV7_CP15_START_WORKSPACE_ENTRY_INDEX] 187 .end; 188 189 bsp_work_area_initialize_default((void *) begin, end - begin); 190 } 181 static Memory_Area _Memory_Areas[1]; 182 183 static void bsp_memory_initialize(void) 184 { 185 _Memory_Initialize( 186 &_Memory_Areas[0], 187 raspberrypi_mmu_config_table[ARMV7_CP15_START_WORKSPACE_ENTRY_INDEX].begin, 188 raspberrypi_mmu_config_table[ARMV7_CP15_START_WORKSPACE_ENTRY_INDEX].end 189 ); 190 } 191 192 RTEMS_SYSINIT_ITEM( 193 bsp_memory_initialize, 194 RTEMS_SYSINIT_MEMORY, 195 RTEMS_SYSINIT_ORDER_MIDDLE 196 ); 197 198 static const Memory_Information _Memory_Information = 199 MEMORY_INFORMATION_INITIALIZER(_Memory_Areas); 200 201 const Memory_Information *_Memory_Get(void) 202 { 203 return &_Memory_Information; 204 } -
bsps/i386/pc386/start/bspgetworkarea.c
r07e2eac reea21eac 1 1 /* 2 * This routine is an implementation of the bsp_work_area_initialize()3 * that can be used by all m68k BSPs following linkcmds conventions4 * regarding heap, stack, and workspace allocation.5 *6 2 * COPYRIGHT (c) 1989-2008. 7 3 * On-Line Applications Research Corporation (OAR). … … 15 11 #include <bsp.h> 16 12 #include <bsp/bootcard.h> 13 14 #include <rtems/sysinit.h> 17 15 18 16 #ifdef BSP_GET_WORK_AREA_DEBUG … … 117 115 } 118 116 119 void bsp_work_area_initialize(void) 117 static Memory_Area _Memory_Areas[ 1 ]; 118 119 static void bsp_memory_initialize( void ) 120 120 { 121 void *area_start;122 uintptr_t area_size;123 124 121 /* 125 122 * We need to determine how much memory there is in the system. … … 127 124 bsp_size_memory(); 128 125 129 area_start = (void *) rtemsWorkAreaStart; 130 area_size = (uintptr_t) bsp_mem_size - (uintptr_t) rtemsWorkAreaStart; 131 bsp_work_area_initialize_default( area_start, area_size ); 126 _Memory_Initialize_by_size( 127 &_Memory_Areas[0], 128 (void *) rtemsWorkAreaStart, 129 (uintptr_t) bsp_mem_size - (uintptr_t) rtemsWorkAreaStart 130 ); 132 131 } 132 133 RTEMS_SYSINIT_ITEM( 134 bsp_memory_initialize, 135 RTEMS_SYSINIT_MEMORY, 136 RTEMS_SYSINIT_ORDER_MIDDLE 137 ); 138 139 static const Memory_Information _Memory_Information = 140 MEMORY_INFORMATION_INITIALIZER( _Memory_Areas ); 141 142 const Memory_Information *_Memory_Get( void ) 143 { 144 return &_Memory_Information; 145 } -
bsps/include/bsp/bootcard.h
r07e2eac reea21eac 22 22 #define LIBBSP_SHARED_BOOTCARD_H 23 23 24 #include <string.h>25 26 24 #include <rtems/config.h> 27 25 #include <rtems/bspIo.h> 28 26 #include <rtems/malloc.h> 27 #include <rtems/score/memory.h> 29 28 #include <rtems/score/wkspace.h> 30 29 … … 72 71 void boot_card(const char *cmdline) RTEMS_NO_RETURN; 73 72 74 #ifdef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK75 /**76 * @brief Gives the BSP a chance to reduce the work area size with sbrk()77 * adding more later.78 *79 * bsp_sbrk_init() may reduce the work area size passed in. The routine80 * returns the 'sbrk_amount' to be used when extending the heap. Note that81 * the return value may be zero.82 *83 * In case the @a area size is altered, then the remaining size of the84 * @a area must be greater than or equal to @a min_size.85 */86 ptrdiff_t bsp_sbrk_init(Heap_Area *area, uintptr_t min_size);87 #endif88 89 static inline void bsp_work_area_initialize_default(90 void *area_begin,91 uintptr_t area_size92 )93 {94 Heap_Area area = {95 .begin = area_begin,96 .size = area_size97 };98 99 #if BSP_DIRTY_MEMORY == 1100 memset(area.begin, 0xCF, area.size);101 #endif102 103 #ifdef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK104 {105 uintptr_t overhead = _Heap_Area_overhead(CPU_HEAP_ALIGNMENT);106 uintptr_t work_space_size = rtems_configuration_get_work_space_size();107 ptrdiff_t sbrk_amount = bsp_sbrk_init(108 &area,109 work_space_size110 + overhead111 + (rtems_configuration_get_unified_work_area() ? 0 : overhead)112 );113 114 rtems_heap_set_sbrk_amount(sbrk_amount);115 }116 #endif117 118 _Workspace_Handler_initialization(&area, 1, NULL);119 RTEMS_Malloc_Initialize(&area, 1, NULL);120 }121 122 static inline void bsp_work_area_initialize_with_table(123 Heap_Area *areas,124 size_t area_count125 )126 {127 _Workspace_Handler_initialization(areas, area_count, _Heap_Extend);128 RTEMS_Malloc_Initialize(areas, area_count, _Heap_Extend);129 }130 131 void bsp_work_area_initialize(void);132 133 73 struct Per_CPU_Control; 134 74 -
bsps/powerpc/mpc55xxevb/start/bspgetworkarea.c
r07e2eac reea21eac 24 24 25 25 LINKER_SYMBOL(bsp_section_work_bonus_begin); 26 LINKER_SYMBOL(bsp_section_work_bonus_ size);26 LINKER_SYMBOL(bsp_section_work_bonus_end); 27 27 28 void bsp_work_area_initialize(void) 28 static Memory_Area _Memory_Areas[] = { 29 MEMORY_INITIALIZER(bsp_section_work_begin, bsp_section_work_end), 30 MEMORY_INITIALIZER(bsp_section_work_bonus_begin, bsp_section_work_bonus_end) 31 }; 32 33 static const Memory_Information _Memory_Information = 34 MEMORY_INFORMATION_INITIALIZER(_Memory_Areas); 35 36 const Memory_Information *_Memory_Get(void) 29 37 { 30 Heap_Area areas [] = { 31 { 32 bsp_section_work_begin, 33 (uintptr_t) bsp_section_work_size 34 }, { 35 bsp_section_work_bonus_begin, 36 (uintptr_t) bsp_section_work_bonus_size 37 } 38 }; 39 40 bsp_work_area_initialize_with_table( 41 areas, 42 sizeof(areas) / sizeof(areas [0]) 43 ); 38 return &_Memory_Information; 44 39 } -
bsps/powerpc/qoriq/start/mmu-config.c
r07e2eac reea21eac 33 33 34 34 #include <rtems/config.h> 35 #include <rtems/sysinit.h> 35 36 36 37 #define TEXT __attribute__((section(".bsp_start_text"))) … … 339 340 } 340 341 341 void TEXT bsp_work_area_initialize(void) 342 static Memory_Area _Memory_Areas[1]; 343 344 static const Memory_Information _Memory_Information = 345 MEMORY_INFORMATION_INITIALIZER(_Memory_Areas); 346 347 static void bsp_memory_initialize(void) 342 348 { 343 349 const entry *we = &config[WORKSPACE_ENTRY_INDEX]; 344 uintptr_t begin = we->begin; 345 uintptr_t end = begin + we->size; 346 347 bsp_work_area_initialize_default((void *) begin, end - begin); 348 } 350 351 _Memory_Initialize_by_size( 352 &_Memory_Areas[0], 353 (void *) we->begin, 354 we->size 355 ); 356 } 357 358 RTEMS_SYSINIT_ITEM( 359 bsp_memory_initialize, 360 RTEMS_SYSINIT_MEMORY, 361 RTEMS_SYSINIT_ORDER_MIDDLE 362 ); 363 364 const Memory_Information *_Memory_Get(void) 365 { 366 return &_Memory_Information; 367 } -
bsps/powerpc/shared/start/bspgetworkarea.c
r07e2eac reea21eac 10 10 #include <libcpu/powerpc-utility.h> 11 11 12 #include <rtems/sysinit.h> 13 12 14 LINKER_SYMBOL(__rtems_end) 13 15 14 void bsp_work_area_initialize(void) 16 static Memory_Area _Memory_Areas[1]; 17 18 static const Memory_Information _Memory_Information = 19 MEMORY_INFORMATION_INITIALIZER(_Memory_Areas); 20 21 static void bsp_memory_initialize(void) 15 22 { 16 uintptr_t work_size;17 uintptr_t work_area;23 uintptr_t size; 24 uintptr_t begin; 18 25 19 work_area= (uintptr_t)__rtems_end;20 work_size = (uintptr_t)BSP_mem_size - work_area;26 begin = (uintptr_t)__rtems_end; 27 size = (uintptr_t)BSP_mem_size - begin; 21 28 22 bsp_work_area_initialize_default((void *) work_area, work_size);29 _Memory_Initialize_by_size(&_Memory_Areas[0], (void *) begin, size); 23 30 } 31 32 RTEMS_SYSINIT_ITEM( 33 bsp_memory_initialize, 34 RTEMS_SYSINIT_MEMORY, 35 RTEMS_SYSINIT_ORDER_MIDDLE 36 ); 37 38 const Memory_Information *_Memory_Get(void) 39 { 40 return &_Memory_Information; 41 } -
bsps/powerpc/shared/start/sbrk.c
r07e2eac reea21eac 65 65 #include <unistd.h> 66 66 67 #include <bsp.h> 67 68 #include <bsp/bootcard.h> 69 70 #include <rtems/sysinit.h> 71 72 #ifdef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK 68 73 69 74 #define INVALID_REMAINING_START ((uintptr_t) -1) … … 84 89 #define LIMIT_32M 0x02000000 85 90 86 ptrdiff_t bsp_sbrk_init(Heap_Area *area, uintptr_t min_size) 91 /** 92 * @brief Gives the BSP a chance to reduce the work area size with sbrk() 93 * adding more later. 94 * 95 * bsp_sbrk_init() may reduce the work area size passed in. The routine 96 * returns the 'sbrk_amount' to be used when extending the heap. Note that 97 * the return value may be zero. 98 * 99 * In case the @a mem area size is altered, then the remaining size of the 100 * @a mem area must be greater than or equal to @a min_size. 101 */ 102 static ptrdiff_t bsp_sbrk_init(const Memory_Information *mem, uintptr_t min_size) 87 103 { 88 104 uintptr_t rval = 0; 89 105 uintptr_t policy; 90 106 uintptr_t remaining_end; 107 Memory_Area *area; 91 108 92 remaining_start = (uintptr_t) area->begin; 93 remaining_size = area->size; 94 remaining_end = remaining_start + remaining_size; 109 area = &mem->areas[ 0 ]; 110 remaining_start = (uintptr_t) _Memory_Get_free_begin(area); 111 remaining_size = _Memory_Get_free_size(area); 112 remaining_end = (uintptr_t) _Memory_Get_end(area); 95 113 96 114 if (remaining_start < LIMIT_32M && … … 99 117 /* clip at LIMIT_32M */ 100 118 rval = remaining_end - LIMIT_32M; 101 area->size = LIMIT_32M - remaining_start;119 _Memory_Set_end(area, (void *) (LIMIT_32M - remaining_start)); 102 120 remaining_start = LIMIT_32M; 103 121 remaining_size = rval; … … 107 125 switch ( policy ) { 108 126 case (uintptr_t)(-1): 109 area->size += rval;110 remaining_start = (uintptr_t) area->begin + area->size;111 remaining_size 127 _Memory_Set_end(area, (const char *) _Memory_Get_end(area) + rval); 128 remaining_start = (uintptr_t) _Memory_Get_end(area); 129 remaining_size = 0; 112 130 break; 113 131 … … 125 143 } 126 144 127 /* 128 * This is just so the sbrk test can force its magic. All normal applications 129 * should just use the default implementation in this file. 130 */ 131 void *sbrk(ptrdiff_t incr) __attribute__ (( weak, alias("bsp_sbrk") )); 132 static void *bsp_sbrk(ptrdiff_t incr) 145 void *sbrk(ptrdiff_t incr) 133 146 { 134 147 void *rval=(void*)-1; … … 146 159 return rval; 147 160 } 161 162 static void bsp_sbrk_initialize(void) 163 { 164 uintptr_t overhead = _Heap_Area_overhead(CPU_HEAP_ALIGNMENT); 165 uintptr_t work_space_size = rtems_configuration_get_work_space_size(); 166 ptrdiff_t sbrk_amount = bsp_sbrk_init( 167 _Memory_Get(), 168 work_space_size 169 + overhead 170 + (rtems_configuration_get_unified_work_area() ? 0 : overhead) 171 ); 172 173 rtems_heap_set_sbrk_amount(sbrk_amount); 174 } 175 176 RTEMS_SYSINIT_ITEM( 177 bsp_sbrk_initialize, 178 RTEMS_SYSINIT_SBRK, 179 RTEMS_SYSINIT_ORDER_MIDDLE 180 ); 181 182 #endif /* CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK */ -
bsps/powerpc/tqm8xx/start/bspgetworkarea.c
r07e2eac reea21eac 25 25 #include <bsp/linker-symbols.h> 26 26 27 void bsp_work_area_initialize(void) 27 #include <rtems/sysinit.h> 28 29 static Memory_Area _Memory_Areas[1]; 30 31 static const Memory_Information _Memory_Information = 32 MEMORY_INFORMATION_INITIALIZER(_Memory_Areas); 33 34 static void bsp_memory_initialize(void) 28 35 { 29 char *ram_end = (char *) (TQM_BD_INFO.sdram_size - (uint32_t)TopRamReserved); 30 void *area_start = bsp_section_work_begin; 31 uintptr_t area_size = (uintptr_t) ram_end - (uintptr_t) area_start; 36 void *end = (void *) (TQM_BD_INFO.sdram_size - (uintptr_t)TopRamReserved); 32 37 33 bsp_work_area_initialize_default( area_start, area_size);38 _Memory_Initialize(&_Memory_Areas[0], bsp_section_work_begin, end); 34 39 } 40 41 RTEMS_SYSINIT_ITEM( 42 bsp_memory_initialize, 43 RTEMS_SYSINIT_MEMORY, 44 RTEMS_SYSINIT_ORDER_MIDDLE 45 ); 46 47 const Memory_Information *_Memory_Get(void) 48 { 49 return &_Memory_Information; 50 } -
bsps/shared/start/bootcard.c
r07e2eac reea21eac 25 25 const char *bsp_boot_cmdline; 26 26 27 #if BSP_DIRTY_MEMORY == 1 28 static void bsp_dirty_memory(void) 29 { 30 _Memory_Fill( _Memory_Get(), 0xcf ); 31 } 32 27 33 RTEMS_SYSINIT_ITEM( 28 bsp_ work_area_initialize,29 RTEMS_SYSINIT_ BSP_WORK_AREAS,34 bsp_dirty_memory, 35 RTEMS_SYSINIT_DIRTY_MEMORY, 30 36 RTEMS_SYSINIT_ORDER_MIDDLE 31 37 ); 38 #endif 32 39 33 40 RTEMS_SYSINIT_ITEM( -
bsps/shared/start/bspgetworkarea-default.c
r07e2eac reea21eac 2 2 * @file 3 3 * 4 * This routine is an implementation of the bsp_work_area_initialize()4 * This routine is an implementation of the _Memory_Get() 5 5 * that can be used by all BSPs following linkcmds conventions 6 6 * regarding heap, stack, and workspace allocation. … … 34 34 */ 35 35 #ifdef USE_UBOOT 36 #include <bsp/u-boot.h> 37 #else 38 extern char RamBase[]; 39 extern char RamSize[]; 40 #endif 36 #include <bsp/u-boot.h> 37 #include <rtems/sysinit.h> 41 38 42 void bsp_work_area_initialize(void) 39 static Memory_Area _Memory_Areas[ 1 ]; 40 41 static void bsp_memory_initialize( void ) 43 42 { 44 uintptr_t work_base = (uintptr_t) WorkAreaBase; 45 uintptr_t ram_end; 43 char *end; 46 44 47 #ifdef USE_UBOOT 48 ram_end = (uintptr_t) bsp_uboot_board_info.bi_memstart + 49 bsp_uboot_board_info.bi_memsize; 50 #else 51 ram_end = (uintptr_t)RamBase + (uintptr_t)RamSize; 52 #endif 45 end = (char *) bsp_uboot_board_info.bi_memstart 46 + bsp_uboot_board_info.bi_memsize; 47 _Memory_Initialize( &_Memory_Areas[ 0 ], WorkAreaBase, end ); 48 } 53 49 54 bsp_work_area_initialize_default( (void *) work_base, ram_end - work_base ); 50 RTEMS_SYSINIT_ITEM( 51 bsp_memory_initialize, 52 RTEMS_SYSINIT_MEMORY, 53 RTEMS_SYSINIT_ORDER_MIDDLE 54 ); 55 #else /* !USE_UBOOT */ 56 extern char RamEnd[]; 57 58 static Memory_Area _Memory_Areas[] = { 59 MEMORY_INITIALIZER(WorkAreaBase, RamEnd) 60 }; 61 #endif /* USE_UBOOT */ 62 63 static const Memory_Information _Memory_Information = 64 MEMORY_INFORMATION_INITIALIZER( _Memory_Areas ); 65 66 const Memory_Information *_Memory_Get( void ) 67 { 68 return &_Memory_Information; 55 69 } -
bsps/sparc/shared/start/bspgetworkarea.c
r07e2eac reea21eac 14 14 #include <bsp/bootcard.h> 15 15 16 #include <rtems/sysinit.h> 17 16 18 /* Tells us where to put the workspace in case remote debugger is present. */ 17 extern uint 32_t rdb_start;19 extern uintptr_t rdb_start; 18 20 19 /* 20 * This method returns the base address and size of the area which 21 * is to be allocated between the RTEMS Workspace and the C Program 22 * Heap.23 */ 24 void bsp_work_area_initialize(void)21 static Memory_Area _Memory_Areas[ 1 ]; 22 23 static const Memory_Information _Memory_Information = 24 MEMORY_INFORMATION_INITIALIZER( _Memory_Areas ); 25 26 static void bsp_memory_initialize( void ) 25 27 { 26 /* Early dynamic memory allocator is placed just above _end */ 27 void *work_area_start = (void *)&end; 28 uintptr_t work_area_size = (uintptr_t)rdb_start - (uintptr_t)work_area_start; 28 void *begin; 29 uintptr_t size; 29 30 30 bsp_work_area_initialize_default(work_area_start, work_area_size); 31 begin = &end; 32 size = rdb_start - (uintptr_t)begin; 33 _Memory_Initialize_by_size( &_Memory_Areas[ 0 ], begin, size ); 31 34 } 35 36 RTEMS_SYSINIT_ITEM( 37 bsp_memory_initialize, 38 RTEMS_SYSINIT_MEMORY, 39 RTEMS_SYSINIT_ORDER_MIDDLE 40 ); 41 42 const Memory_Information *_Memory_Get( void ) 43 { 44 return &_Memory_Information; 45 } -
cpukit/include/rtems/confdefs.h
r07e2eac reea21eac 1261 1261 #ifdef CONFIGURE_INIT 1262 1262 /** 1263 * By default, RTEMS uses separate heaps for the RTEMS Workspace and1264 * the C Program Heap. The application can choose optionally to combine1265 * these to provide one larger memory pool. This is particularly1266 * useful in combination with the unlimited objects configuration.1267 */1268 #ifdef CONFIGURE_UNIFIED_WORK_AREAS1269 Heap_Control *RTEMS_Malloc_Heap = &_Workspace_Area;1270 #else1271 Heap_Control RTEMS_Malloc_Area;1272 Heap_Control *RTEMS_Malloc_Heap = &RTEMS_Malloc_Area;1273 #endif1274 #endif1275 1276 #ifdef CONFIGURE_INIT1277 /**1278 1263 * This configures the sbrk() support for the malloc family. 1279 1264 * By default it is assumed that the BSP provides all available -
cpukit/include/rtems/malloc.h
r07e2eac reea21eac 20 20 #include <rtems/bspIo.h> 21 21 #include <rtems/libcsupport.h> /* for malloc_walk() */ 22 #include <rtems/score/memory.h> 22 23 23 24 #include <stdint.h> … … 44 45 45 46 void RTEMS_Malloc_Initialize( 46 const Heap_Area *areas, 47 size_t area_count, 48 Heap_Initialization_or_extend_handler extend 47 const Memory_Information *mem, 48 Heap_Initialization_or_extend_handler extend 49 49 ); 50 50 -
cpukit/include/rtems/score/wkspace.h
r07e2eac reea21eac 25 25 #include <rtems/score/heap.h> 26 26 #include <rtems/score/interr.h> 27 #include <rtems/score/memory.h> 27 28 28 29 #ifdef __cplusplus … … 54 55 * This routine performs the initialization necessary for this handler. 55 56 * 56 * @param areas The heap area for the new workspace. 57 * @param area_count The number of areas for the allocation. 57 * @param mem The memory information 58 58 * @param extend The extension handler for the new workspace. 59 59 */ 60 60 void _Workspace_Handler_initialization( 61 Heap_Area *areas, 62 size_t area_count, 63 Heap_Initialization_or_extend_handler extend 61 const Memory_Information *mem, 62 Heap_Initialization_or_extend_handler extend 64 63 ); 65 64 -
cpukit/include/rtems/sysinit.h
r07e2eac reea21eac 29 29 #define RTEMS_SYSINIT_RECORD 000100 30 30 #define RTEMS_SYSINIT_BSP_EARLY 000140 31 #define RTEMS_SYSINIT_MEMORY 000180 32 #define RTEMS_SYSINIT_DIRTY_MEMORY 0001c0 31 33 #define RTEMS_SYSINIT_ISR_STACK 000200 32 #define RTEMS_SYSINIT_BSP_WORK_AREAS 000200 34 #define RTEMS_SYSINIT_PER_CPU_DATA 000220 35 #define RTEMS_SYSINIT_SBRK 000240 36 #define RTEMS_SYSINIT_WORKSPACE 000260 37 #define RTEMS_SYSINIT_MALLOC 000280 33 38 #define RTEMS_SYSINIT_BSP_START 000300 34 39 #define RTEMS_SYSINIT_CPU_COUNTER 000400 -
cpukit/libcsupport/src/malloc_initialize.c
r07e2eac reea21eac 19 19 20 20 #include <rtems/malloc.h> 21 #include <rtems/score/wkspace.h> 22 #include <rtems/sysinit.h> 21 23 22 24 #include "malloc_p.h" 23 25 26 Heap_Control *RTEMS_Malloc_Heap; 27 28 static void _Malloc_Initialize( void ) 29 { 30 RTEMS_Malloc_Initialize( _Memory_Get(), _Heap_Extend ); 31 } 32 33 RTEMS_SYSINIT_ITEM( 34 _Malloc_Initialize, 35 RTEMS_SYSINIT_MALLOC, 36 RTEMS_SYSINIT_ORDER_MIDDLE 37 ); 38 24 39 #ifdef RTEMS_NEWLIB 40 static Heap_Control _Malloc_Heap; 41 25 42 void RTEMS_Malloc_Initialize( 26 const Heap_Area *areas, 27 size_t area_count, 28 Heap_Initialization_or_extend_handler extend 43 const Memory_Information *mem, 44 Heap_Initialization_or_extend_handler extend 29 45 ) 30 46 { 31 Heap_Control *heap = RTEMS_Malloc_Heap; 47 if ( rtems_configuration_get_unified_work_area() ) { 48 RTEMS_Malloc_Heap = &_Workspace_Area; 49 } else { 50 Heap_Control *heap; 51 Heap_Initialization_or_extend_handler init_or_extend; 52 uintptr_t page_size; 53 size_t i; 32 54 33 if ( !rtems_configuration_get_unified_work_area() ) {34 Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize;35 uintptr_t page_size = CPU_HEAP_ALIGNMENT;36 size_t i;55 heap = &_Malloc_Heap; 56 RTEMS_Malloc_Heap = heap; 57 init_or_extend = _Heap_Initialize; 58 page_size = CPU_HEAP_ALIGNMENT; 37 59 38 for (i = 0; i < area_count; ++i) { 39 const Heap_Area *area = &areas [i]; 40 uintptr_t space_available = (*init_or_extend)( 60 for (i = 0; i < _Memory_Get_count( mem ); ++i) { 61 Memory_Area *area; 62 uintptr_t space_available; 63 64 area = _Memory_Get_area( mem, i ); 65 space_available = ( *init_or_extend )( 41 66 heap, 42 area->begin,43 area->size,67 _Memory_Get_free_begin( area ), 68 _Memory_Get_free_size( area ), 44 69 page_size 45 70 ); 46 71 47 72 if ( space_available > 0 ) { 73 _Memory_Consume( area, _Memory_Get_free_size( area ) ); 48 74 init_or_extend = extend; 49 75 } … … 57 83 #else 58 84 void RTEMS_Malloc_Initialize( 59 Heap_Area *areas, 60 size_t area_count, 61 Heap_Initialization_or_extend_handler extend 85 const Memory_Information *mem, 86 Heap_Initialization_or_extend_handler extend 62 87 ) 63 88 { -
cpukit/sapi/src/exinit.c
r07e2eac reea21eac 31 31 #include <rtems/score/interr.h> 32 32 #include <rtems/score/isr.h> 33 #include <rtems/score/percpudata.h> 33 34 #include <rtems/score/priority.h> 34 35 #include <rtems/score/schedulerimpl.h> … … 57 58 &_POSIX_Objects[ 0 ] 58 59 }; 60 61 RTEMS_LINKER_RWSET( 62 _Per_CPU_Data, 63 #if defined(RTEMS_SMP) 64 /* 65 * In SMP configurations, prevent false cache line sharing of per-processor 66 * data with a proper alignment. 67 */ 68 RTEMS_ALIGNED( CPU_CACHE_LINE_BYTES ) 69 #endif 70 char 71 ); 59 72 60 73 static void rtems_initialize_data_structures(void) -
cpukit/score/src/smp.c
r07e2eac reea21eac 21 21 #include <rtems/score/smpimpl.h> 22 22 #include <rtems/score/assert.h> 23 #include <rtems/score/memory.h> 24 #include <rtems/score/percpudata.h> 23 25 #include <rtems/score/schedulerimpl.h> 24 26 #include <rtems/score/threadimpl.h> 25 27 #include <rtems/config.h> 28 #include <rtems/sysinit.h> 29 30 #include <string.h> 26 31 27 32 #if CPU_USE_DEFERRED_FP_SWITCH == TRUE … … 253 258 } 254 259 } 260 261 static void _Per_CPU_Data_initialize( void ) 262 { 263 uintptr_t size; 264 265 size = RTEMS_LINKER_SET_SIZE( _Per_CPU_Data ); 266 267 if ( size > 0 ) { 268 const Memory_Information *mem; 269 Per_CPU_Control *cpu; 270 uint32_t cpu_index; 271 uint32_t cpu_max; 272 273 mem = _Memory_Get(); 274 cpu = _Per_CPU_Get_by_index( 0 ); 275 cpu->data = RTEMS_LINKER_SET_BEGIN( _Per_CPU_Data ); 276 277 cpu_max = rtems_configuration_get_maximum_processors(); 278 279 for ( cpu_index = 1 ; cpu_index < cpu_max ; ++cpu_index ) { 280 cpu = _Per_CPU_Get_by_index( cpu_index ); 281 cpu->data = _Memory_Allocate( mem, size, CPU_CACHE_LINE_BYTES ); 282 283 if( cpu->data == NULL ) { 284 _Internal_error( INTERNAL_ERROR_NO_MEMORY_FOR_PER_CPU_DATA ); 285 } 286 287 memcpy( cpu->data, RTEMS_LINKER_SET_BEGIN( _Per_CPU_Data ), size); 288 } 289 } 290 } 291 292 RTEMS_SYSINIT_ITEM( 293 _Per_CPU_Data_initialize, 294 RTEMS_SYSINIT_PER_CPU_DATA, 295 RTEMS_SYSINIT_ORDER_MIDDLE 296 ); -
cpukit/score/src/wkspace.c
r07e2eac reea21eac 23 23 #include <rtems/score/heapimpl.h> 24 24 #include <rtems/score/interr.h> 25 #include <rtems/score/percpudata.h>26 25 #include <rtems/score/threadimpl.h> 27 26 #include <rtems/score/tls.h> 28 27 #include <rtems/posix/pthread.h> 29 28 #include <rtems/config.h> 29 #include <rtems/sysinit.h> 30 30 31 31 #include <string.h> … … 35 35 #include <rtems/bspIo.h> 36 36 #endif 37 38 RTEMS_LINKER_RWSET(39 _Per_CPU_Data,40 #if defined(RTEMS_SMP)41 /*42 * In SMP configurations, prevent false cache line sharing of per-processor43 * data with a proper alignment.44 */45 RTEMS_ALIGNED( CPU_CACHE_LINE_BYTES )46 #endif47 char48 );49 37 50 38 Heap_Control _Workspace_Area; … … 85 73 } 86 74 87 #ifdef RTEMS_SMP 88 static void *_Workspace_Allocate_from_areas( 89 Heap_Area *areas, 90 size_t area_count, 91 uintptr_t size, 92 uintptr_t alignment 93 ) 94 { 95 size_t i; 96 97 for ( i = 0; i < area_count; ++i ) { 98 Heap_Area *area; 99 uintptr_t alloc_begin; 100 uintptr_t alloc_size; 101 102 area = &areas[ i ]; 103 alloc_begin = (uintptr_t) area->begin; 104 alloc_begin = ( alloc_begin + alignment - 1 ) & ~( alignment - 1 ); 105 alloc_size = size; 106 alloc_size += alloc_begin - (uintptr_t) area->begin; 107 108 if ( area->size >= alloc_size ) { 109 area->begin = (void *) ( alloc_begin + size ); 110 area->size -= alloc_size; 111 112 return (void *) alloc_begin; 113 } 114 } 115 116 return NULL; 117 } 118 #endif 119 120 static void _Workspace_Allocate_per_CPU_data( 121 Heap_Area *areas, 122 size_t area_count 123 ) 124 { 125 #ifdef RTEMS_SMP 126 uintptr_t size; 127 128 size = RTEMS_LINKER_SET_SIZE( _Per_CPU_Data ); 129 130 if ( size > 0 ) { 131 Per_CPU_Control *cpu; 132 uint32_t cpu_index; 133 uint32_t cpu_max; 134 135 cpu = _Per_CPU_Get_by_index( 0 ); 136 cpu->data = RTEMS_LINKER_SET_BEGIN( _Per_CPU_Data ); 137 138 cpu_max = rtems_configuration_get_maximum_processors(); 139 140 for ( cpu_index = 1 ; cpu_index < cpu_max ; ++cpu_index ) { 141 cpu = _Per_CPU_Get_by_index( cpu_index ); 142 cpu->data = _Workspace_Allocate_from_areas( 143 areas, 144 area_count, 145 size, 146 CPU_CACHE_LINE_BYTES 147 ); 148 149 if( cpu->data == NULL ) { 150 _Internal_error( INTERNAL_ERROR_NO_MEMORY_FOR_PER_CPU_DATA ); 151 } 152 153 memcpy( cpu->data, RTEMS_LINKER_SET_BEGIN( _Per_CPU_Data ), size); 154 } 155 } 156 #else 157 (void) areas; 158 (void) area_count; 159 #endif 160 } 75 static void _Workspace_Initialize( void ) 76 { 77 _Workspace_Handler_initialization( _Memory_Get(), _Heap_Extend ); 78 } 79 80 RTEMS_SYSINIT_ITEM( 81 _Workspace_Initialize, 82 RTEMS_SYSINIT_WORKSPACE, 83 RTEMS_SYSINIT_ORDER_MIDDLE 84 ); 161 85 162 86 void _Workspace_Handler_initialization( 163 Heap_Area *areas, 164 size_t area_count, 165 Heap_Initialization_or_extend_handler extend 87 const Memory_Information *mem, 88 Heap_Initialization_or_extend_handler extend 166 89 ) 167 90 { … … 174 97 size_t i; 175 98 176 _Workspace_Allocate_per_CPU_data( areas, area_count );177 178 99 page_size = CPU_HEAP_ALIGNMENT; 179 180 100 remaining = rtems_configuration_get_work_space_size(); 181 101 remaining += _Workspace_Space_for_TLS( page_size ); … … 186 106 overhead = _Heap_Area_overhead( page_size ); 187 107 188 for ( i = 0; i < area_count; ++i ) { 189 Heap_Area *area; 190 191 area = &areas[ i ]; 108 for ( i = 0; i < _Memory_Get_count( mem ); ++i ) { 109 Memory_Area *area; 110 uintptr_t free_size; 111 112 area = _Memory_Get_area( mem, i ); 113 free_size = _Memory_Get_free_size( area ); 192 114 193 115 if ( do_zero ) { 194 memset( area->begin, 0, area->size );116 memset( _Memory_Get_free_begin( area ), 0, free_size ); 195 117 } 196 118 197 if ( area->size > overhead ) {119 if ( free_size > overhead ) { 198 120 uintptr_t space_available; 199 121 uintptr_t size; 200 122 201 123 if ( unified ) { 202 size = area->size;124 size = free_size; 203 125 } else { 204 126 if ( remaining > 0 ) { 205 size = remaining < area->size - overhead ?206 remaining + overhead : area->size;127 size = remaining < free_size - overhead ? 128 remaining + overhead : free_size; 207 129 } else { 208 130 size = 0; … … 212 134 space_available = ( *init_or_extend )( 213 135 &_Workspace_Area, 214 area->begin,136 _Memory_Get_free_begin( area ), 215 137 size, 216 138 page_size 217 139 ); 218 140 219 area->begin = (char *) area->begin + size; 220 area->size -= size; 141 _Memory_Consume( area, size ); 221 142 222 143 if ( space_available < remaining ) { -
testsuites/libtests/malloc04/init.c
r07e2eac reea21eac 79 79 { 80 80 Heap_Control *real_heap; 81 Heap_Area area; 81 Memory_Area area; 82 Memory_Information mem = { 83 .count = 0, 84 .areas = &area 85 }; 86 82 87 void *p; 83 88 … … 94 99 sbrk_count = 0; 95 100 offset = 256; 96 area.begin = &Malloc_Heap [0]; 97 area.size = offset; 98 RTEMS_Malloc_Initialize( &area, 1, NULL ); 101 _Memory_Initialize_by_size( &area, &Malloc_Heap[ 0 ], offset ); 102 RTEMS_Malloc_Initialize( &mem, NULL ); 99 103 100 104 errno = 0; … … 110 114 sbrk_count = 0; 111 115 offset = 256; 112 area.begin = &Malloc_Heap [0]; 113 area.size = offset; 114 RTEMS_Malloc_Initialize( &area, 1, NULL ); 116 _Memory_Initialize_by_size( &area, &Malloc_Heap[ 0 ], offset ); 117 RTEMS_Malloc_Initialize( &mem, NULL ); 115 118 116 119 p = malloc(1); … … 126 129 sbrk_count = 0; 127 130 offset = 256; 128 area.begin = &Malloc_Heap [0]; 129 area.size = offset; 130 RTEMS_Malloc_Initialize( &area, 1, NULL ); 131 _Memory_Initialize_by_size( &area, &Malloc_Heap[ 0 ], offset ); 132 RTEMS_Malloc_Initialize( &mem, NULL ); 131 133 132 134 errno = 0; … … 140 142 sbrk_count = 0; 141 143 offset = 256; 142 area.begin = &Malloc_Heap [0]; 143 area.size = offset; 144 RTEMS_Malloc_Initialize( &area, 1, NULL ); 144 _Memory_Initialize_by_size( &area, &Malloc_Heap[ 0 ], offset ); 145 RTEMS_Malloc_Initialize( &mem, NULL ); 145 146 146 147 p = malloc( 128 ); … … 156 157 sbrk_count = -1; 157 158 offset = 256; 158 area.begin = &Malloc_Heap [0]; 159 area.size = offset; 160 RTEMS_Malloc_Initialize( &area, 1, NULL ); 159 _Memory_Initialize_by_size( &area, &Malloc_Heap[ 0 ], offset ); 160 RTEMS_Malloc_Initialize( &mem, NULL ); 161 161 162 162 errno = 0; -
testsuites/smptests/smpfatal09/init.c
r07e2eac reea21eac 32 32 #include <rtems.h> 33 33 #include <rtems/score/percpudata.h> 34 #include <rtems/score/wkspace.h> 34 #include <rtems/score/memory.h> 35 #include <rtems/sysinit.h> 35 36 36 37 #include <tmacros.h> … … 42 43 static void Init( rtems_task_argument arg ) 43 44 { 44 Heap_Area area = { .begin = NULL, .size = 0 }; 45 (void) arg; 46 } 47 48 static void consume_all_memory( void ) 49 { 50 const Memory_Information *mem; 51 size_t i; 52 53 mem = _Memory_Get(); 54 55 for ( i = 0; i < _Memory_Get_count( mem ); ++i ) { 56 Memory_Area *area; 57 58 area = _Memory_Get_area( mem, i ); 59 _Memory_Consume( area, _Memory_Get_free_size( area ) ); 60 } 61 } 62 63 static void begin_test( void ) 64 { 45 65 int i; 46 66 … … 50 70 rtems_test_assert( i == 123 ); 51 71 52 _Workspace_Handler_initialization( &area, 1, NULL ); 53 rtems_test_assert( 0 ); 72 consume_all_memory(); 54 73 } 74 75 RTEMS_SYSINIT_ITEM( 76 begin_test, 77 RTEMS_SYSINIT_PER_CPU_DATA, 78 RTEMS_SYSINIT_ORDER_FIRST 79 ); 55 80 56 81 static void fatal_extension( -
testsuites/sptests/spfatal09/init.c
r07e2eac reea21eac 16 16 */ 17 17 18 #include <rtems/malloc.h> 19 #include <rtems/libcsupport.h> 18 #include <rtems/score/memory.h> 19 #include <rtems/sysinit.h> 20 21 #include <stdlib.h> 20 22 21 23 #define FATAL_ERROR_TEST_NAME "9" … … 24 26 #define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_NO_MEMORY_FOR_HEAP 25 27 26 static void force_error( void)28 static void force_error( void ) 27 29 { 28 RTEMS_Malloc_Initialize( NULL, 0, NULL ); 30 void *p; 31 29 32 /* we will not run this far */ 33 p = malloc( 1 ); 34 RTEMS_OBFUSCATE_VARIABLE( p ); 30 35 } 31 36 37 static void consume_all_memory( void ) 38 { 39 const Memory_Information *mem; 40 size_t i; 41 42 mem = _Memory_Get(); 43 44 for ( i = 0; i < _Memory_Get_count( mem ); ++i ) { 45 Memory_Area *area; 46 47 area = _Memory_Get_area( mem, i ); 48 _Memory_Consume( area, _Memory_Get_free_size( area ) ); 49 } 50 } 51 52 RTEMS_SYSINIT_ITEM( 53 consume_all_memory, 54 RTEMS_SYSINIT_MALLOC, 55 RTEMS_SYSINIT_ORDER_FIRST 56 ); 57 32 58 #include "../spfatal_support/spfatalimpl.h" -
testsuites/sptests/spfatal12/init.c
r07e2eac reea21eac 16 16 17 17 #include <rtems/score/wkspace.h> 18 #include <rtems/score/memory.h> 19 #include <rtems/sysinit.h> 18 20 19 21 #define FATAL_ERROR_TEST_NAME "12" … … 23 25 #define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_TOO_LITTLE_WORKSPACE 24 26 25 static void force_error( void)27 static void force_error( void ) 26 28 { 27 Heap_Area area = { .begin = NULL, .size = 0 };29 void *p; 28 30 29 _Workspace_Handler_initialization( &area, 1, NULL );30 31 /* we will not run this far */ 32 p = _Workspace_Allocate( 1 ); 33 RTEMS_OBFUSCATE_VARIABLE( p ); 31 34 } 32 35 36 static void consume_all_memory( void ) 37 { 38 const Memory_Information *mem; 39 size_t i; 40 41 mem = _Memory_Get(); 42 43 for ( i = 0; i < _Memory_Get_count( mem ); ++i ) { 44 Memory_Area *area; 45 46 area = _Memory_Get_area( mem, i ); 47 _Memory_Consume( area, _Memory_Get_free_size( area ) ); 48 } 49 } 50 51 RTEMS_SYSINIT_ITEM( 52 consume_all_memory, 53 RTEMS_SYSINIT_WORKSPACE, 54 RTEMS_SYSINIT_ORDER_FIRST 55 ); 56 33 57 #include "../spfatal_support/spfatalimpl.h" -
testsuites/sptests/spsysinit01/init.c
r07e2eac reea21eac 72 72 73 73 typedef enum { 74 BSP_WORK_AREAS_PRE,75 BSP_WORK_AREAS_POST,74 WORKSPACE_PRE, 75 WORKSPACE_POST, 76 76 BSP_START_PRE, 77 77 BSP_START_POST, … … 201 201 } 202 202 203 FIRST(RTEMS_SYSINIT_ BSP_WORK_AREAS)203 FIRST(RTEMS_SYSINIT_WORKSPACE) 204 204 { 205 205 assert(_Workspace_Area.area_begin == 0); 206 next_step( BSP_WORK_AREAS_PRE);207 } 208 209 LAST(RTEMS_SYSINIT_ BSP_WORK_AREAS)206 next_step(WORKSPACE_PRE); 207 } 208 209 LAST(RTEMS_SYSINIT_WORKSPACE) 210 210 { 211 211 assert(_Workspace_Area.area_begin != 0); 212 next_step( BSP_WORK_AREAS_POST);212 next_step(WORKSPACE_POST); 213 213 } 214 214
Note: See TracChangeset
for help on using the changeset viewer.