Skip to content

Commit

Permalink
Improve assembly style throughout
Browse files Browse the repository at this point in the history
  • Loading branch information
nspin committed Sep 5, 2023
1 parent 005dfec commit af42145
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ cfg_if::cfg_if! {
mov sp, x9
b __rust_entry
1:
b 1b
1: b 1b
"#
}
} else if #[cfg(target_arch = "riscv64")] {
Expand All @@ -131,17 +130,15 @@ cfg_if::cfg_if! {
# See https://www.sifive.com/blog/all-aboard-part-3-linker-relaxation-in-riscv-toolchain
.option push
.option norelax
1:
auipc gp, %pcrel_hi(__global_pointer$)
1: auipc gp, %pcrel_hi(__global_pointer$)
addi gp, gp, %pcrel_lo(1b)
.option pop
la sp, __stack_top
ld sp, (sp)
jal __rust_entry
1:
j 1b
1: j 1b
"#
}
} else if #[cfg(target_arch = "x86_64")] {
Expand All @@ -160,8 +157,7 @@ cfg_if::cfg_if! {
push rbp
call __rust_entry
1:
jmp 1b
1: jmp 1b
"#
}
} else {
Expand Down
12 changes: 4 additions & 8 deletions crates/sel4-runtime-common/src/start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ cfg_if::cfg_if! {
mov sp, x9
b sel4_runtime_rust_entry
1:
b 1b
1: b 1b
"#
}
} else if #[cfg(target_arch = "riscv64")] {
Expand All @@ -68,17 +67,15 @@ cfg_if::cfg_if! {
# See https://www.sifive.com/blog/all-aboard-part-3-linker-relaxation-in-riscv-toolchain
.option push
.option norelax
1:
auipc gp, %pcrel_hi(__global_pointer$)
1: auipc gp, %pcrel_hi(__global_pointer$)
addi gp, gp, %pcrel_lo(1b)
.option pop
la sp, __sel4_runtime_stack_top
ld sp, (sp)
jal sel4_runtime_rust_entry
1:
j 1b
1: j 1b
"#
}
} else if #[cfg(target_arch = "x86_64")] {
Expand All @@ -97,8 +94,7 @@ cfg_if::cfg_if! {
push rbp
call sel4_runtime_rust_entry
1:
jmp 1b
1: jmp 1b
"#
}
} else {
Expand Down

0 comments on commit af42145

Please sign in to comment.