summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2021-10-15 22:59:35 +0000
committerCommit Bot <commit-bot@chromium.org>2021-10-18 19:41:59 +0000
commit9229397b613fadac32f025a1be7d6549b2cd6be9 (patch)
treea0a776a17cf183848eed230ee6de44d48d180e1e
parentfc9044a240d5a8767b7b77beda7801c6db45b0df (diff)
downloadchrome-ec-9229397b613fadac32f025a1be7d6549b2cd6be9.tar.gz
core/cortex-m0: Function only used when CONFIG_TASK_PROFILING is defined
When compiling with clang, it warns: core/cortex-m0/task.c:182:19: error: unused function 'get_interrupt_context' [-Werror,-Wunused-function] static inline int get_interrupt_context(void) BRANCH=none BUG=b:172020503 TEST=make buildall -j Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I914a2a8f950a340c570f5d105859a80be3efb82a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3229479 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
-rw-r--r--core/cortex-m0/task.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/cortex-m0/task.c b/core/cortex-m0/task.c
index ee7f9fb8e6..2c1bf2a8c4 100644
--- a/core/cortex-m0/task.c
+++ b/core/cortex-m0/task.c
@@ -179,12 +179,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)
{