aboutsummaryrefslogtreecommitdiff
path: root/nuttx/fs
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-09-11 18:22:27 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-09-11 18:22:27 +0000
commit3ca467c02936aa967daeabc89b80e84f409f049a (patch)
tree55bdc1b853ebf75814934f703ed60373b1e2e0e1 /nuttx/fs
parent64c8e5c7c3d1c7729bd5c12952b4966fa06ed77a (diff)
downloadpx4-firmware-3ca467c02936aa967daeabc89b80e84f409f049a.tar.gz
px4-firmware-3ca467c02936aa967daeabc89b80e84f409f049a.tar.bz2
px4-firmware-3ca467c02936aa967daeabc89b80e84f409f049a.zip
Add beginning of a simple granule allocator to support DMA IO buffer allocation
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5129 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/fs')
-rw-r--r--nuttx/fs/fat/fs_fat32.c4
-rw-r--r--nuttx/fs/fat/fs_fat32.h8
-rw-r--r--nuttx/fs/fat/fs_fat32util.c2
3 files changed, 7 insertions, 7 deletions
diff --git a/nuttx/fs/fat/fs_fat32.c b/nuttx/fs/fat/fs_fat32.c
index 60622e2f7..0c28cea67 100644
--- a/nuttx/fs/fat/fs_fat32.c
+++ b/nuttx/fs/fat/fs_fat32.c
@@ -405,7 +405,7 @@ static int fat_close(FAR struct file *filep)
if (ff->ff_buffer)
{
- fat_io_free(ff->ff_buffer);
+ fat_io_free(ff->ff_buffer, fs->fs_hwsectorsize);
}
/* Then free the file structure itself. */
@@ -1651,7 +1651,7 @@ static int fat_unbind(void *handle, FAR struct inode **blkdriver)
if (fs->fs_buffer)
{
- fat_io_free(fs->fs_buffer);
+ fat_io_free(fs->fs_buffer, fs->fs_hwsectorsize);
}
kfree(fs);
diff --git a/nuttx/fs/fat/fs_fat32.h b/nuttx/fs/fat/fs_fat32.h
index c7fa5219c..71a21333b 100644
--- a/nuttx/fs/fat/fs_fat32.h
+++ b/nuttx/fs/fat/fs_fat32.h
@@ -697,11 +697,11 @@
****************************************************************************/
#ifdef CONFIG_FAT_DMAMEMORY
-# define fat_io_alloc(s) fat_dma_alloc(s)
-# define fat_io_free(s) fat_dma_free(s)
+# define fat_io_alloc(s) fat_dma_alloc(s)
+# define fat_io_free(m,s) fat_dma_free(m,s)
#else
-# define fat_io_alloc(s) kmalloc(s)
-# define fat_io_free(s) kfree(s)
+# define fat_io_alloc(s) kmalloc(s)
+# define fat_io_free(m,s) kfree(m)
#endif
/****************************************************************************
diff --git a/nuttx/fs/fat/fs_fat32util.c b/nuttx/fs/fat/fs_fat32util.c
index f8f5ef495..7231456d7 100644
--- a/nuttx/fs/fat/fs_fat32util.c
+++ b/nuttx/fs/fat/fs_fat32util.c
@@ -668,7 +668,7 @@ int fat_mount(struct fat_mountpt_s *fs, bool writeable)
return OK;
errout_with_buffer:
- fat_io_free(fs->fs_buffer);
+ fat_io_free(fs->fs_buffer, fs->fs_hwsectorsize);
fs->fs_buffer = 0;
errout:
fs->fs_mounted = false;