aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2012-06-25 03:24:22 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2012-07-23 06:02:33 -0400
commit3740f63a46e1a7fa328a157d25f11e3d307cde13 (patch)
tree991b772e098a93ea73fb7d415b57e9b860924d41
parent0468289e9210179f5c2bf148ec57305c33032ed1 (diff)
New test: /dev/litmus/ctrl must be writable
Under any plugin, the control page should be mappable and writable.
-rw-r--r--tests/core_api.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/core_api.c b/tests/core_api.c
index 33c6217..533fb8e 100644
--- a/tests/core_api.c
+++ b/tests/core_api.c
@@ -141,3 +141,20 @@ TESTCASE(rt_fork_non_rt, LITMUS,
141 ASSERT(WEXITSTATUS(status) == 0); 141 ASSERT(WEXITSTATUS(status) == 0);
142 } 142 }
143} 143}
144
145TESTCASE(ctrl_page_writable, ALL,
146 "tasks have write access to /dev/litmus/ctrl mappings")
147{
148 volatile int *ctrl_page = (volatile int*) get_ctrl_page();
149
150 /* init_litmus() should have mapped the page already */
151 ASSERT(ctrl_page != NULL);
152
153 /* These should work without page faults. */
154 enter_np();
155 exit_np();
156
157 /* Try poking the memory directly. */
158
159 ctrl_page[32] = 0x12345678;
160}