Module: xenomai-forge
Branch: next
Commit: 2da16e9ae5966a1a5b32956b83e673846135d5d3
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=2da16e9ae5966a1a5b32956b83e673846135d5d3

Author: Philippe Gerum <r...@xenomai.org>
Date:   Tue Sep  2 12:43:19 2014 +0200

cobalt/uapi: make cobalt_monitor 32/64bit-neutral

---

 include/cobalt/uapi/monitor.h |    8 +++++---
 kernel/cobalt/posix/monitor.c |    3 ++-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/include/cobalt/uapi/monitor.h b/include/cobalt/uapi/monitor.h
index 768b72e..07d2ebe 100644
--- a/include/cobalt/uapi/monitor.h
+++ b/include/cobalt/uapi/monitor.h
@@ -18,9 +18,11 @@
 #ifndef _COBALT_UAPI_MONITOR_H
 #define _COBALT_UAPI_MONITOR_H
 
+#include <cobalt/uapi/kernel/types.h>
+
 struct cobalt_monitor_data {
        atomic_t owner;
-       unsigned long flags;
+       __u32 flags;
 #define COBALT_MONITOR_GRANTED    0x01
 #define COBALT_MONITOR_DRAINED    0x02
 #define COBALT_MONITOR_SIGNALED   0x03 /* i.e. GRANTED or DRAINED */
@@ -34,9 +36,9 @@ struct cobalt_monitor_shadow {
        xnhandle_t handle;
        union {
                struct cobalt_monitor_data *data;
-               unsigned int data_offset;
+               __u32 data_offset;
        } u;
-       int flags;
+       __u32 flags;
 #define COBALT_MONITOR_SHARED     0x1
 #define COBALT_MONITOR_WAITGRANT  0x0
 #define COBALT_MONITOR_WAITDRAIN  0x1
diff --git a/kernel/cobalt/posix/monitor.c b/kernel/cobalt/posix/monitor.c
index 63ab7a7..7ff03e1 100644
--- a/kernel/cobalt/posix/monitor.c
+++ b/kernel/cobalt/posix/monitor.c
@@ -101,9 +101,10 @@ COBALT_SYSCALL(monitor_init, current,
 
        datp->flags = 0;
        datoff = xnheap_mapped_offset(heap, datp);
+       XENO_BUGON(COBALT, datoff != (__u32)datoff);
        shadow.flags = flags;
        shadow.handle = mon->handle;
-       shadow.u.data_offset = datoff;
+       shadow.u.data_offset = (__u32)datoff;
 
        return __xn_safe_copy_to_user(u_mon, &shadow, sizeof(*u_mon));
 }


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to