This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: go command enhancements


On Fri, 2003-04-04 at 08:41, Mark Salter wrote:
> Index: redboot/current/ChangeLog
> ===================================================================
> RCS file: /cvs/ecos/ecos/packages/redboot/current/ChangeLog,v
> retrieving revision 1.101
> diff -u -p -5 -r1.101 ChangeLog
> --- redboot/current/ChangeLog	3 Apr 2003 15:27:23 -0000	1.101
> +++ redboot/current/ChangeLog	4 Apr 2003 15:29:20 -0000
> @@ -1,5 +1,11 @@
> +2003-04-04  Mark Salter  <msalter at redhat dot com>
> +
> +	* src/main.c (do_go): Add -n switch to optionally stop network
> +	device. Mask interrupts on all comm channels.
> +	* doc/redboot_cmds.sgml: Update go command info.
> +
>  2003-04-03  Gary Thomas  <gary at mlbassoc dot com>
>  
>  	* src/load.c: Better handling of default download mode.  Also
>  	display information when I/O errors occor (was silent).
>  	(do_load): Handle case when X-modem protocol is disabled.
> Index: redboot/current/doc/redboot_cmds.sgml
> ===================================================================
> RCS file: /cvs/ecos/ecos/packages/redboot/current/doc/redboot_cmds.sgml,v
> retrieving revision 1.5
> diff -u -p -5 -r1.5 redboot_cmds.sgml
> --- redboot/current/doc/redboot_cmds.sgml	15 Sep 2002 21:45:31 -0000	1.5
> +++ redboot/current/doc/redboot_cmds.sgml	4 Apr 2003 15:29:26 -0000
> @@ -8,11 +8,11 @@
>  <!--                                                                 -->
>  <!-- =============================================================== -->
>  <!-- ####COPYRIGHTBEGIN####                                          -->
>  <!--                                                                 -->
>  <!-- =============================================================== -->
> -<!-- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.  -->
> +<!-- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.  -->
>  <!-- This material may be distributed only subject to the terms      -->
>  <!-- and conditions set forth in the Open Publication License, v1.0  -->
>  <!-- or later (the latest version is presently available at          -->
>  <!-- http://www.opencontent.org/openpub/)                            -->
>  <!-- Distribution of the work or derivative of the work in any       -->
> @@ -122,11 +122,11 @@ Display (hex dump) a range of memory
>  Manage flash images
>        fis {cmds}
>  Manage configuration kept in FLASH memory
>        fconfig [-i] [-l] [-n] [-f] [-d] | [-d] nickname [value]
>  Execute code at a location
> -      go [-w &lt;timeout>] [entry]
> +      go [-w &lt;timeout>] [-c] [-n] [entry]
>  Help about help?
>        help [&lt;topic>]
>  Set/change IP addresses
>        ip_address [-l &lt;local_ip_address>] [-h &lt;server_address>]
>  Load a file
> @@ -2703,10 +2703,12 @@ or a Linux kernel.</para>
>      </refnamediv>
>      <refsynopsisdiv>
>        <cmdsynopsis>
>  	<command>go</command>
>  	<arg>-w <replaceable> timeout</replaceable></arg>
> +	<arg>-c</arg>
> +	<arg>-n</arg>
>  	<arg><replaceable> start_address</replaceable></arg>
>        </cmdsynopsis>
>      </refsynopsisdiv>
>      <refsect1>
>        <title>Arguments</title>
> @@ -2728,10 +2730,22 @@ or a Linux kernel.</para>
>  	    <row>
>  	      <entry>-w <replaceable>timeout</replaceable></entry>	     
>  	      <entry>Number</entry>
>  	      <entry>How long to wait before starting execution.</entry>	     
>  	      <entry>0</entry>	     
> +	    </row>
> +	    <row>
> +	      <entry>-c</entry>	     
> +	      <entry>Boolean</entry>
> +	      <entry>Go with caches enabled.</entry>	     
> +	      <entry>caches off</entry>	     
> +	    </row>
> +	    <row>
> +	      <entry>-n</entry>	     
> +	      <entry>Boolean</entry>
> +	      <entry>Go with network interface stopped.</entry>	     
> +	      <entry>network enabled</entry>	     
>  	    </row>
>  	    <row>
>  	      <entry><replaceable>start_address</replaceable></entry>	     
>  	      <entry>Number</entry>
>  	      <entry>Address in memory to begin execution.</entry>	     
> Index: redboot/current/src/main.c
> ===================================================================
> RCS file: /cvs/ecos/ecos/packages/redboot/current/src/main.c,v
> retrieving revision 1.41
> diff -u -p -5 -r1.41 main.c
> --- redboot/current/src/main.c	5 Mar 2003 01:46:29 -0000	1.41
> +++ redboot/current/src/main.c	4 Apr 2003 15:29:26 -0000
> @@ -59,10 +59,14 @@
>  #include <cyg/hal/hal_intr.h>
>  #include <cyg/hal/hal_if.h>
>  #include <cyg/hal/hal_cache.h>
>  #include CYGHWR_MEMORY_LAYOUT_H
>  
> +#ifdef CYGPKG_IO_ETH_DRIVERS
> +#include <cyg/io/eth/eth_drv.h>            // Logical driver interfaces
> +#endif
> +
>  #include <cyg/hal/hal_tables.h>
>  
>  #ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
>  #ifdef CYGBLD_HAL_PLATFORM_STUB_H
>  #include CYGBLD_HAL_PLATFORM_STUB_H
> @@ -418,25 +422,29 @@ return_to_redboot(int status)
>  }
>  
>  void
>  do_go(int argc, char *argv[])
>  {
> +    int i, cur;
>      unsigned long entry;
>      unsigned long oldints;
>      bool wait_time_set;
>      int  wait_time, res;
>      bool cache_enabled = false;
> -    struct option_info opts[2];
> +    bool stop_net = false;
> +    struct option_info opts[3];
>      char line[8];
> -    hal_virtual_comm_table_t *__chan = CYGACC_CALL_IF_CONSOLE_PROCS();
> +    hal_virtual_comm_table_t *__chan;
>  
>      entry = entry_address;  // Default from last 'load' operation
>      init_opts(&opts[0], 'w', true, OPTION_ARG_TYPE_NUM, 
>                (void **)&wait_time, (bool *)&wait_time_set, "wait timeout");
>      init_opts(&opts[1], 'c', false, OPTION_ARG_TYPE_FLG, 
>                (void **)&cache_enabled, (bool *)0, "go with caches enabled");
> -    if (!scan_opts(argc, argv, 1, opts, 2, (void *)&entry, OPTION_ARG_TYPE_NUM, "starting address"))
> +    init_opts(&opts[2], 'n', false, OPTION_ARG_TYPE_FLG, 
> +              (void **)&stop_net, (bool *)0, "go with network driver stopped");
> +    if (!scan_opts(argc, argv, 1, opts, 3, (void *)&entry, OPTION_ARG_TYPE_NUM, "starting address"))

Can you make this part (the option to stop the network) fully 
configurable, please?  i.e. don't scan for it, etc, unless there 
is network support in place.

>      {
>          return;
>      }
>      if (wait_time_set) {
>          int script_timeout_ms = wait_time * 1000;
> @@ -455,12 +463,28 @@ do_go(int argc, char *argv[])
>                  return;
>              }
>              script_timeout_ms -= CYGNUM_REDBOOT_CLI_IDLE_TIMEOUT;
>          }
>      }
> +
> +    // Mask interrupts on all channels
> +    cur = CYGACC_CALL_IF_SET_CONSOLE_COMM(CYGNUM_CALL_IF_SET_COMM_ID_QUERY_CURRENT);
> +    for (i = 0;  i < CYGNUM_HAL_VIRTUAL_VECTOR_NUM_CHANNELS;  i++) {
> +	CYGACC_CALL_IF_SET_CONSOLE_COMM(i);
> +	__chan = CYGACC_CALL_IF_CONSOLE_PROCS();
> +	CYGACC_COMM_IF_CONTROL( *__chan, __COMMCTL_IRQ_DISABLE );
> +    }
> +    CYGACC_CALL_IF_SET_CONSOLE_COMM(cur);
> +
> +    __chan = CYGACC_CALL_IF_CONSOLE_PROCS();
>      CYGACC_COMM_IF_CONTROL(*__chan, __COMMCTL_ENABLE_LINE_FLUSH);
>  
> +#ifdef CYGPKG_IO_ETH_DRIVERS
> +    if (stop_net)
> +	eth_drv_stop();
> +#endif
> +	
>      HAL_DISABLE_INTERRUPTS(oldints);
>      HAL_DCACHE_SYNC();
>      if (!cache_enabled) {
>  	HAL_ICACHE_DISABLE();
>  	HAL_DCACHE_DISABLE();

-- 
------------------------------------------------------------
Gary Thomas                 |
MLB Associates              |  Consulting for the
+1 (970) 229-1963           |    Embedded world
http://www.mlbassoc.com/    |
email: <gary at mlbassoc dot com>  |
gpg: http://www.chez-thomas.org/gary/gpg_key.asc
------------------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]