summaryrefslogtreecommitdiff
path: root/core/cortex-m
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2019-06-14 09:43:39 -0700
committerCommit Bot <commit-bot@chromium.org>2019-06-15 02:50:39 +0000
commit9c0e1fb1484fbe52bf60ea344e8a8dbd7ae08f5e (patch)
treef1e7e70989b49146d39fefb3bf616159b2a93ef0 /core/cortex-m
parent30eeccc3523285238837321efb4a506b5eb54e0d (diff)
downloadchrome-ec-9c0e1fb1484fbe52bf60ea344e8a8dbd7ae08f5e.tar.gz
core/cortex-m: get_interrupt_context is only used inside CONFIG_TASK_PROFILING
get_interrupt_context is only called from code inside #ifdef CONFIG_TASK_PROFILING. clang emits an unused function warning for this: core/cortex-m/task.c:238:19: error: unused function 'get_interrupt_context' [-Werror,-Wunused-function] static inline int get_interrupt_context(void) BRANCH=none BUG=chromium:931797 TEST=make buildall -j Change-Id: I5ba68d1a58a966eeecb5abdb3cb87fa2684f359b Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1660017 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'core/cortex-m')
-rw-r--r--core/cortex-m/task.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/cortex-m/task.c b/core/cortex-m/task.c
index 91d0d56d90..159bd78097 100644
--- a/core/cortex-m/task.c
+++ b/core/cortex-m/task.c
@@ -235,12 +235,14 @@ inline int in_interrupt_context(void)
return ret;
}
+#ifdef CONFIG_TASK_PROFILING
static inline int get_interrupt_context(void)
{
int ret;
asm("mrs %0, ipsr \n":"=r"(ret)); /* read exception number */
return ret & 0x1ff; /* exception bits are the 9 LSB */
}
+#endif
task_id_t task_get_current(void)
{