aboutsummaryrefslogtreecommitdiff
path: root/devkit
diff options
context:
space:
mode:
authorDavid Li <li.davidm96@gmail.com>2016-01-14 15:57:20 -0700
committerDavid Li <li.davidm96@gmail.com>2016-01-14 15:57:20 -0700
commit7d5bd0af1e24372582c30f3ae3574b28db54505d (patch)
tree9c43d069551716855db9bcc53c51f03852103421 /devkit
parent5600ebffdf12117d398476f93897a8cc289eb468 (diff)
Add example of hitting a trap
Diffstat (limited to 'devkit')
-rw-r--r--devkit/cacheracer.h6
-rw-r--r--devkit/masochist.c5
2 files changed, 7 insertions, 4 deletions
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;
}
}