diff options
author | Matthew Barth <msbarth@us.ibm.com> | 2011-07-22 09:38:14 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2011-08-08 14:21:57 -0500 |
commit | 6a8d93daac2c006c06aa1d0d9e963e651b9c64b2 (patch) | |
tree | fb7eeb89d0b7b80e64334896973649aab90a2d83 /src/usr | |
parent | 0709fbac11be8a30710a34dad5af5f37449d7255 (diff) | |
download | talos-hostboot-6a8d93daac2c006c06aa1d0d9e963e651b9c64b2.tar.gz talos-hostboot-6a8d93daac2c006c06aa1d0d9e963e651b9c64b2.zip |
Device segment MMIO map & unmap system calls
Change-Id: I233c2677909c0c16536133c189ebbd21e4415e22
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/208
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/testcore/kernel/slbtest.H | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/usr/testcore/kernel/slbtest.H b/src/usr/testcore/kernel/slbtest.H index f773efe2d..65fe3bd08 100644 --- a/src/usr/testcore/kernel/slbtest.H +++ b/src/usr/testcore/kernel/slbtest.H @@ -9,6 +9,7 @@ #include <arch/ppc.H> #include <sys/time.h> #include <sys/task.h> +#include <sys/mmio.h> class slbtest: public CxxTest::TestSuite { @@ -19,6 +20,7 @@ class slbtest: public CxxTest::TestSuite void testSLB() { rc = 0; + printk("Data Segment exception expected in 1TB segment test - "); task_create(writeEA1TB, this); while (rc == 0) task_yield(); task_yield(); @@ -28,6 +30,39 @@ class slbtest: public CxxTest::TestSuite } } + void testDevSeg() + { + int rc = 0; + uint64_t ra = 2*1024*1024; + printk("Map Device @ ra = 0x%lX using mmio_map\n",ra); + uint64_t* virtAddrMMIO = static_cast<uint64_t*> + (mmio_map(reinterpret_cast<void*>(ra), 1)); + if (virtAddrMMIO == NULL) + { + TS_FAIL("Failed to map using mmio_map\n"); + } + printk("Unmap Device @ va = %p using mmio_unmap\n",virtAddrMMIO); + rc = mmio_unmap(reinterpret_cast<void*>(virtAddrMMIO), 1); + if (rc != 0) + { + TS_FAIL("Failed to unmap using mmio_unmap\n"); + } + + printk("Map Device @ ra = 0x%lX using dev_map\n",ra); + uint64_t* virtAddrDEV = static_cast<uint64_t*> + (mmio_dev_map(reinterpret_cast<void*>(ra), THIRTYTWO_GB)); + if (virtAddrDEV == NULL) + { + TS_FAIL("Failed to map using mmio_dev_map\n"); + } + printk("Unmap Device @ va = %p using dev_unmap\n",virtAddrDEV); + rc = mmio_dev_unmap(reinterpret_cast<void*>(virtAddrDEV)); + if (rc != 0) + { + TS_FAIL("Failed to unmap using mmio_dev_unmap\n"); + } + } + private: static void writeEA1TB(void *i_p) |