aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaleem Abdulrasool <abdulras@google.com>2021-05-06 10:26:05 -0700
committerGitHub <noreply@github.com>2021-05-06 10:26:05 -0700
commit23f1834fc628f4093bdd5e322ac828956d185f8d (patch)
tree047c54aba8e36f0ae0c557f5fbde49f7534fdb38
parent114b84ba527e4308724d1a40a3c3733f7324ab86 (diff)
downloadpk-23f1834fc628f4093bdd5e322ac828956d185f8d.zip
pk-23f1834fc628f4093bdd5e322ac828956d185f8d.tar.gz
pk-23f1834fc628f4093bdd5e322ac828956d185f8d.tar.bz2
machine: manually perform assembler relaxation (#244)
This is an equivalent rewrite of the existing code. When building with gas, the `bltu` would implicitly get relaxed to the `bgeu` + `j`. This relaxation is required as the `init_other_hart` is not guaranteed to be addressable in 12-bits. When building with the LLVM IAS instead of gas we fail to link as the branch is not relaxed. This change enables LLVM to build and link this code with the LLVM IAS and lld.
-rw-r--r--machine/mentry.S4
1 files changed, 3 insertions, 1 deletions
diff --git a/machine/mentry.S b/machine/mentry.S
index f9285a4..e71745c 100644
--- a/machine/mentry.S
+++ b/machine/mentry.S
@@ -312,7 +312,9 @@ do_reset:
# make sure our hart id is within a valid range
fence
li a2, MAX_HARTS
- bltu a3, a2, init_other_hart
+ bgeu a3, a2, .Lcont
+ j init_other_hart
+.Lcont:
#endif
wfi
j .LmultiHart