summaryrefslogtreecommitdiff
path: root/nuttx/drivers/rwbuffer.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-06 16:40:47 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-04-06 16:40:47 +0000
commit4011b03fa6a6a7889efea3451a3a125faa72c7fc (patch)
treec6a1b2ba8ef824b137cd423a245a8cb1c35a0786 /nuttx/drivers/rwbuffer.c
parente888bb3a55e974475a87fee0371f4405ddab696e (diff)
downloadpx4-nuttx-4011b03fa6a6a7889efea3451a3a125faa72c7fc.tar.gz
px4-nuttx-4011b03fa6a6a7889efea3451a3a125faa72c7fc.tar.bz2
px4-nuttx-4011b03fa6a6a7889efea3451a3a125faa72c7fc.zip
Fixes for kernel stub builds
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3473 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/drivers/rwbuffer.c')
-rw-r--r--nuttx/drivers/rwbuffer.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/nuttx/drivers/rwbuffer.c b/nuttx/drivers/rwbuffer.c
index 91ab7785f..5f3dbe98c 100644
--- a/nuttx/drivers/rwbuffer.c
+++ b/nuttx/drivers/rwbuffer.c
@@ -1,7 +1,7 @@
/****************************************************************************
* drivers/rwbuffer.c
*
- * Copyright (C) 2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -50,6 +50,7 @@
#include <errno.h>
#include <debug.h>
+#include <nuttx/kmalloc.h>
#include <nuttx/wqueue.h>
#include <nuttx/rwbuffer.h>
@@ -425,10 +426,10 @@ int rwb_initialize(FAR struct rwbuffer_s *rwb)
if (rwb->wrmaxblocks > 0)
{
allocsize = rwb->wrmaxblocks * rwb->blocksize;
- rwb->wrbuffer = malloc(allocsize);
+ rwb->wrbuffer = kmalloc(allocsize);
if (!rwb->wrbuffer)
{
- fdbg("Write buffer malloc(%d) failed\n", allocsizee);
+ fdbg("Write buffer kmalloc(%d) failed\n", allocsizee);
return -ENOMEM;
}
}
@@ -453,10 +454,10 @@ int rwb_initialize(FAR struct rwbuffer_s *rwb)
if (rwb->rhmaxblocks > 0)
{
allocsize = rwb->rhmaxblocks * rwb->blocksize;
- rwb->rhbuffer = malloc(allocsize);
+ rwb->rhbuffer = kmalloc(allocsize);
if (!rwb->rhbuffer)
{
- fdbg("Read-ahead buffer malloc(%d) failed\n", allocsize);
+ fdbg("Read-ahead buffer kmalloc(%d) failed\n", allocsize);
return -ENOMEM;
}
}
@@ -477,7 +478,7 @@ void rwb_uninitialize(FAR struct rwbuffer_s *rwb)
sem_destroy(&rwb->wrsem);
if (rwb->wrbuffer)
{
- free(rwb->wrbuffer);
+ kfree(rwb->wrbuffer);
}
#endif
@@ -485,7 +486,7 @@ void rwb_uninitialize(FAR struct rwbuffer_s *rwb)
sem_destroy(&rwb->rhsem);
if (rwb->rhbuffer)
{
- free(rwb->rhbuffer);
+ kfree(rwb->rhbuffer);
}
#endif
}