Module: xenomai-3
Branch: stable-3.0.x
Commit: cbc7bd503fa295579fbd2ae86d04dedd41ceb1ce
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=cbc7bd503fa295579fbd2ae86d04dedd41ceb1ce

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

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

---

 kernel/drivers/ipc/bufp.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/kernel/drivers/ipc/bufp.c b/kernel/drivers/ipc/bufp.c
index ecce4f9..6fc51d4 100644
--- a/kernel/drivers/ipc/bufp.c
+++ b/kernel/drivers/ipc/bufp.c
@@ -20,12 +20,11 @@
 #include <linux/module.h>
 #include <linux/list.h>
 #include <linux/kernel.h>
-#include <linux/vmalloc.h>
 #include <linux/slab.h>
+#include <linux/poll.h>
 #include <cobalt/kernel/heap.h>
 #include <cobalt/kernel/map.h>
 #include <cobalt/kernel/bufd.h>
-#include <linux/poll.h>
 #include <rtdm/ipc.h>
 #include "internal.h"
 
@@ -149,7 +148,7 @@ static void bufp_close(struct rtdm_fd *fd)
                xnregistry_remove(sk->handle);
 
        if (sk->bufmem)
-               free_pages_exact(sk->bufmem, sk->bufsz);
+               xnheap_vfree(sk->bufmem);
 
        kfree(sk);
 }
@@ -704,7 +703,7 @@ static int __bufp_bind_socket(struct rtipc_private *priv,
        if (sk->bufsz == 0)
                return -ENOBUFS;
 
-       sk->bufmem = alloc_pages_exact(sk->bufsz, GFP_KERNEL);
+       sk->bufmem = xnheap_vmalloc(sk->bufsz);
        if (sk->bufmem == NULL) {
                ret = -ENOMEM;
                goto fail;
@@ -719,7 +718,7 @@ static int __bufp_bind_socket(struct rtipc_private *priv,
                ret = xnregistry_enter(sk->label, sk,
                                       &sk->handle, &__bufp_pnode.node);
                if (ret) {
-                       free_pages_exact(sk->bufmem, sk->bufsz);
+                       xnheap_vfree(sk->bufmem);
                        goto fail;
                }
        }


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

Reply via email to