diff options
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 |