aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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}