diff --git a/components/dfs/filesystems/uffs/src/emu/helper_cmds.c b/components/dfs/filesystems/uffs/src/emu/helper_cmds.c index d0ad30419..6fe951a17 100644 --- a/components/dfs/filesystems/uffs/src/emu/helper_cmds.c +++ b/components/dfs/filesystems/uffs/src/emu/helper_cmds.c @@ -533,16 +533,52 @@ fail: return ret; } -/** show mount table - * mount +/** mount partition or show mounted partitions + * mount [] */ static int cmd_mount(int argc, char *argv[]) { - uffs_MountTable *tab = uffs_GetMountTable(); + uffs_MountTable *tab; + const char *mount = NULL; - while (tab) { - MSGLN(" %s : (%d) ~ (%d)", tab->mount, tab->start_block, tab->end_block); - tab = tab->next; + if (argc == 1) { + tab = uffs_MtbGetMounted(); + while (tab) { + MSG(" %s : (%d) ~ (%d)\n", tab->mount, tab->start_block, tab->end_block); + tab = tab->next; + } + } + else { + mount = argv[1]; + if (uffs_Mount(mount) < 0) { + MSGLN("Can't mount %s", mount); + return -1; + } + } + return 0; +} + +/** unmount parition or show unmounted partitions + * umount [] + */ +static int cmd_unmount(int argc, char *argv[]) +{ + uffs_MountTable *tab; + const char *mount = NULL; + + if (argc == 1) { + tab = uffs_MtbGetUnMounted(); + while (tab) { + MSG(" %s : (%d) ~ (%d)\n", tab->mount, tab->start_block, tab->end_block); + tab = tab->next; + } + } + else { + mount = argv[1]; + if (uffs_UnMount(mount) < 0) { + MSGLN("Can't unmount %s", mount); + return -1; + } } return 0; @@ -640,7 +676,8 @@ static const struct cli_command helper_cmds[] = { cmd_cat, "cat", "", "show file content" }, { cmd_pwd, "pwd", NULL, "show current dir" }, { cmd_cd, "cd", "", "change current dir" }, - { cmd_mount, "mount", NULL, "list mounted file systems" }, + { cmd_mount, "mount", "[]", "mount partition or list mounted partitions" }, + { cmd_unmount, "umount", "[]", "unmount partition" }, { cmd_dump, "dump", "[]", "dump file system", }, { cmd_wl, "wl", "[]", "show block wear-leveling info", }, { cmd_inspb, "inspb", "[]", "inspect buffer", }, diff --git a/components/dfs/filesystems/uffs/src/emu/tags b/components/dfs/filesystems/uffs/src/emu/tags deleted file mode 100644 index 8800146b0..000000000 --- a/components/dfs/filesystems/uffs/src/emu/tags +++ /dev/null @@ -1,207 +0,0 @@ -!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ -!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ -!_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/ -!_TAG_PROGRAM_NAME Exuberant Ctags // -!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/ -!_TAG_PROGRAM_VERSION 5.8 // -BOOL cmdline.h 38;" d -CHK_ARGC cmdline.h 77;" d -CLI_INVALID_ARG cmdline.h 48;" d -CountObjectUnder helper_cmds.c /^static int CountObjectUnder(const char *dir)$/;" f file: -DoTest2 test_cmds.c /^static URET DoTest2(void)$/;" f file: -FALSE cmdline.h 45;" d -FILEEMU_ERASE_BAD_BLOCKS uffs_fileem_wrap.c 66;" d file: -FILEEMU_STOCK_BAD_BLOCKS uffs_fileem_wrap.c 65;" d file: -FILEEMU_WRITE_BIT_FLIP uffs_fileem_wrap.c 69;" d file: -FOR_EACH_CLI_CMD cmdline.c 74;" d file: -GBIT test_cmds.c 657;" d file: -InjectBitFlip uffs_fileem_wrap.c /^static void InjectBitFlip(uffs_Device *dev, u32 block, u32 page)$/;" f file: -MAX_CLI_ARGS_BUF_LEN cmdline.c 52;" d file: -MAX_CLI_ARGS_NUM cmdline.c 53;" d file: -MAX_CLI_ENV_NUM cmdline.c 54;" d file: -MAX_PATH_LENGTH helper_cmds.c 56;" d file: -MAX_TEST_BUF_LEN test_cmds.c 54;" d file: -MSG cmdline.c 50;" d file: -MSG helper_cmds.c 59;" d file: -MSG test_cmds.c 59;" d file: -MSG uffs_fileem.c 49;" d file: -MSG uffs_fileem_ecc_hw.c 53;" d file: -MSG uffs_fileem_ecc_hw_auto.c 64;" d file: -MSG uffs_fileem_ecc_soft.c 49;" d file: -MSG uffs_fileem_wrap.c 51;" d file: -MSGLN cmdline.c 49;" d file: -MSGLN helper_cmds.c 58;" d file: -MSGLN test_cmds.c 60;" d file: -MSGLN uffs_fileem.c 50;" d file: -MSGLN uffs_fileem_ecc_hw.c 54;" d file: -MSGLN uffs_fileem_ecc_hw_auto.c 65;" d file: -MSGLN uffs_fileem_ecc_soft.c 50;" d file: -MSGLN uffs_fileem_wrap.c 50;" d file: -NUM_PER_LINE helper_cmds.c 585;" d file: -PAGE_DATA_SIZE uffs_fileem_ecc_hw_auto.c 68;" d file: -PAGE_DATA_WRITE_COUNT_LIMIT uffs_fileem.h 54;" d -PAGE_FULL_SIZE uffs_fileem_ecc_hw_auto.c 70;" d file: -PAGE_SPARE_SIZE uffs_fileem_ecc_hw_auto.c 69;" d file: -PAGE_SPARE_WRITE_COUNT_LIMIT uffs_fileem.h 55;" d -PFX cmdline.c 48;" d file: -PFX helper_cmds.c 54;" d file: -PFX test_cmds.c 52;" d file: -PFX uffs_fileem.c 48;" d file: -PFX uffs_fileem_ecc_hw.c 52;" d file: -PFX uffs_fileem_ecc_hw_auto.c 63;" d file: -PFX uffs_fileem_ecc_soft.c 48;" d file: -PFX uffs_fileem_share.c 48;" d file: -PFX uffs_fileem_wrap.c 49;" d file: -PROMPT cmdline.c 46;" d file: -RS_ECC_SIZE uffs_fileem_ecc_hw_auto.c 67;" d file: -SBIT test_cmds.c 656;" d file: -SEQ_INIT test_cmds.c 56;" d file: -SEQ_MOD_LEN test_cmds.c 57;" d file: -TRUE cmdline.h 42;" d -UFFS_FEMU_ENABLE_INJECTION uffs_fileem.h 48;" d -UFFS_FEMU_FILE_NAME uffs_fileem.h 44;" d -UFFS_FEMU_MAX_BLOCKS uffs_fileem.h 46;" d -_UFFS_CLI_H_ cmdline.h 35;" d -_UFFS_FILEEM_H_ uffs_fileem.h 40;" d -_buf cmdline.c /^ char _buf[MAX_CLI_ARGS_BUF_LEN];$/;" m struct:cli_arg file: -argc cmdline.c /^ int argc;$/;" m struct:cli_arg file: -args cmdline.h /^ const char *args;$/;" m struct:cli_command -argv cmdline.c /^ char *argv[MAX_CLI_ARGS_NUM];$/;" m struct:cli_arg file: -block uffs_fileem_wrap.c /^ int block;$/;" m struct:uffs_FileEmuBitFlip file: -check_cmd cmdline.c /^static BOOL check_cmd(const char *cmds, const char *cmd)$/;" f file: -check_entry_exist test_cmds.c /^static UBOOL check_entry_exist(const char *name)$/;" f file: -cli_add_commandset cmdline.c /^void cli_add_commandset(struct cli_commandset *set)$/;" f -cli_arg cmdline.c /^struct cli_arg {$/;" s file: -cli_command cmdline.h /^struct cli_command {$/;" s -cli_commandset cmdline.h /^struct cli_commandset {$/;" s -cli_env_get cmdline.c /^int cli_env_get(char env)$/;" f -cli_env_set cmdline.c /^int cli_env_set(char env, int val)$/;" f -cli_env_to_idx cmdline.c /^static int cli_env_to_idx(char env)$/;" f file: -cli_find cmdline.c /^static const struct cli_command * cli_find(const char *cmd)$/;" f file: -cli_interpret cmdline.c /^int cli_interpret(const char *line)$/;" f -cli_main_entry cmdline.c /^void cli_main_entry()$/;" f -cli_parse_args cmdline.c /^static void cli_parse_args(const char *cmd, struct cli_arg *arg)$/;" f file: -cli_process_line cmdline.c /^static char * cli_process_line(char *p)$/;" f file: -cmd cmdline.h /^ const char *cmd;$/;" m struct:cli_command -cmd_TestFormat test_cmds.c /^static int cmd_TestFormat(int argc, char *argv[])$/;" f file: -cmd_TestPageReadWrite test_cmds.c /^static int cmd_TestPageReadWrite(int argc, char *argv[])$/;" f file: -cmd_TestPopulateFiles test_cmds.c /^static int cmd_TestPopulateFiles(int argc, char *argv[])$/;" f file: -cmd_VerifyFile test_cmds.c /^static int cmd_VerifyFile(int argc, char *argv[])$/;" f file: -cmd_abort cmdline.c /^static int cmd_abort(int argc, char *argv[])$/;" f file: -cmd_apisrv test_cmds.c /^static int cmd_apisrv(int argc, char *argv[])$/;" f file: -cmd_cat helper_cmds.c /^static int cmd_cat(int argc, char *argv[])$/;" f file: -cmd_cd helper_cmds.c /^static int cmd_cd(int argc, char *argv[])$/;" f file: -cmd_cp helper_cmds.c /^static int cmd_cp(int argc, char *argv[])$/;" f file: -cmd_dump helper_cmds.c /^static int cmd_dump(int argc, char *argv[])$/;" f file: -cmd_dump test_cmds.c /^static int cmd_dump(int argc, char *argv[])$/;" f file: -cmd_echo cmdline.c /^static int cmd_echo(int argc, char *argv[])$/;" f file: -cmd_evl cmdline.c /^static int cmd_evl(int argc, char *argv[])$/;" f file: -cmd_exec cmdline.c /^static int cmd_exec(int argc, char *argv[])$/;" f file: -cmd_exit cmdline.c /^static int cmd_exit(int argc, char *argv[])$/;" f file: -cmd_failed cmdline.c /^static int cmd_failed(int argc, char *argv[])$/;" f file: -cmd_format helper_cmds.c /^static int cmd_format(int argc, char *argv[])$/;" f file: -cmd_help cmdline.c /^static int cmd_help(int argc, char *argv[])$/;" f file: -cmd_inspb helper_cmds.c /^static int cmd_inspb(int argc, char *argv[])$/;" f file: -cmd_ls helper_cmds.c /^static int cmd_ls(int argc, char *argv[])$/;" f file: -cmd_mkdir helper_cmds.c /^static int cmd_mkdir(int argc, char *argv[])$/;" f file: -cmd_mkf helper_cmds.c /^static int cmd_mkf(int argc, char *argv[])$/;" f file: -cmd_mount helper_cmds.c /^static int cmd_mount(int argc, char *argv[])$/;" f file: -cmd_pwd helper_cmds.c /^static int cmd_pwd(int argc, char *argv[])$/;" f file: -cmd_ren helper_cmds.c /^static int cmd_ren(int argc, char *argv[])$/;" f file: -cmd_rm helper_cmds.c /^static int cmd_rm(int argc, char *argv[])$/;" f file: -cmd_script cmdline.c /^static int cmd_script(int argc, char *argv[])$/;" f file: -cmd_set cmdline.c /^static int cmd_set(int argc, char *argv[])$/;" f file: -cmd_st helper_cmds.c /^static int cmd_st(int argc, char *argv[])$/;" f file: -cmd_t1 test_cmds.c /^static int cmd_t1(int argc, char *argv[])$/;" f file: -cmd_t2 test_cmds.c /^static int cmd_t2(int argc, char *argv[])$/;" f file: -cmd_t3 test_cmds.c /^static int cmd_t3(int argc, char *argv[])$/;" f file: -cmd_t4 test_cmds.c /^static int cmd_t4(int argc, char *argv[])$/;" f file: -cmd_t5 test_cmds.c /^static int cmd_t5(int argc, char *argv[])$/;" f file: -cmd_tcheck_seq test_cmds.c /^static int cmd_tcheck_seq(int argc, char *argv[])$/;" f file: -cmd_tclose test_cmds.c /^static int cmd_tclose(int argc, char *argv[])$/;" f file: -cmd_test cmdline.c /^static int cmd_test(int argc, char *argv[])$/;" f file: -cmd_topen test_cmds.c /^static int cmd_topen(int argc, char *argv[])$/;" f file: -cmd_tread test_cmds.c /^static int cmd_tread(int argc, char *argv[])$/;" f file: -cmd_tseek test_cmds.c /^static int cmd_tseek(int argc, char *argv[])$/;" f file: -cmd_twrite test_cmds.c /^static int cmd_twrite(int argc, char *argv[])$/;" f file: -cmd_twrite_seq test_cmds.c /^static int cmd_twrite_seq(int argc, char *argv[])$/;" f file: -cmd_wl helper_cmds.c /^static int cmd_wl(int argc, char *argv[])$/;" f file: -cmds cmdline.h /^ const struct cli_command *cmds;$/;" m struct:cli_commandset typeref:struct:cli_commandset::cli_command -command_t cmdline.h /^typedef int command_t(int argc, char *argv[]);$/;" t -default_cmds cmdline.c /^static const struct cli_command default_cmds[] = $/;" v typeref:struct:cli_command file: -default_cmdset cmdline.c /^static struct cli_commandset default_cmdset = {$/;" v typeref:struct:cli_commandset file: -descr cmdline.h /^ const char *descr;$/;" m struct:cli_command -do_dump_device test_cmds.c /^static void do_dump_device(uffs_Device *dev)$/;" f file: -do_dump_page test_cmds.c /^static void do_dump_page(uffs_Device *dev, uffs_Buf *buf)$/;" f file: -do_dump_tag test_cmds.c /^static void do_dump_tag(uffs_Device *dev, uffs_Tags *tag)$/;" f file: -do_write_test_file test_cmds.c /^static URET do_write_test_file(int fd, int size)$/;" f file: -drain_sdata uffs_fileem_ecc_hw_auto.c /^static void drain_sdata(u8 *data, int len)$/;" f file: -dump_fp uffs_fileem.h /^ FILE *dump_fp;$/;" m struct:uffs_FileEmuSt -dump_msg_to_stdout helper_cmds.c /^static void dump_msg_to_stdout(struct uffs_DeviceSt *dev, const char *fmt, ...)$/;" f file: -em_monitor_block uffs_fileem.h /^ u32 *em_monitor_block; \/\/ block erease monitor$/;" m struct:uffs_FileEmuSt -em_monitor_page uffs_fileem.h /^ u8 *em_monitor_page; \/\/ page write monitor$/;" m struct:uffs_FileEmuSt -em_monitor_spare uffs_fileem.h /^ u8 * em_monitor_spare; \/\/ spare write monitor$/;" m struct:uffs_FileEmuSt -emu_filename uffs_fileem.h /^ const char *emu_filename;$/;" m struct:uffs_FileEmuSt -feed_sdata uffs_fileem_ecc_hw_auto.c /^static void feed_sdata(const u8 *data, int len)$/;" f file: -feed_sdata_constant uffs_fileem_ecc_hw_auto.c /^static void feed_sdata_constant(u8 val, int num)$/;" f file: -femu_EraseBlock uffs_fileem_share.c /^int femu_EraseBlock(uffs_Device *dev, u32 blockNumber)$/;" f -femu_EraseBlock_wrap uffs_fileem_wrap.c /^static int femu_EraseBlock_wrap(uffs_Device *dev, u32 blockNumber)$/;" f file: -femu_GetPrivate uffs_fileem.c /^struct uffs_FileEmuSt *femu_GetPrivate()$/;" f -femu_GetStorage uffs_fileem.c /^struct uffs_StorageAttrSt * femu_GetStorage()$/;" f -femu_InitDevice uffs_fileem.c /^URET femu_InitDevice(uffs_Device *dev)$/;" f -femu_InitFlash uffs_fileem_share.c /^int femu_InitFlash(uffs_Device *dev)$/;" f -femu_InitFlash_wrap uffs_fileem_wrap.c /^static int femu_InitFlash_wrap(uffs_Device *dev)$/;" f file: -femu_ReadPage uffs_fileem_ecc_soft.c /^static URET femu_ReadPage(uffs_Device *dev, u32 block, u32 page_num, u8 *data, int data_len, u8 *ecc,$/;" f file: -femu_ReadPageWithLayout_wrap uffs_fileem_wrap.c /^static int femu_ReadPageWithLayout_wrap(uffs_Device *dev, u32 block, u32 page, u8* data, int data_len, u8 *ecc,$/;" f file: -femu_ReadPage_wrap uffs_fileem_wrap.c /^static int femu_ReadPage_wrap(uffs_Device *dev, u32 block, u32 page, u8 *data, int data_len, u8 *ecc,$/;" f file: -femu_ReleaseDevice uffs_fileem.c /^URET femu_ReleaseDevice(uffs_Device *dev)$/;" f -femu_ReleaseFlash uffs_fileem_share.c /^int femu_ReleaseFlash(uffs_Device *dev)$/;" f -femu_WritePage uffs_fileem_ecc_soft.c /^static int femu_WritePage(uffs_Device *dev, u32 block, u32 page_num,$/;" f file: -femu_WritePageWithLayout_wrap uffs_fileem_wrap.c /^static int femu_WritePageWithLayout_wrap(uffs_Device *dev, u32 block, u32 page, const u8* data, int data_len, const u8 *ecc,$/;" f file: -femu_WritePage_wrap uffs_fileem_wrap.c /^static int femu_WritePage_wrap(uffs_Device *dev, u32 block, u32 page,$/;" f file: -femu_hw_ReadPageWithLayout uffs_fileem_ecc_hw.c /^static URET femu_hw_ReadPageWithLayout(uffs_Device *dev, u32 block, u32 page, u8* data, int data_len, u8 *ecc,$/;" f file: -femu_hw_WritePageWithLayout uffs_fileem_ecc_hw.c /^static int femu_hw_WritePageWithLayout(uffs_Device *dev, u32 block, u32 page,$/;" f file: -femu_hw_auto_InitFlash uffs_fileem_ecc_hw_auto.c /^static int femu_hw_auto_InitFlash(uffs_Device *dev)$/;" f file: -femu_hw_auto_ReadPageWithLayout uffs_fileem_ecc_hw_auto.c /^static URET femu_hw_auto_ReadPageWithLayout(uffs_Device *dev, u32 block, u32 page, u8* data, int data_len, u8 *ecc,$/;" f file: -femu_hw_auto_WritePageWithLayout uffs_fileem_ecc_hw_auto.c /^static int femu_hw_auto_WritePageWithLayout(uffs_Device *dev, u32 block, u32 page,$/;" f file: -femu_setup_wrapper_functions uffs_fileem_wrap.c /^void femu_setup_wrapper_functions(uffs_Device *dev)$/;" f -fp uffs_fileem.h /^ FILE *fp;$/;" m struct:uffs_FileEmuSt -g_femu_ops_ecc_hw uffs_fileem_ecc_hw.c /^uffs_FlashOps g_femu_ops_ecc_hw = {$/;" v -g_femu_ops_ecc_hw_auto uffs_fileem_ecc_hw_auto.c /^uffs_FlashOps g_femu_ops_ecc_hw_auto = {$/;" v -g_femu_ops_ecc_soft uffs_fileem_ecc_soft.c /^uffs_FlashOps g_femu_ops_ecc_soft = {$/;" v -g_femu_private uffs_fileem.c /^static struct uffs_FileEmuSt g_femu_private = {0};$/;" v typeref:struct:uffs_FileEmuSt file: -g_femu_storage uffs_fileem.c /^static struct uffs_StorageAttrSt g_femu_storage = {0};$/;" v typeref:struct:uffs_StorageAttrSt file: -g_page_buf uffs_fileem_share.c /^static u8 g_page_buf[UFFS_MAX_PAGE_SIZE + UFFS_MAX_SPARE_SIZE];$/;" v file: -g_sdata_buf uffs_fileem_ecc_hw_auto.c /^static u8 g_sdata_buf[PAGE_FULL_SIZE]; \/\/ emulating LPC32x0's 528-bytes serial data buffer$/;" v file: -g_sdata_buf_pointer uffs_fileem_ecc_hw_auto.c /^static int g_sdata_buf_pointer = 0;$/;" v file: -get_helper_cmds helper_cmds.c /^struct cli_commandset * get_helper_cmds()$/;" f -get_test_cmds test_cmds.c /^struct cli_commandset * get_test_cmds()$/;" f -handler cmdline.h /^ command_t *handler;$/;" m struct:cli_command -helper_cmds helper_cmds.c /^static const struct cli_command helper_cmds[] = $/;" v typeref:struct:cli_command file: -helper_cmdset helper_cmds.c /^static struct cli_commandset helper_cmdset = {$/;" v typeref:struct:cli_commandset file: -initCount uffs_fileem.h /^ int initCount;$/;" m struct:uffs_FileEmuSt -load_sdata uffs_fileem_ecc_hw_auto.c /^static int load_sdata(uffs_Device *dev, int block, int page)$/;" f file: -m_abort cmdline.c /^static BOOL m_abort = FALSE;$/;" v file: -m_cli_envs cmdline.c /^static int m_cli_envs[MAX_CLI_ENV_NUM] = {0}; \/\/ cli environment variables$/;" v file: -m_cmdset_head cmdline.c /^static struct cli_commandset *m_cmdset_head = NULL;$/;" v typeref:struct:cli_commandset file: -m_exit cmdline.c /^static BOOL m_exit = FALSE;$/;" v file: -mask uffs_fileem_wrap.c /^ u8 mask;$/;" m struct:uffs_FileEmuBitFlip file: -match_cmd cmdline.c /^static BOOL match_cmd(const char *src, int start, int end, const char *des)$/;" f file: -memcp_seq test_cmds.c /^static void memcp_seq(void *des, int size, int start_pos)$/;" f file: -next cmdline.h /^ struct cli_commandset *next;$/;" m struct:cli_commandset typeref:struct:cli_commandset::cli_commandset -offset uffs_fileem_wrap.c /^ int offset;$/;" m struct:uffs_FileEmuBitFlip file: -ops_orig uffs_fileem.h /^ struct uffs_FlashOpsSt ops_orig;$/;" m struct:uffs_FileEmuSt typeref:struct:uffs_FileEmuSt::uffs_FlashOpsSt -page uffs_fileem_wrap.c /^ int page;$/;" m struct:uffs_FileEmuBitFlip file: -program_sdata uffs_fileem_ecc_hw_auto.c /^static int program_sdata(uffs_Device *dev, int block, int page)$/;" f file: -show_cmd_usage cmdline.c /^static void show_cmd_usage(const struct cli_command *cmd)$/;" f file: -start_sdata_access uffs_fileem_ecc_hw_auto.c /^static void start_sdata_access()$/;" f file: -test_append_file test_cmds.c /^static URET test_append_file(const char *file_name, int size)$/;" f file: -test_cmds test_cmds.c /^static const struct cli_command test_cmds[] = $/;" v typeref:struct:cli_command file: -test_cmdset test_cmds.c /^static struct cli_commandset test_cmdset = {$/;" v typeref:struct:cli_commandset file: -test_verify_file test_cmds.c /^static URET test_verify_file(const char *file_name, UBOOL noecc)$/;" f file: -test_write_file test_cmds.c /^static URET test_write_file(const char *file_name, int pos, int size)$/;" f file: -u_assert cmdline.h 70;" d -uffs_FileEmu uffs_fileem.h /^} uffs_FileEmu;$/;" t typeref:struct:uffs_FileEmuSt -uffs_FileEmuBitFlip uffs_fileem_wrap.c /^struct uffs_FileEmuBitFlip {$/;" s file: -uffs_FileEmuSt uffs_fileem.h /^typedef struct uffs_FileEmuSt {$/;" s -wrap_inited uffs_fileem.h /^ UBOOL wrap_inited;$/;" m struct:uffs_FileEmuSt