From 7d5bd0af1e24372582c30f3ae3574b28db54505d Mon Sep 17 00:00:00 2001
From: David Li
Date: Thu, 14 Jan 2016 15:57:20 -0700
Subject: Add example of hitting a trap
---
devkit/cacheracer.h | 6 ++++++
devkit/masochist.c | 5 +----
2 files changed, 7 insertions(+), 4 deletions(-)
(limited to 'devkit')
diff --git a/devkit/cacheracer.h b/devkit/cacheracer.h
index 7e9aa8c..b9b4895 100644
--- a/devkit/cacheracer.h
+++ b/devkit/cacheracer.h
@@ -39,6 +39,12 @@ void __start(int core_id, unsigned char payload);
#define CACHE_NUM_BLOCKS 2
+/** Traps
+ */
+
+#define WRITE_TRAP 0xE0
+#define AREA_TRAP 0xE4
+
/** Definitions of global data */
#define TAUNT_SIZE 228
diff --git a/devkit/masochist.c b/devkit/masochist.c
index ddd6018..a1dc18c 100644
--- a/devkit/masochist.c
+++ b/devkit/masochist.c
@@ -1,11 +1,8 @@
#include "cacheracer.h"
void __start(int core_id, unsigned char payload) {
- volatile int *ptr = (volatile int*) HOME_DATA;
+ volatile char *ptr = (volatile char*) HOME_DATA;
while (1) {
ptr[0] = WRITE_TRAP;
- ptr[1] = WRITE_TRAP;
- ptr[0] = 0;
- ptr[1] = 0;
}
}
--
cgit v1.2.3