summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorMatthew Barth <msbarth@us.ibm.com>2011-06-21 14:02:56 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2011-06-24 13:45:56 -0500
commit99d638310adbe9340981ce1fe06c47e6988ab369 (patch)
tree84104b936ae3f9e525b0058547b235240203e28d /src/usr
parentd85739a1ad9e58339f5a58225da2ba5c7476c68b (diff)
downloadtalos-hostboot-99d638310adbe9340981ce1fe06c47e6988ab369.tar.gz
talos-hostboot-99d638310adbe9340981ce1fe06c47e6988ab369.zip
Add device segment to SLB init
Change-Id: Ia0c9bcf4840a31808018f595875d99fa6e282e2f Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/155 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/testcore/kernel/makefile6
-rw-r--r--src/usr/testcore/kernel/slbtest.H64
-rw-r--r--src/usr/testcore/makefile2
3 files changed, 71 insertions, 1 deletions
diff --git a/src/usr/testcore/kernel/makefile b/src/usr/testcore/kernel/makefile
new file mode 100644
index 000000000..cabcacbbe
--- /dev/null
+++ b/src/usr/testcore/kernel/makefile
@@ -0,0 +1,6 @@
+ROOTPATH = ../../../..
+
+MODULE = testkernel
+TESTS = *.H
+
+include ${ROOTPATH}/config.mk
diff --git a/src/usr/testcore/kernel/slbtest.H b/src/usr/testcore/kernel/slbtest.H
new file mode 100644
index 000000000..8784458d0
--- /dev/null
+++ b/src/usr/testcore/kernel/slbtest.H
@@ -0,0 +1,64 @@
+#ifndef __SLBTEST_H
+#define __SLBTEST_H
+/**
+ * @file slbtest.H
+ *
+ * @brief Test cases for the segment lookaside buffers
+*/
+#include <cxxtest/TestSuite.H>
+#include <arch/ppc.H>
+#include <sys/time.h>
+#include <sys/task.h>
+
+class slbtest: public CxxTest::TestSuite
+{
+ public:
+
+ static volatile int rc;
+
+ void testSLB()
+ {
+ rc = 0;
+ task_create(writeEA1TB, this);
+ while (rc == 0) task_yield();
+ task_yield();
+ if (rc == -1)
+ {
+ TS_FAIL("Data Segment exception expected in 1TB segment\n");
+ }
+
+ rc = 0;
+ task_create(writeEA2TB, this);
+ while (rc == 0) task_yield();
+ task_yield();
+ if (rc == -1)
+ {
+ TS_FAIL("Data Storage exception expected in 2TB segment\n");
+ }
+ }
+
+ private:
+
+ static void writeEA1TB(void *i_p)
+ {
+ rc = 1;
+ sync();
+ *(int *)0x10000000000 = 1;
+ sync();
+ rc = -1;
+ task_end();
+ }
+
+ static void writeEA2TB(void *i_p)
+ {
+ rc = 1;
+ sync();
+ *(int *)0x20000000000 = 1;
+ sync();
+ rc = -1;
+ task_end();
+ }
+};
+volatile int slbtest::rc = 0;
+
+#endif
diff --git a/src/usr/testcore/makefile b/src/usr/testcore/makefile
index 1f4881373..0c6cf46dc 100644
--- a/src/usr/testcore/makefile
+++ b/src/usr/testcore/makefile
@@ -1,6 +1,6 @@
ROOTPATH = ../../..
-SUBDIRS = lib.d
+SUBDIRS = lib.d kernel.d
include ${ROOTPATH}/config.mk
OpenPOWER on IntegriCloud