[Xenomai-git] Philippe Gerum : cobalt/kernel: increase default size of UMM areas to 64k

2015-06-01 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: f0c2bc8564de83ca102de745df184dffae83b8d3
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=f0c2bc8564de83ca102de745df184dffae83b8d3

Author: Philippe Gerum r...@xenomai.org
Date:   Fri May 29 09:22:43 2015 +0200

cobalt/kernel: increase default size of UMM areas to 64k

Copperplate-based applications may create significantly more mutexes
and condvars internally than pure POSIX ones. Increase the default
size suggested for the UMM areas those objects are allocated from.

---

 kernel/cobalt/Kconfig |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/cobalt/Kconfig b/kernel/cobalt/Kconfig
index 9c754f5..27b4a4a 100644
--- a/kernel/cobalt/Kconfig
+++ b/kernel/cobalt/Kconfig
@@ -284,7 +284,7 @@ config XENO_OPT_SYS_HEAPSZ
 
 config XENO_OPT_PRIVATE_HEAPSZ
int Size of private heap (Kb)
-   default 32
+   default 64
help
 
The Cobalt kernel implements fast IPC mechanisms within the
@@ -293,11 +293,11 @@ config XENO_OPT_PRIVATE_HEAPSZ
process. This option can be used to set the size of this
per-process heap.
 
-   32k is considered a large enough size for common use cases.
+   64k is considered a large enough size for common use cases.
 
 config XENO_OPT_SHARED_HEAPSZ
int Size of shared heap (Kb)
-   default 32
+   default 64
help
 
The Cobalt kernel implements fast IPC mechanisms between
@@ -306,7 +306,7 @@ config XENO_OPT_SHARED_HEAPSZ
processes. This option can be used to set the size of this
system-wide heap.
 
-   32k is considered a large enough size for common use cases.
+   64k is considered a large enough size for common use cases.
 
 config XENO_OPT_NRTIMERS
int Maximum number of POSIX timers per process


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


[Xenomai-git] Philippe Gerum : copperplate/heapobj: fix build issue

2015-06-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 22a230ddbf874ed289b6c4606c5851193b422164
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=22a230ddbf874ed289b6c4606c5851193b422164

Author: Philippe Gerum r...@xenomai.org
Date:   Mon Jun  1 13:35:34 2015 +0200

copperplate/heapobj: fix build issue

---

 lib/copperplate/cluster.c|   16 ++--
 lib/copperplate/heapobj-malloc.c |1 +
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/lib/copperplate/cluster.c b/lib/copperplate/cluster.c
index 7353aa8..b19d1c8 100644
--- a/lib/copperplate/cluster.c
+++ b/lib/copperplate/cluster.c
@@ -91,6 +91,7 @@
 #include errno.h
 #include string.h
 #include memory.h
+#include stdio.h
 #include copperplate/heapobj.h
 #include copperplate/cluster.h
 #include copperplate/syncobj.h
@@ -257,6 +258,7 @@ redo:
if (hobj) {
d = container_of(hobj, struct syndictionary, hobj);
ret = 0;
+   printf(existing cluster %s found at %p\n, name, sc);
goto out;
}
 
@@ -277,6 +279,7 @@ redo:
xnfree(d);
goto redo;
}
+   printf(new cluster %s at %p\n, name, sc);
 out:
sc-d = d;
 
