diff options
author | Caveh Jalali <caveh@chromium.org> | 2019-09-25 19:59:34 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-10-02 09:18:59 +0000 |
commit | 270e4248192253d934f0a4d66d6cf67972b68c7f (patch) | |
tree | 2253863bd35dbe6e07f8e6adab5c04ba9c68d69e | |
parent | 626762df070b4a43be1d868b7ed6112955d638cb (diff) | |
download | chrome-ec-270e4248192253d934f0a4d66d6cf67972b68c7f.tar.gz |
cortex-m0: add __gnu_thumb1_case_si thumb1 helper
we were missing the __gnu_thumb1_case_si helper function on cortex-m0.
i'm assuming this is needed for huge switch statements and we've
gotten "lucky" so far.
BUG=b:141655831
BRANCH=none
TEST=make buildall passes
Change-Id: Ie4c7d991b37ac40de89634b88b085bb84498ab1a
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1826284
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Yilun Lin <yllin@chromium.org>
-rw-r--r-- | core/cortex-m0/thumb_case.S | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/core/cortex-m0/thumb_case.S b/core/cortex-m0/thumb_case.S index 6c5fc54b1c..5628361a94 100644 --- a/core/cortex-m0/thumb_case.S +++ b/core/cortex-m0/thumb_case.S @@ -64,7 +64,6 @@ __gnu_thumb1_case_uhi: pop {r0, r1} bx lr - .section .text.__gnu_thumb1_case_shi .global __gnu_thumb1_case_shi .thumb_func @@ -79,3 +78,19 @@ __gnu_thumb1_case_shi: add lr, lr, r1 pop {r0, r1} bx lr + +.section .text.__gnu_thumb1_case_si +.global __gnu_thumb1_case_si +.thumb_func +__gnu_thumb1_case_si: + push {r0, r1} + mov r1, lr + adds.n r1, r1, #2 + lsrs r1, r1, #2 + lsls r0, r0, #2 + lsls r1, r1, #2 + ldr r0, [r1, r0] + adds r0, r0, r1 + mov lr, r0 + pop {r0, r1} + mov pc, lr |