Module: xenomai-3
Branch: wip/dovetail
Commit: 19159de4b43204f8de40a7d8b3894404a6e5e51f
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=19159de4b43204f8de40a7d8b3894404a6e5e51f

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sun Feb 28 08:21:24 2016 +0100

drivers/ipc: xddp: get buffer memory from vmalloc()

---

 kernel/drivers/ipc/xddp.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/kernel/drivers/ipc/xddp.c b/kernel/drivers/ipc/xddp.c
index 9bd3644..a528061 100644
--- a/kernel/drivers/ipc/xddp.c
+++ b/kernel/drivers/ipc/xddp.c
@@ -19,11 +19,11 @@
  */
 #include <linux/module.h>
 #include <linux/string.h>
+#include <linux/poll.h>
 #include <linux/slab.h>
 #include <cobalt/kernel/heap.h>
 #include <cobalt/kernel/bufd.h>
 #include <cobalt/kernel/pipe.h>
-#include <linux/poll.h>
 #include <rtdm/ipc.h>
 #include "internal.h"
 
@@ -206,7 +206,7 @@ static void __xddp_release_handler(void *skarg) /* nklock 
free */
                poolmem = xnheap_get_membase(&sk->privpool);
                poolsz = xnheap_get_size(&sk->privpool);
                xnheap_destroy(&sk->privpool);
-               free_pages_exact(poolmem, poolsz);
+               xnheap_vfree(poolmem);
        } else if (sk->buffer)
                xnfree(sk->buffer);
 
@@ -691,7 +691,7 @@ static int __xddp_bind_socket(struct rtipc_private *priv,
        if (poolsz > 0) {
                poolsz = xnheap_rounded_size(poolsz);
                poolsz += xnheap_rounded_size(sk->reqbufsz);
-               poolmem = alloc_pages_exact(poolsz, GFP_KERNEL);
+               poolmem = xnheap_vmalloc(poolsz);
                if (poolmem == NULL) {
                        ret = -ENOMEM;
                        goto fail;
@@ -699,7 +699,7 @@ static int __xddp_bind_socket(struct rtipc_private *priv,
 
                ret = xnheap_init(&sk->privpool, poolmem, poolsz);
                if (ret) {
-                       free_pages_exact(poolmem, poolsz);
+                       xnheap_vfree(poolmem);
                        goto fail;
                }
 
@@ -732,7 +732,7 @@ static int __xddp_bind_socket(struct rtipc_private *priv,
        fail_freeheap:
                if (poolsz > 0) {
                        xnheap_destroy(&sk->privpool);
-                       free_pages_exact(poolmem, poolsz);
+                       xnheap_vfree(poolmem);
                }
        fail:
                clear_bit(_XDDP_BINDING, &sk->status);


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

Reply via email to