diff options
author | Matthew Barth <msbarth@us.ibm.com> | 2011-06-21 14:02:56 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2011-06-24 13:45:56 -0500 |
commit | 99d638310adbe9340981ce1fe06c47e6988ab369 (patch) | |
tree | 84104b936ae3f9e525b0058547b235240203e28d /src | |
parent | d85739a1ad9e58339f5a58225da2ba5c7476c68b (diff) | |
download | blackbird-hostboot-99d638310adbe9340981ce1fe06c47e6988ab369.tar.gz blackbird-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')
-rw-r--r-- | src/kernel/vmmmgr.C | 7 | ||||
-rw-r--r-- | src/makefile | 2 | ||||
-rw-r--r-- | src/usr/testcore/kernel/makefile | 6 | ||||
-rw-r--r-- | src/usr/testcore/kernel/slbtest.H | 64 | ||||
-rw-r--r-- | src/usr/testcore/makefile | 2 |
5 files changed, 79 insertions, 2 deletions
diff --git a/src/kernel/vmmmgr.C b/src/kernel/vmmmgr.C index 34806a19b..0fce50b7e 100644 --- a/src/kernel/vmmmgr.C +++ b/src/kernel/vmmmgr.C @@ -57,6 +57,13 @@ void VmmManager::initSLB() asm volatile("slbia" ::: "memory"); asm volatile("isync" ::: "memory"); asm volatile("slbmte %0, %1" :: "r"(slbRS), "r"(slbRB) : "memory"); + + // ESID = 2TB, V = 1, Index = 3 + slbRB = 0x0000020008000003; + // B = 01 (1TB), VSID = 2TB, Ks = 0, Kp = 1, NLCLP = 0 + slbRS = 0x4000020000000400; + + asm volatile("slbmte %0, %1" :: "r"(slbRS), "r"(slbRB) : "memory"); asm volatile("isync" ::: "memory"); } diff --git a/src/makefile b/src/makefile index c86f33ea5..b5c6947fb 100644 --- a/src/makefile +++ b/src/makefile @@ -20,7 +20,7 @@ EXTENDED_MODULES = targeting DIRECT_BOOT_MODULES = example RUNTIME_MODULES = TESTCASE_MODULES = cxxtest testerrl testdevicefw testsyslib \ - testscom testxscom testtargeting testinitservice + testscom testxscom testtargeting testinitservice testkernel RELOCATABLE_IMAGE_LDFLAGS = -pie --export-dynamic 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 |