summaryrefslogtreecommitdiff
path: root/core/minute-ia/switch.S
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2018-12-21 14:59:57 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-01-30 20:41:18 -0800
commit77e81a4a63e3edaaefc110cfa228701ba973aca4 (patch)
tree12e056df65baec9e1f08f6f97dff9a38af5270b9 /core/minute-ia/switch.S
parentb8b8329840d748037e66f1fe967b205637b116e8 (diff)
downloadchrome-ec-77e81a4a63e3edaaefc110cfa228701ba973aca4.tar.gz
ish: fix task profiling
Previously when performing 'taskinfo' command on ISH5, the time spend in exception was very high. The time spent in each task was also negative. The task profiling was broken in many ways. This CL fixes the following: - Added correct exception start and end times through out - Updated exception (isr) start and end time to 32-bit so we don't have issues with 32-bit time rollover - Fixed time spending in task, exception, and IRQ distribution - Fixed code that determines which vector is being serviced. Calculation before was backwards previously. - The IRQ_COUNT for ish was too small so we couldn't correctly profile the IRQ distribution BRANCH=none BUG=b:121343650,b:112750896 TEST='taskinfo' behaves correctly on aracada (ISH5) Change-Id: I643d3133a608865a1862a70585cfeced4d24649d Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1389058 Reviewed-by: Hyungwoo Yang <hyungwoo.yang@intel.com>
Diffstat (limited to 'core/minute-ia/switch.S')
-rw-r--r--core/minute-ia/switch.S19
1 files changed, 16 insertions, 3 deletions
diff --git a/core/minute-ia/switch.S b/core/minute-ia/switch.S
index de76421a57..9391c186e4 100644
--- a/core/minute-ia/switch.S
+++ b/core/minute-ia/switch.S
@@ -9,6 +9,12 @@
#include "registers.h"
#include "task_defs.h"
+#ifdef CONFIG_TASK_PROFILING
+#define task_start_irq_handler_call call task_start_irq_handler
+#else
+#define task_start_irq_handler_call
+#endif
+
.text
.extern current_task
@@ -57,7 +63,7 @@ default_int_handler:
.endfunc
# Switches from one task to another if ready.
-# __schedule triggeres software interrupt ISH_TS_VECTOR, which is handled by
+# __schedule triggers software interrupt ISH_TS_VECTOR, which is handled by
# __switchto
.align 4
.func __switchto
@@ -71,10 +77,17 @@ __switchto:
# triggering ISH_TS_VECTOR
#
# Push %ecx and %edx into stack to pass them as function parameters
- # to switch_handler(desched, resched)
-
+ # to switch_handler(desched, resched). After call, we clean up stack
+ # pointer. Note, we do this now before task_start_irq has a chance
+ # to clobber these caller-saved registers.
push %ecx
push %edx
+
+ # We don't push anything on the stack for start irq since the
+ # parameter is unused.
+ task_start_irq_handler_call
+
+ # Stack is already set up from previous pushes
call switch_handler
addl $0x8, %esp # Clean up stack