This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Redboot console performance tweak
>>>>> Christoph Csebits writes:
> On Tue, Sep 10, 2002 at 01:56:13PM -0400, Mark Salter wrote:
>> Yes, I understand that. But how are you building and running the
>> application. With gdb or just downloading and "go"?
> yes, nothing special configured, built for RAM startup,
> just download and go
> --
Could you give this a try and see if it fixes the problem?
--Mark
Index: hal/common/current/include/hal_if.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/common/current/include/hal_if.h,v
retrieving revision 1.16
diff -u -p -5 -r1.16 hal_if.h
--- hal/common/current/include/hal_if.h 23 May 2002 23:02:47 -0000 1.16
+++ hal/common/current/include/hal_if.h 10 Sep 2002 19:04:14 -0000
@@ -148,10 +148,19 @@ typedef enum {
* the driver. This only flushes the driver buffers, not necessarily
* any hardware FIFO, etc.
*/
__COMMCTL_FLUSH_OUTPUT,
+ /*
+ * Forces driver to enable or disable flushes when a newline is
+ * seen in the output stream. Flushing at line boundaries occurs
+ * in the driver, not necessarily any hardware FIFO, etc. Line
+ * buffering is optional and may only be available in some drivers.
+ */
+ __COMMCTL_ENABLE_LINE_FLUSH,
+ __COMMCTL_DISABLE_LINE_FLUSH,
+
} __comm_control_cmd_t;
#define CYGNUM_COMM_IF_CH_DATA 0
#define CYGNUM_COMM_IF_WRITE 1
Index: redboot/current/src/main.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/src/main.c,v
retrieving revision 1.34
diff -u -p -5 -r1.34 main.c
--- redboot/current/src/main.c 24 Aug 2002 11:34:50 -0000 1.34
+++ redboot/current/src/main.c 10 Sep 2002 19:04:19 -0000
@@ -383,10 +383,11 @@ do_go(int argc, char *argv[])
code_fun *fun;
bool wait_time_set;
int wait_time, res;
struct option_info opts[1];
char line[8];
+ hal_virtual_comm_table_t *__chan = CYGACC_CALL_IF_CONSOLE_PROCS();
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");
if (!scan_opts(argc, argv, 1, opts, 1, (void *)&entry, OPTION_ARG_TYPE_NUM, "starting address"))
@@ -410,10 +411,12 @@ do_go(int argc, char *argv[])
return;
}
script_timeout_ms -= CYGNUM_REDBOOT_CLI_IDLE_TIMEOUT;
}
}
+ CYGACC_COMM_IF_CONTROL(*__chan, __COMMCTL_ENABLE_LINE_FLUSH);
+
fun = (code_fun *)entry;
HAL_DISABLE_INTERRUPTS(oldints);
HAL_DCACHE_SYNC();
HAL_ICACHE_DISABLE();
HAL_DCACHE_DISABLE();
Index: redboot/current/src/net/net_io.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/src/net/net_io.c,v
retrieving revision 1.30
diff -u -p -5 -r1.30 net_io.c
--- redboot/current/src/net/net_io.c 29 Aug 2002 19:30:28 -0000 1.30
+++ redboot/current/src/net/net_io.c 10 Sep 2002 19:04:19 -0000
@@ -146,10 +146,11 @@ static int in_buflen = 0;
static unsigned char in_buf[64];
static unsigned char *in_bufp;
static int out_buflen = 0;
static unsigned char out_buf[1024];
static unsigned char *out_bufp;
+static bool flush_output_lines = false;
// Functions in this module
static void net_io_flush(void);
static void net_io_revert_console(void);
static void net_io_putc(void*, cyg_uint8);
@@ -301,10 +302,11 @@ net_io_putc(void* __ch_data, cyg_uint8 c
if (have_dollar && (c == '#')) {
have_hash = true;
hash_count = 0;
}
if ((++out_buflen == sizeof(out_buf)) ||
+ (flush_output_lines && c == '\n') ||
(have_hash && (++hash_count == 3))) {
net_io_flush();
have_dollar = false;
}
CYGARC_HAL_RESTORE_GP();
@@ -408,10 +410,16 @@ net_io_control(void *__ch_data, __comm_c
break;
}
case __COMMCTL_FLUSH_OUTPUT:
net_io_flush();
break;
+ case __COMMCTL_ENABLE_LINE_FLUSH:
+ flush_output_lines = true;
+ break;
+ case __COMMCTL_DISABLE_LINE_FLUSH:
+ flush_output_lines = false;
+ break;
default:
break;
}
CYGARC_HAL_RESTORE_GP();
return ret;
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss