From 3740f63a46e1a7fa328a157d25f11e3d307cde13 Mon Sep 17 00:00:00 2001 From: Bjoern Brandenburg Date: Mon, 25 Jun 2012 09:24:22 +0200 Subject: New test: /dev/litmus/ctrl must be writable Under any plugin, the control page should be mappable and writable. --- tests/core_api.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests') 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, ASSERT(WEXITSTATUS(status) == 0); } } + +TESTCASE(ctrl_page_writable, ALL, + "tasks have write access to /dev/litmus/ctrl mappings") +{ + volatile int *ctrl_page = (volatile int*) get_ctrl_page(); + + /* init_litmus() should have mapped the page already */ + ASSERT(ctrl_page != NULL); + + /* These should work without page faults. */ + enter_np(); + exit_np(); + + /* Try poking the memory directly. */ + + ctrl_page[32] = 0x12345678; +} -- cgit v1.2.2