mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-11-09 20:45:41 +08:00
update jffs2 to use MTD device.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1938 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
1 parent
eedd490bd6
commit
a5e0a4526a
17 files changed
+152
-475
No files matched your search
@@ -438,7 +438,7 @@ __externC void cyg_selwakeup( struct CYG_SELINFO_TAG *sip );
|
||||
// Provides the current time as a time_t timestamp for use in filesystem
|
||||
// data strucures.
|
||||
|
||||
__externC time_t cyg_timestamp(void);
|
||||
__externC time_t jffs2_get_timestamp(void);
|
||||
|
||||
//=============================================================================
|
||||
// Miscellaneous functions.
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
* 2012-1-7 prife the first version
|
||||
*/
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
|
||||
#include "cyg/infra/cyg_type.h"
|
||||
#include "cyg/fileio/fileio.h"
|
||||
@@ -22,13 +23,10 @@
|
||||
#include <dfs_def.h>
|
||||
|
||||
#include "dfs_jffs2.h"
|
||||
#include "jffs2_config.h"
|
||||
#include "porting.h"
|
||||
#include <string.h>
|
||||
|
||||
#define FILE_PATH_MAX 256 /* the longest file path */
|
||||
|
||||
#define DEVICE_PART_MAX 1 /* the max partions on a nand deivce*/
|
||||
|
||||
#if DEVICE_PART_MAX > 1
|
||||
#error "support only one jffs2 partition on a flash device!"
|
||||
#endif
|
||||
@@ -36,7 +34,7 @@
|
||||
/* make sure the following struct var had been initilased to 0! */ //fixme
|
||||
struct device_part
|
||||
{
|
||||
rt_device_t dev;
|
||||
struct rt_mtd_device *dev;
|
||||
struct cyg_mtab_entry * mte;
|
||||
};
|
||||
static struct device_part device_partition[DEVICE_PART_MAX] = {0};
|
||||
@@ -132,7 +130,6 @@ static int jffs2_result_to_dfs(int result)
|
||||
/*
|
||||
* RT-Thread DFS Interface for jffs2
|
||||
*/
|
||||
|
||||
static int dfs_jffs2_mount(struct dfs_filesystem* fs,
|
||||
unsigned long rwflag,
|
||||
const void* data)
|
||||
@@ -164,7 +161,7 @@ static int dfs_jffs2_mount(struct dfs_filesystem* fs,
|
||||
*/
|
||||
mte->data = (CYG_ADDRWORD)fs->dev_id;
|
||||
|
||||
device_partition[index].dev = fs->dev_id;
|
||||
device_partition[index].dev = RT_MTD_DEVICE(fs->dev_id);
|
||||
/* after jffs2_mount, mte->data will not be dev_id any more */
|
||||
result = jffs2_mount(NULL, mte);
|
||||
if (result != 0)
|
||||
@@ -182,7 +179,7 @@ static int _find_fs(struct cyg_mtab_entry ** mte, rt_device_t dev_id)
|
||||
/* find device index */
|
||||
for (index = 0; index < DEVICE_PART_MAX; index++)
|
||||
{
|
||||
if (device_partition[index].dev == dev_id)
|
||||
if (device_partition[index].dev == RT_MTD_DEVICE(dev_id))
|
||||
{
|
||||
*mte = device_partition[index].mte;
|
||||
return 0;
|
||||
@@ -199,7 +196,7 @@ static int dfs_jffs2_unmount(struct dfs_filesystem* fs)
|
||||
/* find device index, then umount it */
|
||||
for (index = 0; index < DEVICE_PART_MAX; index++)
|
||||
{
|
||||
if (device_partition[index].dev == fs->dev_id)
|
||||
if (device_partition[index].dev == RT_MTD_DEVICE(fs->dev_id))
|
||||
{
|
||||
result = jffs2_umount(device_partition[index].mte);
|
||||
if (result)
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
|
||||
#define __ECOS /* must be defined */
|
||||
|
||||
#define FILE_PATH_MAX 256 /* the longest file path */
|
||||
|
||||
#define DEVICE_PART_MAX 1 /* the max partions on a nand deivce*/
|
||||
|
||||
#define CYGPKG_FS_JFFS2_RET_DIRENT_DTYPE /* should be enabled */
|
||||
#if defined(CYGPKG_FS_JFFS2_RET_DIRENT_DTYPE)
|
||||
#define CYGPKG_FILEIO_DIRENT_DTYPE
|
||||
@@ -11,7 +15,7 @@
|
||||
#define CYGOPT_FS_JFFS2_WRITE /* if not defined, jffs2 is read only*/
|
||||
|
||||
/* jffs2 debug output opion */
|
||||
#define CONFIG_JFFS2_FS_DEBUG 0 /* 1 or 2 */
|
||||
#define CONFIG_JFFS2_FS_DEBUG 0 /* 1 or 2 */
|
||||
|
||||
/* jffs2 gc thread section */
|
||||
#define CYGOPT_FS_JFFS2_GCTHREAD
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#define PTR_ERR(err) ((unsigned long)(err))
|
||||
#define IS_ERR(err) ((unsigned long)err > (unsigned long)-1000L)
|
||||
|
||||
#define CURRENT_TIME cyg_timestamp()
|
||||
#define CURRENT_TIME jffs2_get_timestamp()
|
||||
|
||||
#define KERN_EMERG "<0>" // system is unusable
|
||||
#define KERN_ALERT "<1>" // action must be taken immediately
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
|
||||
#include <asm/page.h> /* Don't ask. Linux headers are a mess. */
|
||||
|
||||
#define kmalloc(x, y) malloc(x)
|
||||
#define kfree(x) free(x)
|
||||
#define vmalloc(x) malloc(x)
|
||||
#define vfree(x) free(x)
|
||||
#define kmalloc(x, y) rt_malloc(x)
|
||||
#define kfree(x) rt_free(x)
|
||||
#define vmalloc(x) rt_malloc(x)
|
||||
#define vfree(x) rt_free(x)
|
||||
|
||||
#endif /* __LINUX_SLAB_H__ */
|
||||
|
||||
@@ -1,113 +0,0 @@
|
||||
#ifndef CYGONCE_PKGCONF_INFRA_H
|
||||
# define CYGONCE_PKGCONF_INFRA_H
|
||||
|
||||
//======================================================================
|
||||
//
|
||||
// infra.h
|
||||
//
|
||||
// Host side implementation of the infrastructure configuration
|
||||
// header.
|
||||
//
|
||||
//======================================================================
|
||||
// ####ECOSHOSTGPLCOPYRIGHTBEGIN####
|
||||
// -------------------------------------------
|
||||
// This file is part of the eCos host tools.
|
||||
// Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
//
|
||||
// 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 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.
|
||||
// -------------------------------------------
|
||||
// ####ECOSHOSTGPLCOPYRIGHTEND####
|
||||
//======================================================================
|
||||
//#####DESCRIPTIONBEGIN####
|
||||
//
|
||||
// Author(s): bartv
|
||||
// Contact(s): bartv
|
||||
// Date: 1998/07/13
|
||||
// Version: 0.01
|
||||
//
|
||||
//####DESCRIPTIONEND####
|
||||
//======================================================================
|
||||
|
||||
// The purpose of this header file is to replicate appropriate
|
||||
// functionality from the target-side header file <pkgconf/infra.h>.
|
||||
// This header file is intended to contain configuration options
|
||||
// related to the implementation of the infrastructure, as opposed
|
||||
// to how that infrastructure gets used by other packages. A good
|
||||
// example would be a configuration option to control the size
|
||||
// of the circular trace buffer.
|
||||
//
|
||||
// On the host side these things are handled by autoconf, and in
|
||||
// particular the configure.in script will offer command-line
|
||||
// arguments allowing the relevant options to be controlled.
|
||||
// The relevant information will end up in <cyg/pkgconf/hostinfra.h>
|
||||
# include <pkgconf/hostinfra.h>
|
||||
|
||||
// Some options should always be enabled in this header file.
|
||||
#define CYGDBG_INFRA_DIAG_PRINTF_USE_VARARG
|
||||
#define CYGDBG_INFRA_DEBUG_ASSERT_MESSAGE
|
||||
#define CYGDBG_INFRA_DEBUG_TRACE_MESSAGE
|
||||
|
||||
// Other options should be decided on a package by package basis,
|
||||
// e.g. whether or not assertions are used. On the host side it is
|
||||
// not appropriate to control these globally, instead the infrastructure
|
||||
// always provides the necessary functionality and it is up to the
|
||||
// other parts of the system to decide whether or not the facilities
|
||||
// get used.
|
||||
|
||||
// A third set of options deal with the environment, e.g. the sizes
|
||||
// of various data types. autoconf macros take care of most of the
|
||||
// work, but some translation is needed into eCos-style names to
|
||||
// avoid namespace pollution.
|
||||
|
||||
// Process the definitions of SIZEOF_INT_P and SIZEOF_LONG to work
|
||||
// out a sensible data type for CYG_ADDRESS and CYG_ADDRWORD.
|
||||
|
||||
#if (!defined(SIZEOF_INT_P) || !defined(SIZEOF_LONG))
|
||||
# error "Configure problem: data type sizes not set"
|
||||
#endif
|
||||
|
||||
#if (SIZEOF_INT_P == 4)
|
||||
// The default, nothing needs to be done
|
||||
#elif (SIZEOF_INT_P == 8)
|
||||
# define cyg_haladdress cyg_halint64
|
||||
#else
|
||||
# error "Only 32 and 64 bit pointers are supported"
|
||||
#endif
|
||||
|
||||
#if ((SIZEOF_INT_P == 4) && (SIZEOF_LONG == 4))
|
||||
// The default, nothing needs to be done
|
||||
#elif ((SIZEOF_INT_P <= 8) && (SIZEOF_LONG <= 8))
|
||||
// cyg_halint64 will have been defined appropriately.
|
||||
# define cyg_haladdrword cyg_halint64
|
||||
#else
|
||||
# error "Only 32 and 64 bit machine word sizes are supported"
|
||||
#endif
|
||||
|
||||
// Any symbols defined in <pkgconf/hostconf.h> which have been processed
|
||||
// here should no longer be of any interest, and in the interests of
|
||||
// reducing name space pollution they get undef'ed here.
|
||||
|
||||
// In addition there are two #define's in the config.h header file
|
||||
// which are always present and which have names that are rather too
|
||||
// generic. These get removed here as well. The version is worth
|
||||
// preserving under a different name.
|
||||
#undef SIZEOF_INT_P
|
||||
#undef SIZEOF_LONG
|
||||
#undef PACKAGE
|
||||
#undef VERSION
|
||||
|
||||
#endif // CYGONCE_PKGCONF_INFRA_H
|
||||
// End of infra.h
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "porting.h"
|
||||
|
||||
time_t cyg_timestamp(void)
|
||||
time_t jffs2_get_timestamp(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -42,8 +42,9 @@ extern cyg_fileops jffs2_fileops;
|
||||
extern cyg_fileops jffs2_dirops;
|
||||
extern struct cyg_fstab_entry jffs2_fste;
|
||||
|
||||
extern void jffs2_get_info_from_sb(void * data, struct jffs2_fs_info * info);
|
||||
extern int jffs2_porting_stat(cyg_mtab_entry * mte, cyg_dir dir, const char *name,
|
||||
time_t jffs2_get_timestamp(void);
|
||||
void jffs2_get_info_from_sb(void * data, struct jffs2_fs_info * info);
|
||||
int jffs2_porting_stat(cyg_mtab_entry * mte, cyg_dir dir, const char *name,
|
||||
void * stat_buf);
|
||||
|
||||
#endif
|
||||
@@ -1,20 +0,0 @@
|
||||
#include <stdio.h>
|
||||
//#include <io.h>
|
||||
//#include <fcntl.h>
|
||||
//#include <sys/stat.h>
|
||||
#include "flash.h"
|
||||
int file_handle;
|
||||
int FLASH_SIZE;
|
||||
int flash_file_init(void)
|
||||
{
|
||||
// file_handle = open(FILE_NAME, O_RDWR |O_BINARY| O_CREAT, S_IREAD | S_IWRITE);
|
||||
// if(file_handle >= 0) {
|
||||
// printf("read file ok\n");
|
||||
// } else {
|
||||
// printf("read file error\n");
|
||||
// return -1;
|
||||
// }
|
||||
// FLASH_SIZE = lseek(file_handle, 0, SEEK_END) ;// / BLOCK_SIZE * BLOCK_SIZE; /*È¡ÕûÊý*/
|
||||
// printf("the size of jffs bin file is %d", FLASH_SIZE);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
#include <linux/kernel.h>
|
||||
#include "nodelist.h"
|
||||
#include <linux/pagemap.h>
|
||||
#include <linux/crc32.h>
|
||||
#include "compr.h"
|
||||
//#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
|
||||
|
||||
extern struct cyg_fstab_entry jffs2_fste;
|
||||
|
||||
MTAB_ENTRY(jffs2_mte,
|
||||
"/",
|
||||
"jffs2",
|
||||
NULL,
|
||||
0);
|
||||
|
||||
#include "flash.h"
|
||||
extern int file_handle;
|
||||
extern int FLASH_SIZE;
|
||||
extern int flash_file_init(void);
|
||||
|
||||
extern int jffs2_mount(cyg_fstab_entry * fste, cyg_mtab_entry * mte);
|
||||
|
||||
|
||||
extern int jffs2_open(cyg_mtab_entry * mte, cyg_dir dir, const char *name,
|
||||
int mode, cyg_file * file);
|
||||
extern int jffs2_fo_read(struct CYG_FILE_TAG *fp, struct CYG_UIO_TAG *uio);
|
||||
|
||||
char buffer[1024];
|
||||
int jffs2_main()
|
||||
{
|
||||
int res;
|
||||
cyg_file file;
|
||||
struct CYG_UIO_TAG uio_s;
|
||||
struct CYG_IOVEC_TAG iovec;
|
||||
// res = flash_file_init();
|
||||
if (res != 0)
|
||||
goto out;
|
||||
|
||||
//mount file system
|
||||
res = jffs2_mount(&jffs2_fste, &jffs2_mte);
|
||||
if (res < 0)
|
||||
{
|
||||
printf("jffs2_mount error!\n");
|
||||
goto out;
|
||||
}
|
||||
printf("jffs2 mount ok!\n");
|
||||
|
||||
|
||||
//read a file or dirs "src/dfs.c"
|
||||
//res = jffs2_open(&jffs2_mte, 0, "dfs_uffs.c", O_RDWR, &file);
|
||||
//res = jffs2_open(&jffs2_mte, 0, "SConscript", O_RDWR, &file);
|
||||
// res = jffs2_open(&jffs2_mte, 0, "filesystems/devfs/console.c" , O_RDWR, &file);
|
||||
if (res != 0)
|
||||
{
|
||||
printf("jffs2_open file error: %d", res);
|
||||
goto out;
|
||||
}
|
||||
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
uio_s.uio_iov = &iovec;
|
||||
uio_s.uio_iov->iov_base = buffer;
|
||||
uio_s.uio_iov->iov_len = 1024;
|
||||
uio_s.uio_iovcnt = 1; //must be 1
|
||||
//uio_s.uio_offset //not used...
|
||||
uio_s.uio_resid = uio_s.uio_iov->iov_len; //seem no use in ecos;
|
||||
//uio_s.uio_segflg = UIO_USERSPACE;
|
||||
//uio_s.uio_rw = ;
|
||||
|
||||
res = jffs2_fo_read(&file, &uio_s);
|
||||
if (res != 0)
|
||||
{
|
||||
printf("jffs2_fo_read file error: %d", res);
|
||||
goto out;
|
||||
}
|
||||
printf("\n\n=====================================================================\n");
|
||||
printf("the uffs/dfs_uffs.c file content is:\n\n");
|
||||
printf("%s", buffer);
|
||||
|
||||
out:
|
||||
#if defined (MSVC)
|
||||
printf("\n\npress any key to colose this console...\n");
|
||||
getch();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
Whitespace-only changes.
@@ -21,7 +21,6 @@
|
||||
struct _inode *jffs2_lookup(struct _inode *dir_i, const unsigned char *d_name, int namelen)
|
||||
{
|
||||
struct jffs2_inode_info *dir_f;
|
||||
struct jffs2_sb_info *c;
|
||||
struct jffs2_full_dirent *fd = NULL, *fd_list;
|
||||
uint32_t ino = 0;
|
||||
uint32_t hash = full_name_hash(d_name, namelen);
|
||||
@@ -30,7 +29,6 @@ struct _inode *jffs2_lookup(struct _inode *dir_i, const unsigned char *d_name, i
|
||||
D1(printk("jffs2_lookup()\n"));
|
||||
|
||||
dir_f = JFFS2_INODE_INFO(dir_i);
|
||||
c = JFFS2_SB_INFO(dir_i->i_sb);
|
||||
|
||||
down(&dir_f->sem);
|
||||
|
||||
@@ -242,7 +240,7 @@ int jffs2_mkdir (struct _inode *dir_i, const unsigned char *d_name, int mode)
|
||||
rd->pino = cpu_to_je32(dir_i->i_ino);
|
||||
rd->version = cpu_to_je32(++dir_f->highest_version);
|
||||
rd->ino = cpu_to_je32(inode->i_ino);
|
||||
rd->mctime = cpu_to_je32(cyg_timestamp());
|
||||
rd->mctime = cpu_to_je32(jffs2_get_timestamp());
|
||||
rd->nsize = namelen;
|
||||
rd->type = DT_DIR;
|
||||
rd->node_crc = cpu_to_je32(crc32(0, rd, sizeof(*rd)-8));
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -21,62 +21,62 @@
|
||||
|
||||
struct jffs2_full_dirent *jffs2_alloc_full_dirent(int namesize)
|
||||
{
|
||||
return malloc(sizeof(struct jffs2_full_dirent) + namesize);
|
||||
return rt_malloc(sizeof(struct jffs2_full_dirent) + namesize);
|
||||
}
|
||||
|
||||
void jffs2_free_full_dirent(struct jffs2_full_dirent *x)
|
||||
{
|
||||
free(x);
|
||||
rt_free(x);
|
||||
}
|
||||
|
||||
struct jffs2_full_dnode *jffs2_alloc_full_dnode(void)
|
||||
{
|
||||
return malloc(sizeof(struct jffs2_full_dnode));
|
||||
return rt_malloc(sizeof(struct jffs2_full_dnode));
|
||||
}
|
||||
|
||||
void jffs2_free_full_dnode(struct jffs2_full_dnode *x)
|
||||
{
|
||||
free(x);
|
||||
rt_free(x);
|
||||
}
|
||||
|
||||
struct jffs2_raw_dirent *jffs2_alloc_raw_dirent(void)
|
||||
{
|
||||
return malloc(sizeof(struct jffs2_raw_dirent));
|
||||
return rt_malloc(sizeof(struct jffs2_raw_dirent));
|
||||
}
|
||||
|
||||
void jffs2_free_raw_dirent(struct jffs2_raw_dirent *x)
|
||||
{
|
||||
free(x);
|
||||
rt_free(x);
|
||||
}
|
||||
|
||||
struct jffs2_raw_inode *jffs2_alloc_raw_inode(void)
|
||||
{
|
||||
return malloc(sizeof(struct jffs2_raw_inode));
|
||||
return rt_malloc(sizeof(struct jffs2_raw_inode));
|
||||
}
|
||||
|
||||
void jffs2_free_raw_inode(struct jffs2_raw_inode *x)
|
||||
{
|
||||
free(x);
|
||||
rt_free(x);
|
||||
}
|
||||
|
||||
struct jffs2_tmp_dnode_info *jffs2_alloc_tmp_dnode_info(void)
|
||||
{
|
||||
return malloc(sizeof(struct jffs2_tmp_dnode_info));
|
||||
return rt_malloc(sizeof(struct jffs2_tmp_dnode_info));
|
||||
}
|
||||
|
||||
void jffs2_free_tmp_dnode_info(struct jffs2_tmp_dnode_info *x)
|
||||
{
|
||||
free(x);
|
||||
rt_free(x);
|
||||
}
|
||||
|
||||
struct jffs2_node_frag *jffs2_alloc_node_frag(void)
|
||||
{
|
||||
return malloc(sizeof(struct jffs2_node_frag));
|
||||
return rt_malloc(sizeof(struct jffs2_node_frag));
|
||||
}
|
||||
|
||||
void jffs2_free_node_frag(struct jffs2_node_frag *x)
|
||||
{
|
||||
free(x);
|
||||
rt_free(x);
|
||||
}
|
||||
|
||||
#if CYGNUM_FS_JFFS2_RAW_NODE_REF_CACHE_POOL_SIZE == 0
|
||||
@@ -92,12 +92,12 @@ void jffs2_destroy_slab_caches(void)
|
||||
|
||||
struct jffs2_raw_node_ref *jffs2_alloc_raw_node_ref(void)
|
||||
{
|
||||
return malloc(sizeof(struct jffs2_raw_node_ref));
|
||||
return rt_malloc(sizeof(struct jffs2_raw_node_ref));
|
||||
}
|
||||
|
||||
void jffs2_free_raw_node_ref(struct jffs2_raw_node_ref *x)
|
||||
{
|
||||
free(x);
|
||||
rt_free(x);
|
||||
}
|
||||
|
||||
#else // CYGNUM_FS_JFFS2_RAW_NODE_REF_CACHE_POOL_SIZE == 0
|
||||
@@ -150,7 +150,7 @@ void jffs2_free_raw_node_ref(struct jffs2_raw_node_ref *x)
|
||||
|
||||
struct jffs2_inode_cache *jffs2_alloc_inode_cache(void)
|
||||
{
|
||||
struct jffs2_inode_cache *ret = malloc(sizeof(struct jffs2_inode_cache));
|
||||
struct jffs2_inode_cache *ret = rt_malloc(sizeof(struct jffs2_inode_cache));
|
||||
D1(printk(KERN_DEBUG "Allocated inocache at %p\n", ret));
|
||||
return ret;
|
||||
}
|
||||
@@ -158,6 +158,6 @@ struct jffs2_inode_cache *jffs2_alloc_inode_cache(void)
|
||||
void jffs2_free_inode_cache(struct jffs2_inode_cache *x)
|
||||
{
|
||||
D1(printk(KERN_DEBUG "Freeing inocache at %p\n", x));
|
||||
free(x);
|
||||
rt_free(x);
|
||||
}
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
#define __JFFS2_OS_ECOS_H__
|
||||
#include "jffs2_config.h"
|
||||
#include <rtthread.h>
|
||||
#define malloc rt_malloc
|
||||
#define free rt_free
|
||||
#define printf rt_kprintf
|
||||
|
||||
//#include <pkgconf/fs_jffs2.h>
|
||||
@@ -117,7 +115,7 @@ static inline unsigned int full_name_hash(const unsigned char * name, unsigned i
|
||||
#define JFFS2_F_I_RDEV_MIN(f) ((OFNI_EDONI_2SFFJ(f)->i_rdev)&0xff)
|
||||
#define JFFS2_F_I_RDEV_MAJ(f) ((OFNI_EDONI_2SFFJ(f)->i_rdev)>>8)
|
||||
|
||||
#define get_seconds cyg_timestamp
|
||||
#define get_seconds jffs2_get_timestamp
|
||||
|
||||
struct _inode {
|
||||
cyg_uint32 i_ino;
|
||||
@@ -215,13 +213,13 @@ uint32_t jffs2_to_os_mode (uint32_t jmode);
|
||||
|
||||
|
||||
/* flashio.c */
|
||||
cyg_bool jffs2_flash_read(struct jffs2_sb_info *c, cyg_uint32 read_buffer_offset,
|
||||
int jffs2_flash_read(struct jffs2_sb_info *c, cyg_uint32 read_buffer_offset,
|
||||
const size_t size, size_t * return_size, unsigned char * write_buffer);
|
||||
cyg_bool jffs2_flash_write(struct jffs2_sb_info *c, cyg_uint32 write_buffer_offset,
|
||||
int jffs2_flash_write(struct jffs2_sb_info *c, cyg_uint32 write_buffer_offset,
|
||||
const size_t size, size_t * return_size, unsigned char * read_buffer);
|
||||
int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct iovec *vecs,
|
||||
unsigned long count, loff_t to, size_t *retlen);
|
||||
cyg_bool jffs2_flash_erase(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
|
||||
int jffs2_flash_erase(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
|
||||
|
||||
// dir-ecos.c
|
||||
struct _inode *jffs2_lookup(struct _inode *dir_i, const unsigned char *name, int namelen);
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
#define __JFFS2_OS_RTTHREAD_H__
|
||||
#include "jffs2_config.h"
|
||||
#include <rtthread.h>
|
||||
#define free rt_free
|
||||
#define printf rt_kprintf
|
||||
#define printf rt_kprintf
|
||||
|
||||
//#include <pkgconf/fs_jffs2.h>
|
||||
@@ -115,7 +113,7 @@ static inline unsigned int full_name_hash(const unsigned char * name, unsigned i
|
||||
#define JFFS2_F_I_RDEV_MIN(f) ((OFNI_EDONI_2SFFJ(f)->i_rdev)&0xff)
|
||||
#define JFFS2_F_I_RDEV_MAJ(f) ((OFNI_EDONI_2SFFJ(f)->i_rdev)>>8)
|
||||
|
||||
#define get_seconds cyg_timestamp
|
||||
#define get_seconds jffs2_get_timestamp
|
||||
|
||||
struct _inode {
|
||||
cyg_uint32 i_ino;
|
||||
@@ -213,13 +211,13 @@ uint32_t jffs2_to_os_mode (uint32_t jmode);
|
||||
|
||||
|
||||
/* flashio.c */
|
||||
cyg_bool jffs2_flash_read(struct jffs2_sb_info *c, cyg_uint32 read_buffer_offset,
|
||||
int jffs2_flash_read(struct jffs2_sb_info *c, cyg_uint32 read_buffer_offset,
|
||||
const size_t size, size_t * return_size, unsigned char * write_buffer);
|
||||
cyg_bool jffs2_flash_write(struct jffs2_sb_info *c, cyg_uint32 write_buffer_offset,
|
||||
int jffs2_flash_write(struct jffs2_sb_info *c, cyg_uint32 write_buffer_offset,
|
||||
const size_t size, size_t * return_size, unsigned char * read_buffer);
|
||||
int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct iovec *vecs,
|
||||
unsigned long count, loff_t to, size_t *retlen);
|
||||
cyg_bool jffs2_flash_erase(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
|
||||
int jffs2_flash_erase(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
|
||||
|
||||
// dir-ecos.c
|
||||
struct _inode *jffs2_lookup(struct _inode *dir_i, const unsigned char *name, int namelen);
|
||||
|
||||
Reference in new issue
Block a user