@@ -299,19 +302,25 @@ int syncluster_addobj(struct syncluster *sc, const char 
*name,
 
ret = hash_enter_probe(sc-d-table, name, strlen(name),
   cobj-hobj, hash_operations);
+   printf(entering object %s = %d\n, name, ret);
if (ret)
goto out;
 
-   if (!syncobj_grant_wait_p(sc-d-sobj))
+   if (!syncobj_grant_wait_p(sc-d-sobj)) {
+   printf(no waiter on cluster %Zu\n,
+  mainheap_ref(sc-d-sobj, uintptr_t));
goto out;
+   }
/*
 * Wake up all threads waiting for this key to appear in the
 * dictionary.
 */
syncobj_for_each_grant_waiter_safe(sc-d-sobj, thobj, tmp) {
wait = threadobj_get_wait(thobj);
-   if (*wait-name == *name  strcmp(wait-name, name) == 0)
+   if (*wait-name == *name  strcmp(wait-name, name) == 0) {
+   printf(signaling %s\n, thobj-name);
syncobj_grant_to(sc-d-sobj, thobj);
+   }
}
 out:
syncobj_unlock(sc-d-sobj, syns);
@@ -368,7 +377,10 @@ int syncluster_findobj(struct syncluster *sc,
wait = threadobj_prepare_wait(struct 
syncluster_wait_struct);
wait-name = name;
}
+   printf((waiting for %s to show up on cluster sobj %Zu)\n, 
name,
+  mainheap_ref(sc-d-sobj, uintptr_t));
ret = syncobj_wait_grant(sc-d-sobj, timeout, syns);
+   printf((back from wait %d)\n, ret);
if (ret) {
if (ret == -EIDRM)
goto out;
diff --git a/lib/copperplate/heapobj-malloc.c b/lib/copperplate/heapobj-malloc.c
index 60894eb..b77cf09 100644
--- a/lib/copperplate/heapobj-malloc.c
+++ b/lib/copperplate/heapobj-malloc.c
@@ -110,6 +110,7 @@ void *pvheapobj_alloc(struct heapobj *hobj, size_t size)
 {
struct pool_header *ph = hobj-pool;
struct block_header *bh;
+   void *ptr;
 
write_lock(ph-lock);
 


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


[Xenomai-git] Philippe Gerum : cobalt/synch: restrict imbalance signal to debug mode

2015-06-01 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: c8894bc29d13a816979fad642760b48f77bcd0cc
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=c8894bc29d13a816979fad642760b48f77bcd0cc

Author: Philippe Gerum r...@xenomai.org
Date:   Mon May 25 10:41:15 2015 +0200

cobalt/synch: restrict imbalance signal to debug mode

---

 include/cobalt/kernel/thread.h |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/cobalt/kernel/thread.h b/include/cobalt/kernel/thread.h
index 335f2e1..6f6fad8 100644
--- a/include/cobalt/kernel/thread.h
+++ b/include/cobalt/kernel/thread.h
@@ -489,8 +489,9 @@ static inline int xnthread_put_resource(struct xnthread 
*thread)
 {
if (xnthread_test_state(thread, XNWEAK|XNDEBUG)) {
if (unlikely(thread-res_count == 0)) {
-   xnthread_signal(thread, SIGDEBUG,
-   SIGDEBUG_RESCNT_IMBALANCE);
+   if (IS_ENABLED(CONFIG_XENO_OPT_DEBUG_USER))
+   xnthread_signal(thread, SIGDEBUG,
+   SIGDEBUG_RESCNT_IMBALANCE);
return -EPERM;
}
thread-res_count--;


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


[Xenomai-git] Philippe Gerum : copperplate/heapobj: fix build issue

2015-06-01 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: 22a230ddbf874ed289b6c4606c5851193b422164
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=22a230ddbf874ed289b6c4606c5851193b422164

Author: Philippe Gerum r...@xenomai.org
Date:   Mon Jun  1 13:35:34 2015 +0200

copperplate/heapobj: fix build issue

---

 lib/copperplate/cluster.c|   16 ++--
 lib/copperplate/heapobj-malloc.c |1 +
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/lib/copperplate/cluster.c b/lib/copperplate/cluster.c
index 7353aa8..b19d1c8 100644
--- a/lib/copperplate/cluster.c
+++ b/lib/copperplate/cluster.c
@@ -91,6 +91,7 @@
 #include errno.h
 #include string.h
 #include memory.h
+#include stdio.h
 #include copperplate/heapobj.h
 #include copperplate/cluster.h
 #include copperplate/syncobj.h
@@ -257,6 +258,7 @@ redo:
if (hobj) {
d = container_of(hobj, struct syndictionary, hobj);
ret = 0;
+   printf(existing cluster %s found at %p\n, name, sc);
goto out;
}
 
@@ -277,6 +279,7 @@ redo:
xnfree(d);
goto redo;
}
+   printf(new cluster %s at %p\n, name, sc);
 out:
sc-d = d;
 
@@ -299,19 +302,25 @@ int syncluster_addobj(struct syncluster *sc, const char 
*name,
 
ret = hash_enter_probe(sc-d-table, name, strlen(name),
   cobj-hobj, hash_operations);
+   printf(entering object %s = %d\n, name, ret);
if (ret)
goto out;
 
-   if (!syncobj_grant_wait_p(sc-d-sobj))
+   if (!syncobj_grant_wait_p(sc-d-sobj)) {
+   printf(no waiter on cluster %Zu\n,
+  mainheap_ref(sc-d-sobj, uintptr_t));
goto out;
+   }
/*
 * Wake up all threads waiting for this key to appear in the
 * dictionary.
 */
syncobj_for_each_grant_waiter_safe(sc-d-sobj, thobj, tmp) {
wait = threadobj_get_wait(thobj);
-   if (*wait-name == *name  strcmp(wait-name, name) == 0)
+   if (*wait-name == *name  strcmp(wait-name, name) == 0) {
+   printf(signaling %s\n, thobj-name);
syncobj_grant_to(sc-d-sobj, thobj);
+   }
}
 out:
syncobj_unlock(sc-d-sobj, syns);
@@ -368,7 +377,10 @@ int syncluster_findobj(struct syncluster *sc,
wait = threadobj_prepare_wait(struct 
syncluster_wait_struct);
wait-name = name;
}
+   printf((waiting for %s to show up on cluster sobj %Zu)\n, 
name,
+  mainheap_ref(sc-d-sobj, uintptr_t));
ret = syncobj_wait_grant(sc-d-sobj, timeout, syns);
+   printf((back from wait %d)\n, ret);
if (ret) {
if (ret == -EIDRM)
goto out;
diff --git a/lib/copperplate/heapobj-malloc.c b/lib/copperplate/heapobj-malloc.c
index 60894eb..b77cf09 100644
--- a/lib/copperplate/heapobj-malloc.c
+++ b/lib/copperplate/heapobj-malloc.c
@@ -110,6 +110,7 @@ void *pvheapobj_alloc(struct heapobj *hobj, size_t size)
 {
struct pool_header *ph = hobj-pool;
struct block_header *bh;
+   void *ptr;
 
write_lock(ph-lock);
 


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


[Xenomai-git] Philippe Gerum : copperplate/heapobj: fix build issue

2015-06-01 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: 2f7cf7e116968d13bf20bddf233ed813ef0d9c13
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=2f7cf7e116968d13bf20bddf233ed813ef0d9c13

Author: Philippe Gerum r...@xenomai.org
Date:   Mon Jun  1 13:39:44 2015 +0200

copperplate/heapobj: fix build issue

---

 lib/copperplate/heapobj-malloc.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/copperplate/heapobj-malloc.c b/lib/copperplate/heapobj-malloc.c
index 60894eb..b77cf09 100644
--- a/lib/copperplate/heapobj-malloc.c
+++ b/lib/copperplate/heapobj-malloc.c
@@ -110,6 +110,7 @@ void *pvheapobj_alloc(struct heapobj *hobj, size_t size)
 {
struct pool_header *ph = hobj-pool;
struct block_header *bh;
+   void *ptr;
 
write_lock(ph-lock);
 


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


[Xenomai-git] Philippe Gerum : copperplate/heapobj: fix build issue

2015-06-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 2f7cf7e116968d13bf20bddf233ed813ef0d9c13
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=2f7cf7e116968d13bf20bddf233ed813ef0d9c13

Author: Philippe Gerum r...@xenomai.org
Date:   Mon Jun  1 13:39:44 2015 +0200

copperplate/heapobj: fix build issue

---

 lib/copperplate/heapobj-malloc.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/copperplate/heapobj-malloc.c b/lib/copperplate/heapobj-malloc.c
index 60894eb..b77cf09 100644
--- a/lib/copperplate/heapobj-malloc.c
+++ b/lib/copperplate/heapobj-malloc.c
@@ -110,6 +110,7 @@ void *pvheapobj_alloc(struct heapobj *hobj, size_t size)
 {
struct pool_header *ph = hobj-pool;
struct block_header *bh;
+   void *ptr;
 
write_lock(ph-lock);
 


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


[Xenomai-git] Philippe Gerum : alchemy/task: fix for pshared mode

2015-06-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 5a8419295dbc562eb4b3c5ef054e38a94a1f3933
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=5a8419295dbc562eb4b3c5ef054e38a94a1f3933

Author: Philippe Gerum r...@xenomai.org
Date:   Mon Jun  1 17:33:56 2015 +0200

alchemy/task: fix for pshared mode

---

 include/alchemy/task.h |2 +-
 lib/alchemy/task.c |6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/alchemy/task.h b/include/alchemy/task.h
index cc3e3c0..c3e8671 100644
--- a/include/alchemy/task.h
+++ b/include/alchemy/task.h
@@ -52,7 +52,7 @@ typedef struct RT_TASK RT_TASK;
 struct RT_TASK_MCB {
int flowid;
int opcode;
-   void *data;
+   dref_type(void *) data;
ssize_t size;
 };
 
diff --git a/lib/alchemy/task.c b/lib/alchemy/task.c
index 327e916..0fc1c33 100644
--- a/lib/alchemy/task.c
+++ b/lib/alchemy/task.c
@@ -1746,7 +1746,7 @@ ssize_t rt_task_send_timed(RT_TASK *task,
wait-reply.data = mcb_r-data;
wait-reply.size = mcb_r-size;
} else {
-   wait-reply.data = NULL;
+   wait-reply.data = __moff(NULL);
wait-reply.size = 0;
}
 
@@ -1904,7 +1904,7 @@ int rt_task_receive_timed(RT_TASK_MCB *mcb_r,
}
 
if (mcb_s-size  0)
-   memcpy(mcb_r-data, mcb_s-data, mcb_s-size);
+   memcpy(__mptr(mcb_r-data), __mptr(mcb_s-data), mcb_s-size);
 
/* The flow identifier is always strictly positive. */
ret = mcb_s-flowid;
@@ -2030,7 +2030,7 @@ int rt_task_reply(int flowid, RT_TASK_MCB *mcb_s)
ret = 0;
mcb_r-size = size;
if (size  0)
-   memcpy(mcb_r-data, mcb_s-data, size);
+   memcpy(__mptr(mcb_r-data), __mptr(mcb_s-data), size);
}
 
mcb_r-flowid = flowid;


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


[Xenomai-git] Philippe Gerum : psos/rn: fix for pshared mode

2015-06-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 839f84c121fd2ef2140e4bd87c14e95af57a1b37
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=839f84c121fd2ef2140e4bd87c14e95af57a1b37

Author: Philippe Gerum r...@xenomai.org
Date:   Mon Jun  1 17:29:59 2015 +0200

psos/rn: fix for pshared mode

---

 lib/psos/rn.c |6 +++---
 lib/psos/rn.h |2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/psos/rn.c b/lib/psos/rn.c
index e665b33..f87e19e 100644
--- a/lib/psos/rn.c
+++ b/lib/psos/rn.c
@@ -264,7 +264,7 @@ starve:
timespec = NULL;
 
wait = threadobj_prepare_wait(struct psos_rn_wait);
-   wait-ptr = NULL;
+   wait-ptr = __moff(NULL);
wait-size = size;
 
ret = syncobj_wait_grant(rn-sobj, timespec, syns);
@@ -279,7 +279,7 @@ starve:
goto out;
}
 
-   *segaddr = wait-ptr;
+   *segaddr = __mptr(wait-ptr);
 done:
syncobj_unlock(rn-sobj, syns);
 out:
@@ -329,7 +329,7 @@ u_long rn_retseg(u_long rnid, void *segaddr)
if (seg) {
rn-busynr++;
rn-usedmem += heapobj_validate(rn-hobj, seg);
-   wait-ptr = seg;
+   wait-ptr = __moff(seg);
syncobj_grant_to(rn-sobj, thobj);
}
}
diff --git a/lib/psos/rn.h b/lib/psos/rn.h
index 43dd7a1..1a026a0 100644
--- a/lib/psos/rn.h
+++ b/lib/psos/rn.h
@@ -41,7 +41,7 @@ struct psos_rn {
 
 struct psos_rn_wait {
size_t size;
-   void *ptr;
+   dref_type(void *) ptr;
 };
 
 extern struct pvcluster psos_rn_table;


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


[Xenomai-git] Philippe Gerum : psos/queue: fix for pshared mode

2015-06-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: dbd55fc1296f04cb8e229f2879fb5a07d106ec32
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=dbd55fc1296f04cb8e229f2879fb5a07d106ec32

Author: Philippe Gerum r...@xenomai.org
Date:   Mon Jun  1 17:29:52 2015 +0200

psos/queue: fix for pshared mode

---

 lib/psos/queue.c |4 ++--
 lib/psos/queue.h |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/psos/queue.c b/lib/psos/queue.c
index c3a27ae..42d0130 100644
--- a/lib/psos/queue.c
+++ b/lib/psos/queue.c
@@ -258,7 +258,7 @@ static u_long __q_send_inner(struct psos_queue *q, unsigned 
long flags,
if (bytes  maxbytes)
bytes = maxbytes;
if (bytes  0)
-   memcpy(wait-ptr, buffer, bytes);
+   memcpy(__mptr(wait-ptr), buffer, bytes);
wait-size = bytes;
goto done;
}
@@ -462,7 +462,7 @@ retry:
timespec = NULL;
 
wait = threadobj_prepare_wait(struct psos_queue_wait);
-   wait-ptr = buffer;
+   wait-ptr = __moff(buffer);
wait-size = msglen;
 
ret = syncobj_wait_grant(q-sobj, timespec, syns);
diff --git a/lib/psos/queue.h b/lib/psos/queue.h
index 0493a8a..4ca4389 100644
--- a/lib/psos/queue.h
+++ b/lib/psos/queue.h
@@ -43,7 +43,7 @@ struct psos_queue {
 
 struct psos_queue_wait {
size_t size;
-   void *ptr;
+   dref_type(void *) ptr;
 };
 
 extern struct cluster psos_queue_table;


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


[Xenomai-git] Philippe Gerum : vxworks/queue: fix for pshared mode

2015-06-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 3dcf37c47f6624dbee6c03a446a51a1eb79775bf
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=3dcf37c47f6624dbee6c03a446a51a1eb79775bf

Author: Philippe Gerum r...@xenomai.org
Date:   Mon Jun  1 17:31:28 2015 +0200

vxworks/queue: fix for pshared mode

---

 lib/vxworks/msgQLib.c |4 ++--
 lib/vxworks/msgQLib.h |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/vxworks/msgQLib.c b/lib/vxworks/msgQLib.c
index 087dbf6..aa0b71c 100644
--- a/lib/vxworks/msgQLib.c
+++ b/lib/vxworks/msgQLib.c
@@ -219,7 +219,7 @@ retry:
timespec = NULL;
 
wait = threadobj_prepare_wait(struct wind_queue_wait);
-   wait-ptr = buffer;
+   wait-ptr = __moff(buffer);
wait-size = maxNBytes;
 
ret = syncobj_wait_grant(mq-sobj, timespec, syns);
@@ -285,7 +285,7 @@ STATUS msgQSend(MSG_Q_ID msgQId, const char *buffer, UINT 
bytes,
if (bytes  maxbytes)
bytes = maxbytes;
if (bytes  0)
-   memcpy(wait-ptr, buffer, bytes);
+   memcpy(__mptr(wait-ptr), buffer, bytes);
wait-size = bytes;
goto done;
}
diff --git a/lib/vxworks/msgQLib.h b/lib/vxworks/msgQLib.h
index 2c31268..f6a1749 100644
--- a/lib/vxworks/msgQLib.h
+++ b/lib/vxworks/msgQLib.h
@@ -39,7 +39,7 @@ struct wind_mq {
 
 struct wind_queue_wait {
size_t size;
-   void *ptr;
+   dref_type(void *) ptr;
 };
 
 #endif /* _VXWORKS_MSGQLIB_H */


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