[LITMUS^RT] preparing a new release
Björn Brandenburg
bbb at mpi-sws.org
Fri Dec 7 04:23:32 CET 2012
On Dec 5, 2012, at 5:10 PM, Christopher Kenna <cjk at cs.unc.edu> wrote:
> On Tue, Nov 27, 2012 at 2:02 PM, Björn Brandenburg <bbb at mpi-sws.org> wrote:
>>
>> 1) Everyone, please test the current staging branch.
>
> I can't compile liblitmus against staging now. LITMUS^RT commit 173e46
> expanded the "union np_flag" in rt_param.h to 64 bits, but the
> corresponding userland build-bug check in
> liblitmus/src/kernel_iface.c:85 [1] was not updated to reflect this
> change. It's a simple fix, but I want to make sure I've actually got
> the latest version of liblitmus. Is there something that I'm missing,
> or changes that were not pushed?
>
> [1] https://github.com/LITMUS-RT/liblitmus/blob/staging/src/kernel_iface.c#L85
Thanks for catching this. I forgot to merge the proper patch. See below.
Thanks,
Björn
commit 93e9d420554ed60cb3fa9fa47d3e97b33556b276
Author: Bjoern Brandenburg <bbb at mpi-sws.org>
Date: Mon Sep 3 14:01:12 2012 +0200
Add control page offset checks
Make sure the kernel and userspace compilers have the same idea of the
layout of the control page.
diff --git a/include/internal.h b/include/internal.h
index 747f095..035440b 100644
--- a/include/internal.h
+++ b/include/internal.h
@@ -23,6 +23,8 @@ int __launch_rt_task(rt_fn_t rt_prog, void *rt_arg,
#define likely(x) __builtin_expect((x), 1)
#define unlikely(x) __builtin_expect((x), 0)
+#define offsetof(s, x) __builtin_offsetof(s, x)
+
#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
#define BUILD_BUG_ON(condition) ((void)BUILD_BUG_ON_ZERO(condition))
diff --git a/src/kernel_iface.c b/src/kernel_iface.c
index b9c8f59..4cc1af5 100644
--- a/src/kernel_iface.c
+++ b/src/kernel_iface.c
@@ -82,7 +82,16 @@ int init_kernel_iface(void)
int err = 0;
long page_size = sysconf(_SC_PAGESIZE);
- BUILD_BUG_ON(sizeof(union np_flag) != sizeof(uint32_t));
+ 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);
err = map_file(LITMUS_CTRL_DEVICE, (void**) &ctrl_page, CTRL_PAGES * page_size);
if (err) {
More information about the litmus-dev
mailing list