Embedded GPLv2 license in dfs

This commit is contained in:
yiyue.fang 2013-06-26 22:30:40 +08:00
parent cb517cecc9
commit 773990abdb
27 changed files with 1759 additions and 1353 deletions

View File

@ -1,7 +1,26 @@
/* /*
* RT-Thread Console Device File * File : console.c
* This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2004-2011, RT-Thread Development Team
* *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
*/ */
#include <rtthread.h> #include <rtthread.h>
struct console_device struct console_device

View File

@ -1,3 +1,26 @@
/*
* File : devfs.c
* This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2004-2011, RT-Thread Development Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
*/
#include <rtthread.h> #include <rtthread.h>
#include <dfs.h> #include <dfs.h>
#include <dfs_fs.h> #include <dfs_fs.h>

View File

@ -1,3 +1,26 @@
/*
* File : devfs.h
* This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2004-2011, RT-Thread Development Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
*/
#ifndef __DEVICE_FS_H__ #ifndef __DEVICE_FS_H__
#define __DEVICE_FS_H__ #define __DEVICE_FS_H__

View File

@ -3,9 +3,19 @@
* This file is part of Device File System in RT-Thread RTOS * This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2008-2011, RT-Thread Development Team * COPYRIGHT (C) 2008-2011, RT-Thread Development Team
* *
* The license and distribution terms for this file may be * This program is free software; you can redistribute it and/or modify
* found in the file LICENSE in this distribution or at * it under the terms of the GNU General Public License as published by
* http://www.rt-thread.org/license/LICENSE. * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

View File

