From 1cde962483ca114553effd835f8ac46427fe1a00 Mon Sep 17 00:00:00 2001
From: Christian Dietrich <christian.dietrich@informatik.uni-erlangen.de>
Date: Tue, 20 Sep 2016 10:09:59 +0200
Subject: [PATCH] patmos: add labels to identify context switch

---
 app/benchmark/timing/copter.cc | 6 ++----
 arch/patmos/tcb.cc             | 8 +++++++-
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/app/benchmark/timing/copter.cc b/app/benchmark/timing/copter.cc
index d9d2803..1663de3 100644
--- a/app/benchmark/timing/copter.cc
+++ b/app/benchmark/timing/copter.cc
@@ -144,13 +144,11 @@ TASK(CopterControlWatchdogTask) {
 void PreIdleHook() {
     static int count = 0;
     kout << "---\n";
+    timing_print();
     if (++count > 5) {
-        if (timing_print() > 0) {
-            ShutdownMachine();
-        }
     }
 
-    if (count == 50) {
+    if (count == 100) {
         timing_dump();
     }
 }
diff --git a/arch/patmos/tcb.cc b/arch/patmos/tcb.cc
index d36949a..e5f0e30 100644
--- a/arch/patmos/tcb.cc
+++ b/arch/patmos/tcb.cc
@@ -56,9 +56,12 @@ void context_load(const TCB *to) {
 	"ret                  \n"
 	"mts $s3 = $r11       \n"
 	"mts $s0 = $r9        \n"
-	"nop"
+ 	"nop"
         : : "r"(to->dynamic_context)
     );
+switch_context_load:
+    (void) && switch_context_load;
+
 }
 
 
@@ -126,6 +129,9 @@ void context_save_and_load(const TCB * from, const TCB *to) {
 	"nop"
         : : "r" (from->dynamic_context), "r"(to->dynamic_context)
     );
+switch_context_save_and_load:
+    (void) && switch_context_save_and_load;
+
 }
 
 void arch::TCB::context_switch(const TCB *from, const TCB* to) {
-- 
GitLab