comparison packages/redboot/current/include/redboot.h @ 2257:467fd46113f3

* src/fs/fileio.c (do_list): Use getcwd for current directory, rather than "." which may not be implemented in the FS. * src/parse.c (redboot_exec): Conditionalise use of __mem_fault_handler to only be when stubs are included. (error_handler): Ditto for this function. * src/main.c (cyg_start): Conditionalise use of __mem_fault_handler to only be when stubs are included. (do_go): Ditto. (error_handler): Ditto for this function. * src/fs/fileio.c (do_mkdir, do_deldir, do_del, do_write): Added some extra argument checking to these functions. * src/fs/fileio.c (do_mount): Only support -f with "legacy" flash block devices. Clear mount table on failure. (do_move): Silence rename undefined warning. (do_write): Silence warnings. (do_info): Support longer device names. * src/decompress.c (ZLIB_COMPRESSION_OVERHEAD): Increase substantially if jffs2 is present. * src/fs/fileio.c: Fixed some bugs in handling of mounts. The strings used in the mount table must be copied, otherwise the mount table is corrupted by later commands. Also toughened up some error testing. * doc/redboot_cmds.sgml: Added file mode documentation to load command. * doc/redboot_cmds.sgml: Added documentation of filesystem access commands. * src/fs/fileio.c (do_write): Added O_TRUNC to the open call to ensure that the file is resized to fit the new data. * src/fs/fileio.c: Significantly reorganized to present an interface similar to the fis commands. Added a variety of command to manipulate files and directories in a filesystem. * src/parse.c: Added redboot_exec() to provide an internal interface for executing RedBoot commands. Added err_printf() which allows an error message to be printed before longjumping out to an enclosing call to redboot_exec(). Where redboot_exec() is not involved, it just behaves like diag_printf(). * src/main.c: Removed unnecessary delay during startup. Changed diag_printf() in do_go() into err_printf(). * src/load.c: Changed some calls to diag_printf() to err_printf(). * src/net/net_io.c: Changed init priority to RedBoot_INIT_NET. * include/redboot.h: Added some extra initialization priorities. Added prototypes for redboot_exec() and err_printf().
author jlarmour
date Thu, 20 Jul 2006 20:27:47 +0000
parents 5c5e93c863ac
children b8111f0a6f98
comparison
equal deleted inserted replaced
2256:9838a9103c2a 2257:467fd46113f3
8 //####ECOSGPLCOPYRIGHTBEGIN#### 8 //####ECOSGPLCOPYRIGHTBEGIN####
9 // ------------------------------------------- 9 // -------------------------------------------
10 // This file is part of eCos, the Embedded Configurable Operating System. 10 // This file is part of eCos, the Embedded Configurable Operating System.
11 // Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 Red Hat, Inc. 11 // Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 Red Hat, Inc.
12 // Copyright (C) 2002, 2003, 2004, 2005 Gary Thomas 12 // Copyright (C) 2002, 2003, 2004, 2005 Gary Thomas
13 // Copyright (C) 2004, 2005 eCosCentric Limited
13 // 14 //
14 // eCos is free software; you can redistribute it and/or modify it under 15 // eCos is free software; you can redistribute it and/or modify it under
15 // the terms of the GNU General Public License as published by the Free 16 // the terms of the GNU General Public License as published by the Free
16 // Software Foundation; either version 2 or (at your option) any later version. 17 // Software Foundation; either version 2 or (at your option) any later version.
17 // 18 //
249 extern _cmd_entry(_s_,_h_,_u_,_f_,_subs_,_sube_,_n_) 250 extern _cmd_entry(_s_,_h_,_u_,_f_,_subs_,_sube_,_n_)
250 #define local_cmd_entry(_s_,_h_,_u_,_f_,_n_) \ 251 #define local_cmd_entry(_s_,_h_,_u_,_f_,_n_) \
251 static _cmd_entry(_s_,_h_,_u_,_f_,0,0,_n_) 252 static _cmd_entry(_s_,_h_,_u_,_f_,0,0,_n_)
252 253
253 // Initialization functions 254 // Initialization functions
254 #define RedBoot_INIT_FIRST 0000 255 #define RedBoot_INIT_FIRST 0000
255 #define RedBoot_INIT_SECOND 0100 256 #define RedBoot_INIT_SECOND 0100
256 // Specify a 3 digit numeric value for proper prioritizing 257 // Specify a 3 digit numeric value for proper prioritizing
257 #define RedBoot_INIT_PRIO(_n_) 1##_n_ 258 #define RedBoot_INIT_PRIO(_n_) 1##_n_
258 #define RedBoot_INIT_LAST 9999 259 #define RedBoot_INIT_BEFORE_NET 6900
260 #define RedBoot_INIT_NET 7000
261 #define RedBoot_INIT_AFTER_NET 7100
262 #define RedBoot_INIT_LAST 9999
259 typedef void void_fun(void); 263 typedef void void_fun(void);
260 typedef void_fun *void_fun_ptr; 264 typedef void_fun *void_fun_ptr;
261 struct init_tab_entry { 265 struct init_tab_entry {
262 void_fun_ptr fun; 266 void_fun_ptr fun;
263 } CYG_HAL_TABLE_TYPE; 267 } CYG_HAL_TABLE_TYPE;
310 int arg_type, void *arg, bool *arg_set, char *name); 314 int arg_type, void *arg, bool *arg_set, char *name);
311 externC bool scan_opts(int argc, char *argv[], int first, 315 externC bool scan_opts(int argc, char *argv[], int first,
312 struct option_info *opts, int num_opts, 316 struct option_info *opts, int num_opts,
313 void *def_arg, int def_arg_type, char *def_descr); 317 void *def_arg, int def_arg_type, char *def_descr);
314 318
319 externC int redboot_exec( char *command, ... );
320
321 externC void err_printf( char *fmt, ... );
322
315 #ifdef CYGNUM_HAL_VIRTUAL_VECTOR_AUX_CHANNELS 323 #ifdef CYGNUM_HAL_VIRTUAL_VECTOR_AUX_CHANNELS
316 #define CYGNUM_HAL_VIRTUAL_VECTOR_NUM_CHANNELS \ 324 #define CYGNUM_HAL_VIRTUAL_VECTOR_NUM_CHANNELS \
317 (CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS+CYGNUM_HAL_VIRTUAL_VECTOR_AUX_CHANNELS) 325 (CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS+CYGNUM_HAL_VIRTUAL_VECTOR_AUX_CHANNELS)
318 #else 326 #else
319 #define CYGNUM_HAL_VIRTUAL_VECTOR_NUM_CHANNELS \ 327 #define CYGNUM_HAL_VIRTUAL_VECTOR_NUM_CHANNELS \