summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@google.com>2018-05-29 22:44:35 +0200
committerCommit Bot <commit-bot@chromium.org>2019-05-24 01:34:34 +0000
commit198526b0d0507d6961731d8704ce5a4db59d5451 (patch)
treee4995fc41af045b368a66f10bf54c222846f9fac
parent2033032d9b49dda2238fd15917c10c9ba8f7385d (diff)
downloadchrome-ec-198526b0d0507d6961731d8704ce5a4db59d5451.tar.gz
nds32: make code build with gcc 8.1
*** 21744 bytes still available in flash on reef_it8320 **** BUG=b:65441143 BRANCH=none TEST=make BOARD=reef_it8320 builds with gcc 8.1. not tested at all Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/1077207 Commit-Ready: Patrick Georgi <pgeorgi@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Change-Id: Ie79ee23452574fd883c7f9425b8614346e46fdd7 Reviewed-by: Stefan Reinauer <reinauer@google.com> Signed-off-by: Gwendal Grignou <gwenal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1621260 Reviewed-by: Patrick Georgi <pgeorgi@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Gwendal Grignou <gwendal@chromium.org>
-rw-r--r--core/nds32/abort.S26
-rw-r--r--core/nds32/build.mk3
2 files changed, 29 insertions, 0 deletions
diff --git a/core/nds32/abort.S b/core/nds32/abort.S
new file mode 100644
index 0000000000..d7474812af
--- /dev/null
+++ b/core/nds32/abort.S
@@ -0,0 +1,26 @@
+/* Copyright 2018 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ *
+ * abort() handler
+ */
+
+#include "config.h"
+#define PSW_INTL_SHIFT 1 /* Interrupt Stack Level */
+#define PSW_INTL_MASK (0x3 << PSW_INTL_SHIFT)
+
+.text
+
+.global abort
+abort:
+ movi55 $r6, 3 // assert
+ movi55 $r7, 0 // no info. doubles for the equality test below
+
+ // in interrupt context -> $r5 != 0
+ mfsr $r5, $PSW
+ andi $r5, $r5, PSW_INTL_MASK
+
+ beq $r5, $r7, .L1
+ j excep_handler
+.L1:
+ break 0
diff --git a/core/nds32/build.mk b/core/nds32/build.mk
index db2a52d1b1..6043ef9831 100644
--- a/core/nds32/build.mk
+++ b/core/nds32/build.mk
@@ -20,5 +20,8 @@ CFLAGS_CPU+=-flto
LDFLAGS_EXTRA+=-flto
endif
+LDFLAGS_EXTRA+=-Wl,--relax
+
core-y=cpu.o init.o panic.o task.o switch.o __muldi3.o math.o __builtin.o
+core-y+=abort.o
core-$(CONFIG_FPU)+=__libsoftfpu.o