Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion platform/airbender.ld
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ SECTIONS
__image_text_end = .;
} >rom :text

.rodata ALIGN(8) : {
.rodata : ALIGN(8) {
*(.srodata .srodata.*)
*(.rodata .rodata.*)
} >rom :rodata
Expand Down
40 changes: 17 additions & 23 deletions platform/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -66,38 +66,32 @@ _start:
la sp, _init_stack_top

/* Initialised RAM: one block linked to run in RAM and loaded in ROM, which
* the delegations cannot read. Eight words a round, then the rest one by
* one: without .NET's data rehydration the block is hundreds of KiB. */
* the delegations cannot read. 64 words a round, then the rest one by
* one: without .NET's data rehydration the block is hundreds of KiB, and
* each word takes a load and a store, so the pointer steps and the branch
* are what a longer round saves. */
la t0, __ram_init_load
la t1, __ram_init_start
la t2, __ram_init_end
addi t4, t2, -32
addi t4, t2, -256
bgtu t1, t4, 3f
1: lw t3, 0(t0)
lw t5, 4(t0)
lw t6, 8(t0)
lw a2, 12(t0)
lw a3, 16(t0)
lw a4, 20(t0)
lw a5, 24(t0)
lw a6, 28(t0)
sw t3, 0(t1)
sw t5, 4(t1)
sw t6, 8(t1)
sw a2, 12(t1)
sw a3, 16(t1)
sw a4, 20(t1)
sw a5, 24(t1)
sw a6, 28(t1)
addi t0, t0, 32
addi t1, t1, 32
1:
.set offset, 0
.rept 64
lw t3, offset(t0)
sw t3, offset(t1)
.set offset, offset + 4
.endr
addi t0, t0, 256
addi t1, t1, 256
bleu t1, t4, 1b
3: bgeu t1, t2, 2f
3: beq t1, t2, 2f
4:
lw t3, 0(t0)
sw t3, 0(t1)
addi t0, t0, 4
addi t1, t1, 4
j 3b
bne t1, t2, 4b
2:
/* .bss needs no clearing: RAM starts zeroed, in the circuit (its memory
* argument fixes the initial value at 0) and in the simulator alike, and
Expand Down
3 changes: 3 additions & 0 deletions tests/platform/airbender-tls.S
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
.global _start
_start:
j _start
.section .rodata,"a",@progbits
.balign 128
.word 0x11223344
.section __modules,"aw",@progbits
.word 0x12345678
.section .data,"aw",@progbits
Expand Down
2 changes: 1 addition & 1 deletion tests/platform/run-tls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trap 'rm -rf "$work_dir"' EXIT

clang --target=riscv32-unknown-elf -march=rv32im -mabi=ilp32 \
-c "$test_dir/airbender-tls.S" -o "$work_dir/input.o"
"${BFLAT_LD:-ld.lld}" -static --no-relax \
"${BFLAT_LD:-ld.lld}" -static --no-relax --fatal-warnings \
-T "$test_dir/../../platform/airbender.ld" \
"$work_dir/input.o" -o "$work_dir/guest"
"${BFLAT_OBJCOPY:-llvm-objcopy}" -O binary "$work_dir/guest" "$work_dir/guest.bin"
Expand Down
Loading