Changeset 9e3bb45 in rtems
- Timestamp:
- 05/29/18 07:14:24 (4 years ago)
- Branches:
- 5, master
- Children:
- 92388f6
- Parents:
- 511dc4b
- git-author:
- Sebastian Huber <sebastian.huber@…> (05/29/18 07:14:24)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (06/27/18 06:58:17)
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
bsps/riscv/riscv_generic/console/console-io.c
r511dc4b r9e3bb45 45 45 volatile uint64_t tohost __attribute__((section(".htif"))); 46 46 volatile uint64_t fromhost __attribute__((section(".htif"))); 47 volatile uint64_t riscv_fill_up_htif_section[510] __attribute__((section(".htif"))); 47 48 volatile int htif_console_buf; 48 49 -
bsps/riscv/riscv_generic/start/linkcmds
r511dc4b r9e3bb45 1 /**2 * @file3 *4 * @ingroup bsp_linker5 *6 * @brief Memory map7 */8 9 1 /* 10 *11 2 * Copyright (c) 2015 University of York. 12 3 * Hesham ALMatary <hmka501@york.ac.uk> … … 34 25 */ 35 26 36 OUTPUT_ARCH (riscv)37 38 ENTRY (_start)39 STARTUP (start.o)40 41 27 MEMORY 42 28 { … … 44 30 } 45 31 46 REGION_ALIAS ("REGION_VECTOR", RAM);47 32 REGION_ALIAS ("REGION_START", RAM); 48 33 REGION_ALIAS ("REGION_TEXT", RAM); 49 34 REGION_ALIAS ("REGION_TEXT_LOAD", RAM); 35 REGION_ALIAS ("REGION_FAST_TEXT", RAM); 36 REGION_ALIAS ("REGION_FAST_TEXT_LOAD", RAM); 50 37 REGION_ALIAS ("REGION_RODATA", RAM); 51 38 REGION_ALIAS ("REGION_RODATA_LOAD", RAM); 52 39 REGION_ALIAS ("REGION_DATA", RAM); 53 40 REGION_ALIAS ("REGION_DATA_LOAD", RAM); 54 REGION_ALIAS ("REGION_HTIF", RAM);55 REGION_ALIAS ("REGION_HTIF_LOAD", RAM);56 41 REGION_ALIAS ("REGION_FAST_DATA", RAM); 57 42 REGION_ALIAS ("REGION_FAST_DATA_LOAD", RAM); 58 REGION_ALIAS ("REGION_ BSS", RAM);43 REGION_ALIAS ("REGION_RTEMSSTACK", RAM); 59 44 REGION_ALIAS ("REGION_WORK", RAM); 60 REGION_ALIAS ("REGION_STACK", RAM);61 45 62 /* 63 * Global symbols that may be defined externally 64 */ 65 bsp_vector_table_size = DEFINED (bsp_vector_table_size) ? bsp_vector_table_size : 64; 66 67 bsp_section_xbarrier_align = DEFINED (bsp_section_xbarrier_align) ? bsp_section_xbarrier_align : 1; 68 bsp_section_robarrier_align = DEFINED (bsp_section_robarrier_align) ? bsp_section_robarrier_align : 1; 69 bsp_section_rwbarrier_align = DEFINED (bsp_section_rwbarrier_align) ? bsp_section_rwbarrier_align : 1; 70 71 bsp_stack_align = DEFINED (bsp_stack_align) ? bsp_stack_align : 16; 72 73 bsp_stack_main_size = DEFINED (bsp_stack_main_size) ? bsp_stack_main_size : 4096; 74 bsp_stack_main_size = ALIGN (bsp_stack_main_size, bsp_stack_align); 75 76 SECTIONS { 77 78 .vector : 79 { 80 . = ALIGN(8); 81 bsp_section_vector_begin = .; 82 *(.vector) 83 . = ALIGN(bsp_vector_table_size); 84 bsp_section_vector_end = .; 85 } > REGION_VECTOR AT > REGION_VECTOR 86 bsp_section_vector_size = bsp_section_vector_end - bsp_section_vector_begin; 87 bsp_vector_table_begin = bsp_section_vector_begin; 88 bsp_vector_table_end = bsp_vector_table_begin + bsp_vector_table_size; 89 90 .start : 91 { 92 . = ALIGN(8); 93 bsp_section_start_begin = .; 94 KEEP (*(.bsp_start_text)) 95 KEEP (*(.bsp_start_data)) 96 bsp_section_start_end = .; 97 } > REGION_START AT > REGION_START 98 bsp_section_start_size = bsp_section_start_end - bsp_section_start_begin; 99 100 .xbarrier : { 101 . = ALIGN (bsp_section_xbarrier_align); 102 } > REGION_VECTOR AT > REGION_VECTOR 103 104 .text : { 105 . = ALIGN(8); 106 bsp_section_text_begin = .; 107 *(.text.unlikely .text.*_unlikely) 108 *(.text .stub .text.* .gnu.linkonce.t.*) 109 /* .gnu.warning sections are handled specially by elf32.em. */ 110 *(.gnu.warning) 111 *(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx) 112 } > REGION_TEXT AT > REGION_TEXT_LOAD 113 .init : { 114 KEEP (*(.init)) 115 } > REGION_TEXT AT > REGION_TEXT_LOAD 116 .fini : { 117 KEEP (*(.fini)) 118 . = ALIGN(8); 119 bsp_section_text_end = .; 120 } > REGION_TEXT AT > REGION_TEXT_LOAD 121 bsp_section_text_size = bsp_section_text_end - bsp_section_text_begin; 122 bsp_section_text_load_begin = LOADADDR (.text); 123 bsp_section_text_load_end = bsp_section_text_load_begin + bsp_section_text_size; 124 125 .robarrier : { 126 . = ALIGN (bsp_section_robarrier_align); 127 } > REGION_RODATA AT > REGION_RODATA 128 129 .rodata : { 130 . = ALIGN(8); 131 bsp_section_rodata_begin = .; 132 *(.rodata .rodata.* .gnu.linkonce.r.*) 133 } > REGION_RODATA AT > REGION_RODATA_LOAD 134 .eh_frame : { 135 KEEP (*(.eh_frame)) 136 } > REGION_RODATA AT > REGION_RODATA_LOAD 137 .gcc_except_table : { 138 *(.gcc_except_table .gcc_except_table.*) 139 } > REGION_RODATA AT > REGION_RODATA_LOAD 140 .tdata : { 141 _TLS_Data_begin = .; 142 *(.tdata .tdata.* .gnu.linkonce.td.*) 143 _TLS_Data_end = .; 144 } > REGION_RODATA AT > REGION_RODATA_LOAD 145 .tbss : { 146 _TLS_BSS_begin = .; 147 *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) 148 _TLS_BSS_end = .; 149 } > REGION_RODATA AT > REGION_RODATA_LOAD 150 _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin; 151 _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin; 152 _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin; 153 _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin; 154 _TLS_Size = _TLS_BSS_end - _TLS_Data_begin; 155 _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss)); 156 .preinit_array : { 157 PROVIDE_HIDDEN (__preinit_array_start = .); 158 KEEP (*(.preinit_array)) 159 PROVIDE_HIDDEN (__preinit_array_end = .); 160 } > REGION_RODATA AT > REGION_RODATA_LOAD 161 .init_array : { 162 PROVIDE_HIDDEN (__init_array_start = .); 163 KEEP (*(SORT(.init_array.*))) 164 KEEP (*(.init_array)) 165 PROVIDE_HIDDEN (__init_array_end = .); 166 } > REGION_RODATA AT > REGION_RODATA_LOAD 167 .fini_array : { 168 PROVIDE_HIDDEN (__fini_array_start = .); 169 KEEP (*(.fini_array)) 170 KEEP (*(SORT(.fini_array.*))) 171 PROVIDE_HIDDEN (__fini_array_end = .); 172 } > REGION_RODATA AT > REGION_RODATA_LOAD 173 .ctors : { 174 /* gcc uses crtbegin.o to find the start of 175 the constructors, so we make sure it is 176 first. Because this is a wildcard, it 177 doesn't matter if the user does not 178 actually link against crtbegin.o; the 179 linker won't look for a file to match a 180 wildcard. The wildcard also means that it 181 doesn't matter which directory crtbegin.o 182 is in. */ 183 KEEP (*crtbegin.o(.ctors)) 184 KEEP (*crtbegin?.o(.ctors)) 185 /* We don't want to include the .ctor section from 186 the crtend.o file until after the sorted ctors. 187 The .ctor section from the crtend file contains the 188 end of ctors marker and it must be last */ 189 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) 190 KEEP (*(SORT(.ctors.*))) 191 KEEP (*(.ctors)) 192 } > REGION_RODATA AT > REGION_RODATA_LOAD 193 .dtors : { 194 KEEP (*crtbegin.o(.dtors)) 195 KEEP (*crtbegin?.o(.dtors)) 196 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) 197 KEEP (*(SORT(.dtors.*))) 198 KEEP (*(.dtors)) 199 } > REGION_RODATA AT > REGION_RODATA_LOAD 200 .data.rel.ro : { 201 *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) 202 *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) 203 } > REGION_RODATA AT > REGION_RODATA_LOAD 204 .jcr : { 205 KEEP (*(.jcr)) 206 } > REGION_RODATA AT > REGION_RODATA_LOAD 207 .interp : { 208 *(.interp) 209 } > REGION_RODATA AT > REGION_RODATA_LOAD 210 .note.gnu.build-id : { 211 *(.note.gnu.build-id) 212 } > REGION_RODATA AT > REGION_RODATA_LOAD 213 .hash : { 214 *(.hash) 215 } > REGION_RODATA AT > REGION_RODATA_LOAD 216 .gnu.hash : { 217 *(.gnu.hash) 218 } > REGION_RODATA AT > REGION_RODATA_LOAD 219 .dynsym : { 220 *(.dynsym) 221 } > REGION_RODATA AT > REGION_RODATA_LOAD 222 .dynstr : { 223 *(.dynstr) 224 } > REGION_RODATA AT > REGION_RODATA_LOAD 225 .gnu.version : { 226 *(.gnu.version) 227 } > REGION_RODATA AT > REGION_RODATA_LOAD 228 .gnu.version_d : { 229 *(.gnu.version_d) 230 } > REGION_RODATA AT > REGION_RODATA_LOAD 231 .gnu.version_r : { 232 *(.gnu.version_r) 233 } > REGION_RODATA AT > REGION_RODATA_LOAD 234 .rel.dyn : { 235 *(.rel.init) 236 *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) 237 *(.rel.fini) 238 *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) 239 *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) 240 *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) 241 *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) 242 *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) 243 *(.rel.ctors) 244 *(.rel.dtors) 245 *(.rel.got) 246 *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) 247 PROVIDE_HIDDEN (__rel_iplt_start = .); 248 *(.rel.iplt) 249 PROVIDE_HIDDEN (__rel_iplt_end = .); 250 PROVIDE_HIDDEN (__rela_iplt_start = .); 251 PROVIDE_HIDDEN (__rela_iplt_end = .); 252 } > REGION_RODATA AT > REGION_RODATA_LOAD 253 .rela.dyn : { 254 *(.rela.init) 255 *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) 256 *(.rela.fini) 257 *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) 258 *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) 259 *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) 260 *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) 261 *(.rela.ctors) 262 *(.rela.dtors) 263 *(.rela.got) 264 *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) 265 PROVIDE_HIDDEN (__rel_iplt_start = .); 266 PROVIDE_HIDDEN (__rel_iplt_end = .); 267 PROVIDE_HIDDEN (__rela_iplt_start = .); 268 *(.rela.iplt) 269 PROVIDE_HIDDEN (__rela_iplt_end = .); 270 } > REGION_RODATA AT > REGION_RODATA_LOAD 271 .rel.plt : { 272 *(.rel.plt) 273 } > REGION_RODATA AT > REGION_RODATA_LOAD 274 .rela.plt : { 275 *(.rela.plt) 276 } > REGION_RODATA AT > REGION_RODATA_LOAD 277 .plt : { 278 *(.plt) 279 } > REGION_RODATA AT > REGION_RODATA_LOAD 280 .iplt : { 281 *(.iplt) 282 } > REGION_RODATA AT > REGION_RODATA_LOAD 283 .dynamic : { 284 *(.dynamic) 285 } > REGION_RODATA AT > REGION_RODATA_LOAD 286 .got : { 287 *(.got.plt) *(.igot.plt) *(.got) *(.igot) 288 } > REGION_RODATA AT > REGION_RODATA_LOAD 289 .rtemsroset : { 290 /* Special FreeBSD linker set sections */ 291 __start_set_sysctl_set = .; 292 *(set_sysctl_*); 293 __stop_set_sysctl_set = .; 294 *(set_domain_*); 295 *(set_pseudo_*); 296 297 KEEP (*(SORT(.rtemsroset.*))) 298 . = ALIGN(8); 299 bsp_section_rodata_end = .; 300 } > REGION_RODATA AT > REGION_RODATA_LOAD 301 bsp_section_rodata_size = bsp_section_rodata_end - bsp_section_rodata_begin; 302 bsp_section_rodata_load_begin = LOADADDR (.rodata); 303 bsp_section_rodata_load_end = bsp_section_rodata_load_begin + bsp_section_rodata_size; 304 305 /*--------------------------------------------------------------------*/ 306 /* HTIF, isolated onto separate page */ 307 /*--------------------------------------------------------------------*/ 308 .htif : 309 { 310 . = ALIGN(0x1000); 311 *(.htif) 312 . = ALIGN(0x1000); 313 } > REGION_HTIF AT > REGION_HTIF_LOAD 314 315 316 .rwbarrier : { 317 . = ALIGN(8); 318 . = ALIGN (bsp_section_rwbarrier_align); 319 } > REGION_DATA AT > REGION_DATA 320 321 .data : { 322 . = ALIGN(8); 323 bsp_section_data_begin = .; 324 *(.data .data.* .gnu.linkonce.d.*) 325 SORT(CONSTRUCTORS) 326 } > REGION_DATA AT > REGION_DATA_LOAD 327 .data1 : { 328 *(.data1) 329 } > REGION_DATA AT > REGION_DATA_LOAD 330 .rtemsrwset : { 331 KEEP (*(SORT(.rtemsrwset.*))) 332 . = ALIGN(8); 333 bsp_section_data_end = .; 334 } > REGION_DATA AT > REGION_DATA_LOAD 335 bsp_section_data_size = bsp_section_data_end - bsp_section_data_begin; 336 bsp_section_data_load_begin = LOADADDR (.data); 337 bsp_section_data_load_end = bsp_section_data_load_begin + bsp_section_data_size; 338 339 .bss : { 340 . = ALIGN(8); 341 bsp_section_bss_begin = .; 342 *(.dynbss) 343 *(.bss .bss.* .gnu.linkonce.b.*) 344 *(COMMON) 345 . = ALIGN(8); 346 bsp_section_bss_end = .; 347 } > REGION_BSS AT > REGION_BSS 348 bsp_section_bss_size = bsp_section_bss_end - bsp_section_bss_begin; 349 350 .rtemsstack (NOLOAD) : { 351 *(SORT(.rtemsstack.*)) 352 } > REGION_WORK AT > REGION_WORK 353 354 .work : { 355 /* 356 * The work section will occupy the remaining REGION_WORK region and 357 * contains the RTEMS work space and heap. 358 */ 359 . = ALIGN(8); 360 bsp_section_work_begin = .; 361 . += ORIGIN (REGION_WORK) + LENGTH (REGION_WORK) - ABSOLUTE (.); 362 . = ALIGN(8); 363 bsp_section_work_end = .; 364 } > REGION_WORK AT > REGION_WORK 365 bsp_section_work_size = bsp_section_work_end - bsp_section_work_begin; 366 367 .stack : { 368 . = ALIGN(8); 369 bsp_section_stack_begin = .; 370 . += ORIGIN (REGION_STACK) + LENGTH (REGION_STACK) - ABSOLUTE (.); 371 . = ALIGN(8); 372 bsp_section_stack_end = .; 373 } > REGION_STACK AT > REGION_STACK 374 bsp_section_stack_size = bsp_section_stack_begin - bsp_section_stack_end; 375 376 RamBase = ORIGIN (REGION_WORK); 377 RamSize = LENGTH (REGION_WORK); 378 WorkAreaBase = bsp_section_work_begin; 379 HeapSize = 0; 380 } 46 INCLUDE linkcmds.base -
bsps/riscv/riscv_generic/start/start.S
r511dc4b r9e3bb45 35 35 EXTERN(bsp_section_bss_end) 36 36 EXTERN(ISR_Handler) 37 EXTERN(bsp_start_vector_table_size)38 EXTERN(bsp_vector_table_size)39 37 EXTERN(bsp_section_stack_begin) 40 38 … … 43 41 PUBLIC(_start) 44 42 45 .section . start, "wax"43 .section .bsp_start_text, "wax" 46 44 TYPE_FUNC(_start) 47 45 SYM(_start): -
c/src/lib/libbsp/riscv/riscv_generic/Makefile.am
r511dc4b r9e3bb45 24 24 25 25 project_lib_DATA += linkcmds 26 project_lib_DATA += ../../../../../../bsps/riscv/riscv/start/linkcmds.base 26 27 27 28 ###############################################################################
Note: See TracChangeset
for help on using the changeset viewer.