Skip to content

Commit c4ded3b

Browse files
josecmdanielRep
authored andcommitted
fix(riscv): adapt boot symbol variables size to XLEN
Signed-off-by: Jose Martins <[email protected]>
1 parent baad8ea commit c4ded3b

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

src/arch/riscv/boot.S

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,33 @@
5252
LOAD \rd, 0(\rd)
5353
.endm
5454

55+
.macro DEFINE_WORD val
56+
#if REGLEN == 8
57+
.8byte \val
58+
#else
59+
.4byte \val
60+
#endif
61+
.endm
62+
5563
.section ".rodata", "a"
64+
.balign REGLEN
5665
/* Symbol values */
57-
_image_start_sym: .8byte _image_start
58-
_image_load_end_sym: .8byte _image_load_end
59-
_image_noload_start_sym: .8byte _image_noload_start
60-
_image_end_sym: .8byte _image_end
61-
_dmem_beg_sym: .8byte _dmem_beg
62-
_enter_vas_sym: .8byte _enter_vas
63-
_bss_start_sym: .8byte _bss_start
64-
_bss_end_sym: .8byte _bss_end
65-
_extra_allocated_phys_mem_sym: .8byte extra_allocated_phys_mem
66+
_image_start_sym: DEFINE_WORD _image_start
67+
_image_load_end_sym: DEFINE_WORD _image_load_end
68+
_image_noload_start_sym: DEFINE_WORD _image_noload_start
69+
_image_end_sym: DEFINE_WORD _image_end
70+
_dmem_beg_sym: DEFINE_WORD _dmem_beg
71+
_enter_vas_sym: DEFINE_WORD _enter_vas
72+
_bss_start_sym: DEFINE_WORD _bss_start
73+
_bss_end_sym: DEFINE_WORD _bss_end
74+
_extra_allocated_phys_mem_sym: DEFINE_WORD extra_allocated_phys_mem
6675

6776
.data
68-
.align 3
77+
.balign REGLEN
6978
/**
7079
* barrier is used to minimal synchronization in boot - other cores wait for bsp to set it.
7180
*/
72-
_barrier: .8byte 0
81+
_barrier: DEFINE_WORD 0
7382

7483
/**
7584
* The following code MUST be at the base of the image, as this is bao's entrypoint. Therefore

0 commit comments

Comments
 (0)