@ -3,9 +3,19 @@
* This file is part of Device File System in RT-Thread RTOS * This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2004-2011, RT-Thread Development Team * COPYRIGHT (C) 2004-2011, RT-Thread Development Team
* *
* The license and distribution terms for this file may be * This program is free software; you can redistribute it and/or modify
* found in the file LICENSE in this distribution or at * it under the terms of the GNU General Public License as published by
* http://www.rt-thread.org/license/LICENSE. * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
@ -64,8 +74,10 @@ typedef struct nfs_dir nfs_dir;
nfs_dir *nfs_opendir(struct nfs_filesystem *nfs, const char *path); nfs_dir *nfs_opendir(struct nfs_filesystem *nfs, const char *path);
static int nfs_parse_host_export(const char *host_export, static int nfs_parse_host_export(const char *host_export,
char *host, size_t host_len, char *host,
char *export, size_t export_len) size_t host_len,
char *export,
size_t export_len)
{ {
int index; int index;
@ -98,6 +110,7 @@ static int nfs_parse_host_export(const char *host_export,
if (host_export[index] == 0) if (host_export[index] == 0)
{ {
export[index - host_len] = '\0'; export[index - host_len] = '\0';
return 0; return 0;
} }
@ -114,6 +127,7 @@ static void copy_handle(nfs_fh3 *dest, const nfs_fh3 *source)
if (dest->data.data_val == RT_NULL) if (dest->data.data_val == RT_NULL)
{ {
dest->data.data_len = 0; dest->data.data_len = 0;
return; return;
} }
@ -137,6 +151,7 @@ static nfs_fh3 *get_handle(struct nfs_filesystem *nfs, const char *name)
if (handle == RT_NULL) if (handle == RT_NULL)
{ {
rt_free(init); rt_free(init);
return RT_NULL; return RT_NULL;
} }
@ -165,6 +180,7 @@ static nfs_fh3 *get_handle(struct nfs_filesystem *nfs, const char *name)
rt_free(init); rt_free(init);
rt_free(handle); rt_free(handle);
xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)&args.what.dir); xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)&args.what.dir);
return RT_NULL; return RT_NULL;
} }
else if (res.status != NFS3_OK) else if (res.status != NFS3_OK)
@ -174,6 +190,7 @@ static nfs_fh3 *get_handle(struct nfs_filesystem *nfs, const char *name)
rt_free(handle); rt_free(handle);
xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)&args.what.dir); xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)&args.what.dir);
xdr_free((xdrproc_t)xdr_LOOKUP3res, (char *)&res); xdr_free((xdrproc_t)xdr_LOOKUP3res, (char *)&res);
return RT_NULL; return RT_NULL;
} }
copy_handle(handle, &res.LOOKUP3res_u.resok.object); copy_handle(handle, &res.LOOKUP3res_u.resok.object);
@ -182,6 +199,7 @@ static nfs_fh3 *get_handle(struct nfs_filesystem *nfs, const char *name)
} }
rt_free(init); rt_free(init);
return handle; return handle;
} }
@ -201,6 +219,7 @@ static nfs_fh3 *get_dir_handle(struct nfs_filesystem *nfs, const char *name)
if (handle == RT_NULL) if (handle == RT_NULL)
{ {
rt_free(init); rt_free(init);
return RT_NULL; return RT_NULL;
} }
@ -229,6 +248,7 @@ static nfs_fh3 *get_dir_handle(struct nfs_filesystem *nfs, const char *name)
rt_free(init); rt_free(init);
rt_free(handle); rt_free(handle);
xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)&args.what.dir); xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)&args.what.dir);
return RT_NULL; return RT_NULL;
} }
else if (res.status != NFS3_OK) else if (res.status != NFS3_OK)
@ -238,6 +258,7 @@ static nfs_fh3 *get_dir_handle(struct nfs_filesystem *nfs, const char *name)
rt_free(handle); rt_free(handle);
xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)&args.what.dir); xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)&args.what.dir);
xdr_free((xdrproc_t)xdr_LOOKUP3res, (char *)&res); xdr_free((xdrproc_t)xdr_LOOKUP3res, (char *)&res);
return RT_NULL; return RT_NULL;
} }
copy_handle(handle, &res.LOOKUP3res_u.resok.object); copy_handle(handle, &res.LOOKUP3res_u.resok.object);
@ -246,6 +267,7 @@ static nfs_fh3 *get_dir_handle(struct nfs_filesystem *nfs, const char *name)
} }
rt_free(init); rt_free(init);
return handle; return handle;
} }
@ -264,6 +286,7 @@ static size_t nfs_get_filesize(struct nfs_filesystem *nfs, nfs_fh3 *handle)
res.status != NFS3_OK) res.status != NFS3_OK)
{ {
rt_kprintf("GetAttr failed: %d\n", res.status); rt_kprintf("GetAttr failed: %d\n", res.status);
return 0; return 0;
} }
@ -294,11 +317,13 @@ rt_bool_t nfs_is_directory(struct nfs_filesystem *nfs, const char *name)
if (nfsproc3_getattr_3(args, &res, nfs->nfs_client) != RPC_SUCCESS) if (nfsproc3_getattr_3(args, &res, nfs->nfs_client) != RPC_SUCCESS)
{ {
rt_kprintf("GetAttr failed\n"); rt_kprintf("GetAttr failed\n");
return RT_FALSE; return RT_FALSE;
} }
else if (res.status != NFS3_OK) else if (res.status != NFS3_OK)
{ {
rt_kprintf("Getattr failed: %d\n", res.status); rt_kprintf("Getattr failed: %d\n", res.status);
return RT_FALSE; return RT_FALSE;
} }
@ -495,6 +520,7 @@ int nfs_unmount(struct dfs_filesystem *fs)
mountproc3_umnt_3((char *)nfs->export, RT_NULL, nfs->mount_client) != RPC_SUCCESS) mountproc3_umnt_3((char *)nfs->export, RT_NULL, nfs->mount_client) != RPC_SUCCESS)
{ {
rt_kprintf("umount failed\n"); rt_kprintf("umount failed\n");
return -1; return -1;
} }
@ -596,6 +622,7 @@ int nfs_read(struct dfs_fd *file, void *buf, rt_size_t count)
} while(count > 0); } while(count > 0);
xdr_free((xdrproc_t)xdr_READ3res, (char *)&res); xdr_free((xdrproc_t)xdr_READ3res, (char *)&res);
return total; return total;
} }
@ -657,6 +684,7 @@ int nfs_write(struct dfs_fd *file, const void *buf, rt_size_t count)
} while (count > 0); } while (count > 0);
xdr_free((xdrproc_t)xdr_WRITE3res, (char *)&res); xdr_free((xdrproc_t)xdr_WRITE3res, (char *)&res);
return total; return total;
} }
@ -673,6 +701,7 @@ int nfs_lseek(struct dfs_fd *file, rt_off_t offset)
if (offset <= fd->size) if (offset <= fd->size)
{ {
fd->offset = offset; fd->offset = offset;
return offset; return offset;
} }
@ -734,7 +763,8 @@ int nfs_open(struct dfs_fd *file)
/* create file */ /* create file */
if (file->flags & DFS_O_CREAT) if (file->flags & DFS_O_CREAT)
{ {
if (nfs_create(nfs, file->path, 0664) < 0) return -1; if (nfs_create(nfs, file->path, 0664) < 0)
return -1;
} }
/* open file (get file handle ) */ /* open file (get file handle ) */
@ -746,6 +776,7 @@ int nfs_open(struct dfs_fd *file)
if (handle == RT_NULL) if (handle == RT_NULL)
{ {
rt_free(fp); rt_free(fp);
return -1; return -1;
} }
@ -839,6 +870,7 @@ nfs_dir *nfs_opendir(struct nfs_filesystem *nfs, const char *path)
if (handle == RT_NULL) if (handle == RT_NULL)
{ {
rt_free(dir); rt_free(dir);
return RT_NULL; return RT_NULL;
} }
@ -877,11 +909,13 @@ char *nfs_readdir(struct nfs_filesystem *nfs, nfs_dir *dir)
if (nfsproc3_readdir_3(args, &dir->res, nfs->nfs_client) != RPC_SUCCESS) if (nfsproc3_readdir_3(args, &dir->res, nfs->nfs_client) != RPC_SUCCESS)
{ {
rt_kprintf("Readdir failed\n"); rt_kprintf("Readdir failed\n");
return RT_NULL; return RT_NULL;
} }
else if (dir->res.status != NFS3_OK) else if (dir->res.status != NFS3_OK)
{ {
rt_kprintf("Readdir failed: %d\n", dir->res.status); rt_kprintf("Readdir failed: %d\n", dir->res.status);
return RT_NULL; return RT_NULL;
} }
@ -896,6 +930,7 @@ char *nfs_readdir(struct nfs_filesystem *nfs, nfs_dir *dir)
strncpy(name, dir->entry->name, NAME_MAX-1); strncpy(name, dir->entry->name, NAME_MAX-1);
dir->entry = dir->entry->nextentry; dir->entry = dir->entry->nextentry;
name[NAME_MAX - 1] = '\0'; name[NAME_MAX - 1] = '\0';
return name; return name;
} }
@ -1031,6 +1066,7 @@ int nfs_rename(struct dfs_filesystem *fs, const char *src, const char *dest)
xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)sHandle); xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)sHandle);
xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)dHandle); xdr_free((xdrproc_t)xdr_nfs_fh3, (char *)dHandle);
xdr_free((xdrproc_t)xdr_RENAME3res, (char *)&res); xdr_free((xdrproc_t)xdr_RENAME3res, (char *)&res);
return ret; return ret;
} }

