From 173e46b1ea0305ab74ab8e6a4b4461e296b83922 Mon Sep 17 00:00:00 2001 From: Bjoern Brandenburg Date: Mon, 3 Sep 2012 13:58:18 +0200 Subject: Export IRQ count to control page Also add some compile-time checks to detect unexpected offsets. --- litmus/ctrldev.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'litmus/ctrldev.c') diff --git a/litmus/ctrldev.c b/litmus/ctrldev.c index 9969ab17c190..41919b2714cb 100644 --- a/litmus/ctrldev.c +++ b/litmus/ctrldev.c @@ -133,6 +133,17 @@ static int __init init_litmus_ctrl_dev(void) BUILD_BUG_ON(sizeof(struct control_page) > PAGE_SIZE); + BUILD_BUG_ON(sizeof(union np_flag) != sizeof(uint64_t)); + + BUILD_BUG_ON(offsetof(struct control_page, sched.raw) + != LITMUS_CP_OFFSET_SCHED); + BUILD_BUG_ON(offsetof(struct control_page, irq_count) + != LITMUS_CP_OFFSET_IRQ_COUNT); + BUILD_BUG_ON(offsetof(struct control_page, ts_syscall_start) + != LITMUS_CP_OFFSET_TS_SC_START); + BUILD_BUG_ON(offsetof(struct control_page, irq_syscall_start) + != LITMUS_CP_OFFSET_IRQ_SC_START); + printk("Initializing LITMUS^RT control device.\n"); err = misc_register(&litmus_ctrl_dev); if (err) -- cgit v1.2.2