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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Tue Feb 17 11:48:12 2015 +0100

cobalt/kernel: unify naming of extern data - cobalt_heap

---

 include/cobalt/kernel/heap.h |    6 +++---
 kernel/cobalt/heap.c         |    4 ++--
 kernel/cobalt/init.c         |   10 +++++-----
 kernel/cobalt/pipe.c         |    2 +-
 kernel/cobalt/posix/memory.c |    8 ++++----
 kernel/drivers/ipc/iddp.c    |    6 +++---
 kernel/drivers/ipc/xddp.c    |    2 +-
 7 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/include/cobalt/kernel/heap.h b/include/cobalt/kernel/heap.h
index 916ac8f..988004f 100644
--- a/include/cobalt/kernel/heap.h
+++ b/include/cobalt/kernel/heap.h
@@ -90,10 +90,10 @@ struct xnheap {
        u32 used;
 };
 
-extern struct xnheap kheap;
+extern struct xnheap cobalt_heap;
 
-#define xnmalloc(size)     xnheap_alloc(&kheap, size)
-#define xnfree(ptr)        xnheap_free(&kheap, ptr)
+#define xnmalloc(size)     xnheap_alloc(&cobalt_heap, size)
+#define xnfree(ptr)        xnheap_free(&cobalt_heap, ptr)
 
 static inline u32 xnheap_get_size(const struct xnheap *heap)
 {
diff --git a/kernel/cobalt/heap.c b/kernel/cobalt/heap.c
index 918e263..359b74f 100644
--- a/kernel/cobalt/heap.c
+++ b/kernel/cobalt/heap.c
@@ -37,8 +37,8 @@
  * http://docs.FreeBSD.org/44doc/papers/kernmalloc.pdf.
  *@{
  */
-struct xnheap kheap;           /* System heap */
-EXPORT_SYMBOL_GPL(kheap);
+struct xnheap cobalt_heap;             /* System heap */
+EXPORT_SYMBOL_GPL(cobalt_heap);
 
 static LIST_HEAD(heapq);       /* Heap list for v-file dump */
 
diff --git a/kernel/cobalt/init.c b/kernel/cobalt/init.c
index d5fc750..d47ecec 100644
--- a/kernel/cobalt/init.c
+++ b/kernel/cobalt/init.c
@@ -151,9 +151,9 @@ static void sys_shutdown(void)
        xnlock_put_irqrestore(&nklock, s);
 
        xnregistry_cleanup();
-       membase = xnheap_get_membase(&kheap);
-       memsize = xnheap_get_size(&kheap);
-       xnheap_destroy(&kheap);
+       membase = xnheap_get_membase(&cobalt_heap);
+       memsize = xnheap_get_size(&cobalt_heap);
+       xnheap_destroy(&cobalt_heap);
        free_pages_exact(membase, memsize);
 }
 
@@ -284,10 +284,10 @@ static __init int sys_init(void)
 
        heapaddr = alloc_pages_exact(sysheap_size_arg * 1024, GFP_KERNEL);
        if (heapaddr == NULL ||
-           xnheap_init(&kheap, heapaddr, sysheap_size_arg * 1024)) {
+           xnheap_init(&cobalt_heap, heapaddr, sysheap_size_arg * 1024)) {
                return -ENOMEM;
        }
-       xnheap_set_name(&kheap, "system heap");
+       xnheap_set_name(&cobalt_heap, "system heap");
 
        for_each_online_cpu(cpu) {
                sched = &per_cpu(nksched, cpu);
diff --git a/kernel/cobalt/pipe.c b/kernel/cobalt/pipe.c
index 716cbf9..fa16378 100644
--- a/kernel/cobalt/pipe.c
+++ b/kernel/cobalt/pipe.c
@@ -271,7 +271,7 @@ static void *xnpipe_default_alloc_ibuf(size_t size, void 
*xstate)
        if (likely(buf != NULL))
                return buf;
 
-       if (size > xnheap_get_size(&kheap))
+       if (size > xnheap_get_size(&cobalt_heap))
                /* Request will never succeed. */
                return (struct xnpipe_mh *)-1;
 
diff --git a/kernel/cobalt/posix/memory.c b/kernel/cobalt/posix/memory.c
index efedfa2..9e4d093 100644
--- a/kernel/cobalt/posix/memory.c
+++ b/kernel/cobalt/posix/memory.c
@@ -180,10 +180,10 @@ static int do_sysmem_ioctls(struct rtdm_fd *fd,
 
        switch (request) {
        case MEMDEV_RTIOC_STAT:
-               xnlock_get_irqsave(&kheap.lock, s);
-               stat.size = xnheap_get_size(&kheap);
-               stat.free = xnheap_get_free(&kheap);
-               xnlock_put_irqrestore(&kheap.lock, s);
+               xnlock_get_irqsave(&cobalt_heap.lock, s);
+               stat.size = xnheap_get_size(&cobalt_heap);
+               stat.free = xnheap_get_free(&cobalt_heap);
+               xnlock_put_irqrestore(&cobalt_heap.lock, s);
                ret = rtdm_safe_copy_to_user(fd, arg, &stat, sizeof(stat));
                break;
        default:
diff --git a/kernel/drivers/ipc/iddp.c b/kernel/drivers/ipc/iddp.c
index d37c784..1eac820 100644
--- a/kernel/drivers/ipc/iddp.c
+++ b/kernel/drivers/ipc/iddp.c
@@ -167,7 +167,7 @@ static int iddp_socket(struct rtdm_fd *fd)
        sk->magic = IDDP_SOCKET_MAGIC;
        sk->name = nullsa;      /* Unbound */
        sk->peer = nullsa;
-       sk->bufpool = &kheap;
+       sk->bufpool = &cobalt_heap;
        sk->poolwaitq = &poolwaitq;
        sk->poolsz = 0;
        sk->status = 0;
@@ -205,7 +205,7 @@ static void iddp_close(struct rtdm_fd *fd)
        if (sk->handle)
                xnregistry_remove(sk->handle);
 
-       if (sk->bufpool != &kheap) {
+       if (sk->bufpool != &cobalt_heap) {
                poolmem = xnheap_get_membase(&sk->privpool);
                poolsz = xnheap_get_size(&sk->privpool);
                xnheap_destroy(&sk->privpool);
@@ -217,7 +217,7 @@ static void iddp_close(struct rtdm_fd *fd)
        while (!list_empty(&sk->inq)) {
                mbuf = list_entry(sk->inq.next, struct iddp_message, next);
                list_del(&mbuf->next);
-               xnheap_free(&kheap, mbuf);
+               xnheap_free(&cobalt_heap, mbuf);
        }
 
        kfree(sk);
diff --git a/kernel/drivers/ipc/xddp.c b/kernel/drivers/ipc/xddp.c
index efb4a41..e40f8b0 100644
--- a/kernel/drivers/ipc/xddp.c
+++ b/kernel/drivers/ipc/xddp.c
@@ -704,7 +704,7 @@ static int __xddp_bind_socket(struct rtipc_private *priv,
 
                sk->bufpool = &sk->privpool;
        } else
-               sk->bufpool = &kheap;
+               sk->bufpool = &cobalt_heap;
 
        if (sk->reqbufsz > 0) {
                sk->buffer = xnheap_alloc(sk->bufpool, sk->reqbufsz);


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

Reply via email to