View File

@ -3,9 +3,19 @@
* This file is part of Device File System in RT-Thread RTOS * This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2004-2011, RT-Thread Development Team * COPYRIGHT (C) 2004-2011, RT-Thread Development Team
* *
* The license and distribution terms for this file may be * This program is free software; you can redistribute it and/or modify
* found in the file LICENSE in this distribution or at * it under the terms of the GNU General Public License as published by
* http://www.rt-thread.org/license/LICENSE. * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

View File

@ -1,9 +1,21 @@
/* /*
* File : dfs_ramfs.c * File : dfs_ramfs.c
* This file is part of RT-Thread RTOS * This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2011, Shanghai Real-Thread Technology Co., Ltd * COPYRIGHT (C) 2004-2013, RT-Thread Development Team
* *
* All rights reserved. * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
@ -17,11 +29,14 @@
#include <dfs_fs.h> #include <dfs_fs.h>
#include "dfs_ramfs.h" #include "dfs_ramfs.h"
int dfs_ramfs_mount(struct dfs_filesystem *fs, unsigned long rwflag, const void *data) int dfs_ramfs_mount(struct dfs_filesystem *fs,
unsigned long rwflag,
const void *data)
{ {
struct dfs_ramfs* ramfs; struct dfs_ramfs* ramfs;
if (data == RT_NULL) return -DFS_STATUS_EIO; if (data == RT_NULL)
return -DFS_STATUS_EIO;
ramfs = (struct dfs_ramfs*) data; ramfs = (struct dfs_ramfs*) data;
fs->data = ramfs; fs->data = ramfs;
@ -55,7 +70,9 @@ int dfs_ramfs_ioctl(struct dfs_fd *file, int cmd, void *args)
return -DFS_STATUS_EIO; return -DFS_STATUS_EIO;
} }
struct ramfs_dirent *dfs_ramfs_lookup(struct dfs_ramfs* ramfs, const char *path, rt_size_t *size) struct ramfs_dirent *dfs_ramfs_lookup(struct dfs_ramfs *ramfs,
const char *path,
rt_size_t *size)
{ {
const char *subpath; const char *subpath;
struct ramfs_dirent *dirent; struct ramfs_dirent *dirent;
@ -65,6 +82,7 @@ struct ramfs_dirent *dfs_ramfs_lookup(struct dfs_ramfs* ramfs, const char *path,
if (! *subpath) /* is root directory */ if (! *subpath) /* is root directory */
{ {
*size = 0; *size = 0;
return &(ramfs->root); return &(ramfs->root);
} }
@ -75,6 +93,7 @@ struct ramfs_dirent *dfs_ramfs_lookup(struct dfs_ramfs* ramfs, const char *path,
if (rt_strcmp(dirent->name, subpath) == 0) if (rt_strcmp(dirent->name, subpath) == 0)
{ {
*size = dirent->size; *size = dirent->size;
return dirent; return dirent;
} }
} }
@ -122,6 +141,7 @@ int dfs_ramfs_write(struct dfs_fd *fd, const void *buf, rt_size_t count)
if (ptr == RT_NULL) if (ptr == RT_NULL)
{ {
rt_set_errno(-RT_ENOMEM); rt_set_errno(-RT_ENOMEM);
return 0; return 0;
} }
@ -145,6 +165,7 @@ int dfs_ramfs_lseek(struct dfs_fd *file, rt_off_t offset)
if (offset <= (rt_off_t)file->size) if (offset <= (rt_off_t)file->size)
{ {
file->pos = offset; file->pos = offset;
return file->pos; return file->pos;
} }
@ -154,6 +175,7 @@ int dfs_ramfs_lseek(struct dfs_fd *file, rt_off_t offset)
int dfs_ramfs_close(struct dfs_fd *file) int dfs_ramfs_close(struct dfs_fd *file)
{ {
file->data = RT_NULL; file->data = RT_NULL;
return DFS_STATUS_OK; return DFS_STATUS_OK;
} }
@ -195,8 +217,7 @@ int dfs_ramfs_open(struct dfs_fd *file)
if (dirent == RT_NULL) if (dirent == RT_NULL)
{ {
if (file->flags & DFS_O_CREAT || if (file->flags & DFS_O_CREAT || file->flags & DFS_O_WRONLY)
file->flags & DFS_O_WRONLY)
{ {
char *name_ptr; char *name_ptr;
@ -209,7 +230,8 @@ int dfs_ramfs_open(struct dfs_fd *file)
/* remove '/' separator */ /* remove '/' separator */
name_ptr = file->path; name_ptr = file->path;
while (*name_ptr == '/' && *name_ptr) name_ptr ++; while (*name_ptr == '/' && *name_ptr)
name_ptr ++;
strncpy(dirent->name, name_ptr, RAMFS_NAME_MAX); strncpy(dirent->name, name_ptr, RAMFS_NAME_MAX);
rt_list_init(&(dirent->list)); rt_list_init(&(dirent->list));
@ -218,7 +240,8 @@ int dfs_ramfs_open(struct dfs_fd *file)
/* add to the root directory */ /* add to the root directory */
rt_list_insert_after(&(ramfs->root.list), &(dirent->list)); rt_list_insert_after(&(ramfs->root.list), &(dirent->list));
} }
else return -DFS_STATUS_ENOENT; else
return -DFS_STATUS_ENOENT;
} }
/* Creates a new file. If the file is existing, it is truncated and overwritten. */ /* Creates a new file. If the file is existing, it is truncated and overwritten. */
@ -312,7 +335,8 @@ int dfs_ramfs_unlink(struct dfs_filesystem *fs, const char *path)
RT_ASSERT(ramfs != RT_NULL); RT_ASSERT(ramfs != RT_NULL);
dirent = dfs_ramfs_lookup(ramfs, path, &size); dirent = dfs_ramfs_lookup(ramfs, path, &size);
if (dirent == RT_NULL) return -DFS_STATUS_ENOENT; if (dirent == RT_NULL)
return -DFS_STATUS_ENOENT;
rt_list_remove(&(dirent->list)); rt_list_remove(&(dirent->list));
if (dirent->data != RT_NULL) if (dirent->data != RT_NULL)
@ -322,7 +346,9 @@ int dfs_ramfs_unlink(struct dfs_filesystem *fs, const char *path)
return DFS_STATUS_OK; return DFS_STATUS_OK;
} }
int dfs_ramfs_rename(struct dfs_filesystem *fs, const char *oldpath, const char *newpath) int dfs_ramfs_rename(struct dfs_filesystem *fs,
const char *oldpath,
const char *newpath)
{ {
struct ramfs_dirent *dirent; struct ramfs_dirent *dirent;
struct dfs_ramfs *ramfs; struct dfs_ramfs *ramfs;
@ -332,10 +358,12 @@ int dfs_ramfs_rename(struct dfs_filesystem *fs, const char *oldpath, const char
RT_ASSERT(ramfs != RT_NULL); RT_ASSERT(ramfs != RT_NULL);
dirent = dfs_ramfs_lookup(ramfs, newpath, &size); dirent = dfs_ramfs_lookup(ramfs, newpath, &size);
if (dirent != RT_NULL) return -DFS_STATUS_EEXIST; if (dirent != RT_NULL)
return -DFS_STATUS_EEXIST;
dirent = dfs_ramfs_lookup(ramfs, oldpath, &size); dirent = dfs_ramfs_lookup(ramfs, oldpath, &size);
if (dirent == RT_NULL) return -DFS_STATUS_ENOENT; if (dirent == RT_NULL)
return -DFS_STATUS_ENOENT;
strncpy(dirent->name, newpath, RAMFS_NAME_MAX); strncpy(dirent->name, newpath, RAMFS_NAME_MAX);
@ -368,10 +396,11 @@ int dfs_ramfs_init(void)
{ {
/* register ram file system */ /* register ram file system */
dfs_register(&_ramfs); dfs_register(&_ramfs);
return 0; return 0;
} }
struct dfs_ramfs* dfs_ramfs_create(rt_uint8_t* pool, rt_size_t size) struct dfs_ramfs* dfs_ramfs_create(rt_uint8_t *pool, rt_size_t size)
{ {
struct dfs_ramfs *ramfs; struct dfs_ramfs *ramfs;
rt_uint8_t *data_ptr; rt_uint8_t *data_ptr;
@ -385,7 +414,8 @@ struct dfs_ramfs* dfs_ramfs_create(rt_uint8_t* pool, rt_size_t size)
size = RT_ALIGN_DOWN(size, RT_ALIGN_SIZE); size = RT_ALIGN_DOWN(size, RT_ALIGN_SIZE);
result = rt_memheap_init(&ramfs->memheap, "ramfs", data_ptr, size); result = rt_memheap_init(&ramfs->memheap, "ramfs", data_ptr, size);
if (result != RT_EOK) return RT_NULL; if (result != RT_EOK)
return RT_NULL;
/* detach this memheap object from the system */ /* detach this memheap object from the system */
rt_object_detach((rt_object_t)&(ramfs->memheap)); rt_object_detach((rt_object_t)&(ramfs->memheap));

View File

@ -1,9 +1,21 @@
/* /*
* File : dfs_ramfs.h * File : dfs_ramfs.h
* This file is part of RT-Thread RTOS * This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2011, Shanghai Real-Thread Technology Co., Ltd * COPYRIGHT (C) 2004-2013, RT-Thread Development Team
* *
* All rights reserved. * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

View File

@ -3,9 +3,19 @@
* This file is part of Device File System in RT-Thread RTOS * This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2004-2011, RT-Thread Development Team * COPYRIGHT (C) 2004-2011, RT-Thread Development Team
* *
* The license and distribution terms for this file may be * This program is free software; you can redistribute it and/or modify
* found in the file LICENSE in this distribution or at * it under the terms of the GNU General Public License as published by
* http://www.rt-thread.org/license/LICENSE. * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

View File

@ -3,9 +3,19 @@
* This file is part of Device File System in RT-Thread RTOS * This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2004-2011, RT-Thread Development Team * COPYRIGHT (C) 2004-2011, RT-Thread Development Team
* *
* The license and distribution terms for this file may be * This program is free software; you can redistribute it and/or modify
* found in the file LICENSE in this distribution or at * it under the terms of the GNU General Public License as published by
* http://www.rt-thread.org/license/LICENSE. * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

View File

@ -1,23 +1,51 @@
/*
* File : romfs.c
* This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2004-2011, RT-Thread Development Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
*/
#include <dfs_romfs.h> #include <dfs_romfs.h>
const static unsigned char _dummy_dummy_txt[] = { const static unsigned char _dummy_dummy_txt[] =
0x74,0x68,0x69,0x73,0x20,0x69,0x73,0x20,0x61,0x20,0x66,0x69,0x6c,0x65,0x21,0x0d, {
0x0a, 0x74,0x68,0x69,0x73,0x20,0x69,0x73,0x20,0x61,0x20,0x66,0x69,0x6c,0x65,0x21,0x0d,0x0a,
}; };
const static struct romfs_dirent _dummy[] = { const static struct romfs_dirent _dummy[] =
{
{ROMFS_DIRENT_FILE, "dummy.txt", _dummy_dummy_txt, sizeof(_dummy_dummy_txt)}, {ROMFS_DIRENT_FILE, "dummy.txt", _dummy_dummy_txt, sizeof(_dummy_dummy_txt)},
}; };
const static unsigned char _dummy_txt[] = { const static unsigned char _dummy_txt[] =
0x74,0x68,0x69,0x73,0x20,0x69,0x73,0x20,0x61,0x20,0x66,0x69,0x6c,0x65,0x21,0x0d, {
0x0a, 0x74,0x68,0x69,0x73,0x20,0x69,0x73,0x20,0x61,0x20,0x66,0x69,0x6c,0x65,0x21,0x0d,0x0a,
}; };
const struct romfs_dirent _root_dirent[] = { const struct romfs_dirent _root_dirent[] =
{ROMFS_DIRENT_DIR, "dummy", (rt_uint8_t*) _dummy, sizeof(_dummy)/sizeof(_dummy[0])}, {
{ROMFS_DIRENT_DIR, "dummy", (rt_uint8_t *)_dummy, sizeof(_dummy)/sizeof(_dummy[0])},
{ROMFS_DIRENT_FILE, "dummy.txt", _dummy_txt, sizeof(_dummy_txt)}, {ROMFS_DIRENT_FILE, "dummy.txt", _dummy_txt, sizeof(_dummy_txt)},
}; };
const struct romfs_dirent romfs_root = {ROMFS_DIRENT_DIR, "/", (rt_uint8_t*) _root_dirent, sizeof(_root_dirent)/sizeof(_root_dirent[0])}; const struct romfs_dirent romfs_root =
{
ROMFS_DIRENT_DIR, "/", (rt_uint8_t *)_root_dirent, sizeof(_root_dirent)/sizeof(_root_dirent[0])
};

View File

@ -1,6 +1,26 @@
/* /*
* A skeleton of file system in Device File System * File : skeleton.c
* This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2004-2011, RT-Thread Development Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
*/ */
#include <rtthread.h> #include <rtthread.h>
#include <dfs.h> #include <dfs.h>
#include <dfs_fs.h> #include <dfs_fs.h>

View File

@ -1,3 +1,26 @@
/*
* File : skeleton.h
* This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2004-2011, RT-Thread Development Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
*/
#ifndef __SKELETON_H__ #ifndef __SKELETON_H__
#define __SKELETON_H__ #define __SKELETON_H__

View File

@ -1,18 +1,29 @@
/* /*
* File : rtthread.h * File : dfs_uffs.c
* This file is part of RT-Thread RTOS * This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2006-2012, RT-Thread Development Team * COPYRIGHT (C) 2004-2012, RT-Thread Development Team
* *
* The license and distribution terms for this file may be * This program is free software; you can redistribute it and/or modify
* found in the file LICENSE in this distribution or at * it under the terms of the GNU General Public License as published by
* http://www.rt-thread.org/license/LICENSE. * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
* 2011-10-22 prife the first version * 2011-10-22 prife the first version
* 2012-03-28 prife use mtd device interface * 2012-03-28 prife use mtd device interface
* 2012-04-05 prife update uffs with official repo and use uffs_UnMount/Mount * 2012-04-05 prife update uffs with official repo and use uffs_UnMount/Mount
*/ */
#include <rtthread.h> #include <rtthread.h>
#include <dfs_fs.h> #include <dfs_fs.h>

View File

@ -1,8 +1,25 @@
/* /*
* dfs_uffs.h * File : dfs_uffs.h
* This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2004-2012, RT-Thread Development Team
* *
* Created on: 2012-3-30 * This program is free software; you can redistribute it and/or modify
* Author: prife * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
* 2012-03-30 prife the first version
*/ */
#ifndef DFS_UFFS_H_ #ifndef DFS_UFFS_H_

View File

@ -18,7 +18,9 @@ static int nand_release_flash(uffs_Device *dev)
static int nand_erase_block(uffs_Device *dev, unsigned block) static int nand_erase_block(uffs_Device *dev, unsigned block)
{ {
int res; int res;
res = rt_mtd_nand_erase_block(RT_MTD_NAND_DEVICE(dev->_private), block); res = rt_mtd_nand_erase_block(RT_MTD_NAND_DEVICE(dev->_private), block);
return res == RT_EOK ? UFFS_FLASH_NO_ERR : UFFS_FLASH_IO_ERR; return res == RT_EOK ? UFFS_FLASH_NO_ERR : UFFS_FLASH_IO_ERR;
} }
@ -26,26 +28,31 @@ static int nand_erase_block(uffs_Device *dev, unsigned block)
static int nand_check_block(uffs_Device *dev, unsigned block) static int nand_check_block(uffs_Device *dev, unsigned block)
{ {
int res; int res;
res = rt_mtd_nand_check_block(RT_MTD_NAND_DEVICE(dev->_private), block); res = rt_mtd_nand_check_block(RT_MTD_NAND_DEVICE(dev->_private), block);
return res == RT_EOK ? UFFS_FLASH_NO_ERR : UFFS_FLASH_BAD_BLK; return res == RT_EOK ? UFFS_FLASH_NO_ERR : UFFS_FLASH_BAD_BLK;
} }
static int nand_mark_badblock(uffs_Device *dev, unsigned block) static int nand_mark_badblock(uffs_Device *dev, unsigned block)
{ {
int res; int res;
res = rt_mtd_nand_mark_badblock(RT_MTD_NAND_DEVICE(dev->_private), block); res = rt_mtd_nand_mark_badblock(RT_MTD_NAND_DEVICE(dev->_private), block);
return res == RT_EOK ? UFFS_FLASH_NO_ERR : UFFS_FLASH_IO_ERR; return res == RT_EOK ? UFFS_FLASH_NO_ERR : UFFS_FLASH_IO_ERR;
} }
#endif #endif
#if (RT_CONFIG_UFFS_ECC_MODE == UFFS_ECC_NONE) || (RT_CONFIG_UFFS_ECC_MODE == UFFS_ECC_SOFT) #if (RT_CONFIG_UFFS_ECC_MODE == UFFS_ECC_NONE) || (RT_CONFIG_UFFS_ECC_MODE == UFFS_ECC_SOFT)
static int nand_read_page(uffs_Device *dev,
static int nand_read_page( u32 block,
uffs_Device *dev, u32 page,
u32 block, u32 page, u8 *data,
u8 *data, int data_len, int data_len,
u8 * ecc, u8 *ecc,
rt_uint8_t *spare, int spare_len) rt_uint8_t *spare,
int spare_len)
{ {
int res; int res;
@ -66,6 +73,7 @@ static int nand_read_page(
res = spare[dev->attr->block_status_offs] == 0xFF ? res = spare[dev->attr->block_status_offs] == 0xFF ?
UFFS_FLASH_NO_ERR : UFFS_FLASH_BAD_BLK; UFFS_FLASH_NO_ERR : UFFS_FLASH_BAD_BLK;
return res; return res;
#endif #endif
} }
@ -76,11 +84,13 @@ static int nand_read_page(
return UFFS_FLASH_NO_ERR; return UFFS_FLASH_NO_ERR;
} }
static int nand_write_page( static int nand_write_page(uffs_Device *dev,
uffs_Device *dev, u32 block,
u32 block, u32 page, u32 page,
const u8 *data, int data_len, const u8 *data,
const u8 *spare, int spare_len) int data_len,
const u8 *spare,
int spare_len)
{ {
int res; int res;
@ -136,9 +146,8 @@ const uffs_FlashOps nand_ops =
nand_erase_block, /* EraseBlock() */ nand_erase_block, /* EraseBlock() */
}; };
void uffs_setup_storage( void uffs_setup_storage(struct uffs_StorageAttrSt *attr,
struct uffs_StorageAttrSt *attr, struct rt_mtd_nand_device *nand)
struct rt_mtd_nand_device * nand)
{ {
rt_memset(attr, 0, sizeof(struct uffs_StorageAttrSt)); rt_memset(attr, 0, sizeof(struct uffs_StorageAttrSt));
@ -153,10 +162,11 @@ void uffs_setup_storage(
} }
#elif RT_CONFIG_UFFS_ECC_MODE == UFFS_ECC_HW_AUTO #elif RT_CONFIG_UFFS_ECC_MODE == UFFS_ECC_HW_AUTO
static int WritePageWithLayout(uffs_Device *dev,
static int WritePageWithLayout( u32 block,
uffs_Device *dev, u32 block, u32 page, u32 page,
const u8 *data, int data_len, const u8 *data,
int data_len,
const u8 *ecc, //NULL const u8 *ecc, //NULL
const uffs_TagStore *ts) const uffs_TagStore *ts)
{ {
@ -186,7 +196,6 @@ static int WritePageWithLayout(
dev->st.io_write++; dev->st.io_write++;
return UFFS_FLASH_NO_ERR; return UFFS_FLASH_NO_ERR;
#endif #endif
} }
@ -216,9 +225,11 @@ __error:
return UFFS_FLASH_IO_ERR; return UFFS_FLASH_IO_ERR;
} }
static URET ReadPageWithLayout( static URET ReadPageWithLayout(uffs_Device *dev,
uffs_Device *dev, u32 block, u32 page, u32 block,
u8* data, int data_len, u32 page,
u8 *data,
int data_len,
u8 *ecc, //NULL u8 *ecc, //NULL
uffs_TagStore *ts, uffs_TagStore *ts,
u8 *ecc_store) //NULL u8 *ecc_store) //NULL
@ -304,14 +315,17 @@ const uffs_FlashOps nand_ops =
}; };
static rt_uint8_t hw_flash_data_layout[UFFS_SPARE_LAYOUT_SIZE] = static rt_uint8_t hw_flash_data_layout[UFFS_SPARE_LAYOUT_SIZE] =
{0x05, 0x08, 0xFF, 0x00}; {
0x05, 0x08, 0xFF, 0x00
};
static rt_uint8_t hw_flash_ecc_layout[UFFS_SPARE_LAYOUT_SIZE] = static rt_uint8_t hw_flash_ecc_layout[UFFS_SPARE_LAYOUT_SIZE] =
{0x00, 0x04, 0xFF, 0x00}; {
0x00, 0x04, 0xFF, 0x00
};
void uffs_setup_storage( void uffs_setup_storage(struct uffs_StorageAttrSt *attr,
struct uffs_StorageAttrSt *attr, struct rt_mtd_nand_device *nand)
struct rt_mtd_nand_device * nand)
{ {
rt_memset(attr, 0, sizeof(struct uffs_StorageAttrSt)); rt_memset(attr, 0, sizeof(struct uffs_StorageAttrSt));

View File

@ -3,9 +3,19 @@
* This file is part of Device File System in RT-Thread RTOS * This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2004-2012, RT-Thread Development Team * COPYRIGHT (C) 2004-2012, RT-Thread Development Team
* *
* The license and distribution terms for this file may be * This program is free software; you can redistribute it and/or modify
* found in the file LICENSE in this distribution or at * it under the terms of the GNU General Public License as published by
* http://www.rt-thread.org/license/LICENSE. * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

View File

@ -3,9 +3,19 @@
* This file is part of Device File System in RT-Thread RTOS * This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2004-2012, RT-Thread Development Team * COPYRIGHT (C) 2004-2012, RT-Thread Development Team
* *
* The license and distribution terms for this file may be * This program is free software; you can redistribute it and/or modify
* found in the file LICENSE in this distribution or at * it under the terms of the GNU General Public License as published by
* http://www.rt-thread.org/license/LICENSE. * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

View File

@ -3,9 +3,19 @@
* This file is part of Device File System in RT-Thread RTOS * This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2008-2012, RT-Thread Development Team * COPYRIGHT (C) 2008-2012, RT-Thread Development Team
* *
* The license and distribution terms for this file may be * This program is free software; you can redistribute it and/or modify
* found in the file LICENSE in this distribution or at * it under the terms of the GNU General Public License as published by
* http://www.rt-thread.org/license/LICENSE. * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

View File

@ -3,9 +3,19 @@
* This file is part of Device File System in RT-Thread RTOS * This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2004-2012, RT-Thread Development Team * COPYRIGHT (C) 2004-2012, RT-Thread Development Team
* *
* The license and distribution terms for this file may be * This program is free software; you can redistribute it and/or modify
* found in the file LICENSE in this distribution or at * it under the terms of the GNU General Public License as published by
* http://www.rt-thread.org/license/LICENSE. * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

View File

@ -3,9 +3,19 @@
* This file is part of Device File System in RT-Thread RTOS * This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2004-2012, RT-Thread Development Team * COPYRIGHT (C) 2004-2012, RT-Thread Development Team
* *
* The license and distribution terms for this file may be * This program is free software; you can redistribute it and/or modify
* found in the file LICENSE in this distribution or at * it under the terms of the GNU General Public License as published by
* http://www.rt-thread.org/license/LICENSE. * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

View File

@ -3,9 +3,19 @@
* This file is part of Device File System in RT-Thread RTOS * This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2004-2012, RT-Thread Development Team * COPYRIGHT (C) 2004-2012, RT-Thread Development Team
* *
* The license and distribution terms for this file may be * This program is free software; you can redistribute it and/or modify
* found in the file LICENSE in this distribution or at * it under the terms of the GNU General Public License as published by
* http://www.rt-thread.org/license/LICENSE. * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

View File

@ -3,9 +3,19 @@
* This file is part of Device File System in RT-Thread RTOS * This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2004-2012, RT-Thread Development Team * COPYRIGHT (C) 2004-2012, RT-Thread Development Team
* *
* The license and distribution terms for this file may be * This program is free software; you can redistribute it and/or modify
* found in the file LICENSE in this distribution or at * it under the terms of the GNU General Public License as published by
* http://www.rt-thread.org/license/LICENSE. * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

View File

@ -3,9 +3,19 @@
* This file is part of Device File System in RT-Thread RTOS * This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2004-2012, RT-Thread Development Team * COPYRIGHT (C) 2004-2012, RT-Thread Development Team
* *
* The license and distribution terms for this file may be * This program is free software; you can redistribute it and/or modify
* found in the file LICENSE in this distribution or at * it under the terms of the GNU General Public License as published by
* http://www.rt-thread.org/license/LICENSE. * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

View File

@ -3,9 +3,19 @@
* This file is part of Device File System in RT-Thread RTOS * This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2004-2011, RT-Thread Development Team * COPYRIGHT (C) 2004-2011, RT-Thread Development Team
* *
* The license and distribution terms for this file may be * This program is free software; you can redistribute it and/or modify
* found in the file LICENSE in this distribution or at * it under the terms of the GNU General Public License as published by
* http://www.rt-thread.org/license/LICENSE. * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

View File

@ -3,9 +3,19 @@
* This file is part of Device File System in RT-Thread RTOS * This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2004-2012, RT-Thread Development Team * COPYRIGHT (C) 2004-2012, RT-Thread Development Team
* *
* The license and distribution terms for this file may be * This program is free software; you can redistribute it and/or modify
* found in the file LICENSE in this distribution or at * it under the terms of the GNU General Public License as published by
* http://www.rt-thread.org/license/LICENSE. * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes

View File

@ -3,9 +3,19 @@
* This file is part of Device File System in RT-Thread RTOS * This file is part of Device File System in RT-Thread RTOS
* COPYRIGHT (C) 2004-2012, RT-Thread Development Team * COPYRIGHT (C) 2004-2012, RT-Thread Development Team
* *
* The license and distribution terms for this file may be * This program is free software; you can redistribute it and/or modify
* found in the file LICENSE in this distribution or at * it under the terms of the GNU General Public License as published by
* http://www.rt-thread.org/license/LICENSE. * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes