This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Flash config API
- From: Gary Thomas <gary at mlbassoc dot com>
- To: eCos patches <ecos-patches at ecos dot sourceware dot org>
- Date: 05 Jan 2004 14:59:20 -0700
- Subject: Flash config API
- Organization: MLB Associates
Some changes I made last week caused minor breakage. This should clean
it all up.
--
Gary Thomas <gary@mlbassoc.com>
MLB Associates
Index: hal/common/current/ChangeLog
===================================================================
RCS file: /home/gthomas/my_cvs/develop/ecos/packages/hal/common/current/ChangeLog,v
retrieving revision 1.10.6.1
diff -u -5 -p -r1.10.6.1 ChangeLog
--- hal/common/current/ChangeLog 21 Dec 2003 13:21:49 -0000 1.10.6.1
+++ hal/common/current/ChangeLog 5 Jan 2004 20:32:03 -0000
@@ -1,5 +1,12 @@
+2004-01-05 Gary Thomas <gary@mlbassoc.com>
+
+ * include/hal_if.h: Minor fixup - new 'fconfig' functions broke
+ existing uses of CYGACC_CALL_IF_FLASH_CFG_OP. Added a new macro
+ CYGACC_CALL_IF_FLASH_CFG_OP2 which handles new API and a wrapper
+ to handle the old way (backwards compatability).
+
2003-12-21 Gary Thomas <gary@mlbassoc.com>
* src/hal_if.c (flash_config_op):
* include/hal_if.h: New expanded functions for RedBoot 'fconfig'
database.
Index: hal/common/current/include/hal_if.h
===================================================================
RCS file: /home/gthomas/my_cvs/develop/ecos/packages/hal/common/current/include/hal_if.h,v
retrieving revision 1.5.6.1
diff -u -5 -p -r1.5.6.1 hal_if.h
--- hal/common/current/include/hal_if.h 21 Dec 2003 13:21:49 -0000 1.5.6.1
+++ hal/common/current/include/hal_if.h 5 Jan 2004 20:32:05 -0000
@@ -10,11 +10,11 @@
//=============================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Red Hat, Inc.
-// Copyright (C) 2002, 2003 Gary Thomas
+// Copyright (C) 2002, 2003, 2004 Gary Thomas
//
// eCos 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.
//
@@ -650,13 +650,26 @@ __call_voidVV1(CYGNUM_CALL_IF_INSTALL_BP
// Access persistent data store - kept in FLASH or EEPROM by RedBoot
//
#define CYGNUM_CALL_IF_FLASH_CFG_GET (0) // Get a particular fconfig key
#define CYGNUM_CALL_IF_FLASH_CFG_NEXT (1) // Enumerate keys (get the next one)
#define CYGNUM_CALL_IF_FLASH_CFG_SET (2) // Update particular fconfig key
-#define CYGACC_CALL_IF_FLASH_CFG_OP(_o_,_d_) \
+#define CYGACC_CALL_IF_FLASH_CFG_OP2(_o_,_d_) \
CYGACC_CALL_VV2(__call_if_flash_cfg_op_fn_t*, CYGNUM_CALL_IF_FLASH_CFG_OP, (_o_),(_d_))
__call_VV2(CYGNUM_CALL_IF_FLASH_CFG_OP, __call_if_flash_cfg_op_fn_t, cyg_bool, int, struct cyg_fconfig *)
+
+static __inline__ cyg_bool
+__call_if_flash_cfg_op(int op, char *key, void *data, int type)
+{
+ struct cyg_fconfig info;
+ info.key = key;
+ info.val = data;
+ info.type = type;
+ info.offset = 0;
+ return CYGACC_CALL_IF_FLASH_CFG_OP2(op, &info);
+}
+#define CYGACC_CALL_IF_FLASH_CFG_OP(_o_,_k_,_d_,_t_) \
+ __call_if_flash_cfg_op(_o_,_k_,_d_,_t_)
#define CYGACC_CALL_IF_FLASH_CFG_OP_SET(_x_) \
hal_virtual_vector_table[CYGNUM_CALL_IF_FLASH_CFG_OP]=(CYG_ADDRWORD)(_x_)
#define CYGACC_CALL_IF_MONITOR_RETURN(_u_) \
CYGACC_CALL_VV1(__call_if_monitor_return_t*, CYGNUM_CALL_IF_MONITOR_RETURN, (_u_))
Index: infra/current/ChangeLog
===================================================================
RCS file: /home/gthomas/my_cvs/develop/ecos/packages/infra/current/ChangeLog,v
retrieving revision 1.7.4.1
diff -u -5 -p -r1.7.4.1 ChangeLog
--- infra/current/ChangeLog 21 Dec 2003 13:21:49 -0000 1.7.4.1
+++ infra/current/ChangeLog 5 Jan 2004 20:32:50 -0000
@@ -1,5 +1,10 @@
+2004-01-05 Gary Thomas <gary@mlbassoc.com>
+
+ * tests/fc_test.c:
+ * src/tcdiag.cxx (cyg_assert_msg): 'fconfig' API changed again.
+
2003-12-21 Gary Thomas <gary@mlbassoc.com>
* tests/fc_test.c: New test/demonstration of 'fconfig' access.
* src/tcdiag.cxx (cyg_assert_msg): Interface to 'fconfig' data
Index: infra/current/src/tcdiag.cxx
===================================================================
RCS file: /home/gthomas/my_cvs/develop/ecos/packages/infra/current/src/tcdiag.cxx,v
retrieving revision 1.2.4.1
diff -u -5 -p -r1.2.4.1 tcdiag.cxx
--- infra/current/src/tcdiag.cxx 21 Dec 2003 13:21:49 -0000 1.2.4.1
+++ infra/current/src/tcdiag.cxx 5 Jan 2004 20:24:38 -0000
@@ -157,15 +157,15 @@ cyg_assert_msg( const char *psz_func, co
cur_console = CYGACC_CALL_IF_SET_CONSOLE_COMM(CYGNUM_CALL_IF_SET_COMM_ID_QUERY_CURRENT);
fc.key = "info_console_force";
fc.type = CYGNUM_FLASH_CFG_TYPE_CONFIG_BOOL;
fc.val = (void *)&i;
- if (CYGACC_CALL_IF_FLASH_CFG_OP(CYGNUM_CALL_IF_FLASH_CFG_GET, &fc)) {
+ if (CYGACC_CALL_IF_FLASH_CFG_OP2(CYGNUM_CALL_IF_FLASH_CFG_GET, &fc)) {
if (i) {
fc.key = "info_console_number";
fc.type = CYGNUM_FLASH_CFG_TYPE_CONFIG_INT;
- if (CYGACC_CALL_IF_FLASH_CFG_OP(CYGNUM_CALL_IF_FLASH_CFG_GET, &fc)) {
+ if (CYGACC_CALL_IF_FLASH_CFG_OP2(CYGNUM_CALL_IF_FLASH_CFG_GET, &fc)) {
// Then i is the console to force it to:
CYGACC_CALL_IF_SET_CONSOLE_COMM(i);
}
}
}
Index: infra/current/tests/fc_test.c
===================================================================
RCS file: /home/gthomas/my_cvs/develop/ecos/packages/infra/current/tests/fc_test.c,v
retrieving revision 1.1.2.1
diff -u -5 -p -r1.1.2.1 fc_test.c
--- infra/current/tests/fc_test.c 21 Dec 2003 13:21:49 -0000 1.1.2.1
+++ infra/current/tests/fc_test.c 5 Jan 2004 20:32:50 -0000
@@ -6,11 +6,11 @@
//
//==========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
-// Copyright (C) 2003 Gary Thomas
+// Copyright (C) 2003, 2004 Gary Thomas
//
// eCos 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.
//
@@ -70,30 +70,30 @@ main(void)
diag_printf("fconfig test started\n");
fc.offset = 0;
fc.key = key;
fc.keylen = sizeof(key);
- while (CYGACC_CALL_IF_FLASH_CFG_OP(CYGNUM_CALL_IF_FLASH_CFG_NEXT, &fc)) {
+ while (CYGACC_CALL_IF_FLASH_CFG_OP2(CYGNUM_CALL_IF_FLASH_CFG_NEXT, &fc)) {
diag_printf(" Offset: %d, key: '%s', type: %d\n", fc.offset, fc.key, fc.type);
fc.keylen = sizeof(key);
}
// Try and update a data value
fc.key = "gdb_port";
fc.val = &port;
fc.type = CYGNUM_FLASH_CFG_TYPE_CONFIG_INT;
- if (CYGACC_CALL_IF_FLASH_CFG_OP(CYGNUM_CALL_IF_FLASH_CFG_GET, &fc)) {
+ if (CYGACC_CALL_IF_FLASH_CFG_OP2(CYGNUM_CALL_IF_FLASH_CFG_GET, &fc)) {
diag_printf("gdb_port = %d\n", port);
port++;
- if (CYGACC_CALL_IF_FLASH_CFG_OP(CYGNUM_CALL_IF_FLASH_CFG_SET, &fc)) {
- if (CYGACC_CALL_IF_FLASH_CFG_OP(CYGNUM_CALL_IF_FLASH_CFG_GET, &fc)) {
+ if (CYGACC_CALL_IF_FLASH_CFG_OP2(CYGNUM_CALL_IF_FLASH_CFG_SET, &fc)) {
+ if (CYGACC_CALL_IF_FLASH_CFG_OP2(CYGNUM_CALL_IF_FLASH_CFG_GET, &fc)) {
diag_printf("now = %d\n", port);
} else {
diag_printf("Can't re-fetch 'gdb_port'\n");
exit(1);
}
port--;
- if (!CYGACC_CALL_IF_FLASH_CFG_OP(CYGNUM_CALL_IF_FLASH_CFG_SET, &fc)) {
+ if (!CYGACC_CALL_IF_FLASH_CFG_OP2(CYGNUM_CALL_IF_FLASH_CFG_SET, &fc)) {
diag_printf("Can't update 'gdb_port'\n");
exit(1);
}
} else {
diag_printf("Can't update 'gdb_port'\n");
Index: io/eth/current/ChangeLog
===================================================================
RCS file: /home/gthomas/my_cvs/develop/ecos/packages/io/eth/current/ChangeLog,v
retrieving revision 1.7
diff -u -5 -p -r1.7 ChangeLog
--- io/eth/current/ChangeLog 13 Oct 2003 18:01:46 -0000 1.7
+++ io/eth/current/ChangeLog 5 Jan 2004 20:50:08 -0000
@@ -1,5 +1,9 @@
+2004-01-05 Gary Thomas <gary@mlbassoc.com>
+
+ * src/net/eth_drv.c: Names of FLASH config types changed.
+
2003-10-09 Gary Thomas <gary@mlbassoc.com>
* src/stand_alone/eth_drv.c: Obviate __local_enet_addr, since this
same information is already kept in the driver structure *__local_enet_sc
Index: io/eth/current/src/net/eth_drv.c
===================================================================
RCS file: /home/gthomas/my_cvs/develop/ecos/packages/io/eth/current/src/net/eth_drv.c,v
retrieving revision 1.5
diff -u -5 -p -r1.5 eth_drv.c
--- io/eth/current/src/net/eth_drv.c 19 Aug 2003 18:26:58 -0000 1.5
+++ io/eth/current/src/net/eth_drv.c 5 Jan 2004 20:47:29 -0000
@@ -290,15 +290,15 @@ simulate_fail_corrupt_sglist( struct eth
CYGACC_CALL_IF_SET_CONSOLE_COMM(CYGNUM_CALL_IF_SET_COMM_ID_QUERY_CURRENT); \
{ \
int i; \
if ( CYGACC_CALL_IF_FLASH_CFG_OP( CYGNUM_CALL_IF_FLASH_CFG_GET, \
"info_console_force", &i, \
- CYGNUM_FLASH_CFG_OP_CONFIG_BOOL ) ) { \
+ CYGNUM_FLASH_CFG_TYPE_CONFIG_BOOL ) ) { \
if ( i ) { \
if ( CYGACC_CALL_IF_FLASH_CFG_OP( CYGNUM_CALL_IF_FLASH_CFG_GET, \
"info_console_number", &i, \
- CYGNUM_FLASH_CFG_OP_CONFIG_INT ) ) { \
+ CYGNUM_FLASH_CFG_TYPE_CONFIG_INT ) ){ \
/* Then i is the console to force it to: */ \
CYGACC_CALL_IF_SET_CONSOLE_COMM( i ); \
} \
} \
} \
Index: devs/eth/intel/i82559/current/ChangeLog
===================================================================
RCS file: /home/gthomas/my_cvs/develop/ecos/packages/devs/eth/intel/i82559/current/ChangeLog,v
retrieving revision 1.4
diff -u -5 -p -r1.4 ChangeLog
--- devs/eth/intel/i82559/current/ChangeLog 27 Feb 2003 20:59:43 -0000 1.4
+++ devs/eth/intel/i82559/current/ChangeLog 5 Jan 2004 20:49:47 -0000
@@ -1,5 +1,9 @@
+2004-01-05 Gary Thomas <gary@mlbassoc.com>
+
+ * src/if_i82559.c: Names of FLASH config types changed.
+
2003-02-27 Mark Salter <msalter@redhat.com>
* src/if_i82559.c (eth_set_mac_address): Correct writing
of wrong address to EEPROM.
Index: devs/eth/intel/i82559/current/src/if_i82559.c
===================================================================
RCS file: /home/gthomas/my_cvs/develop/ecos/packages/devs/eth/intel/i82559/current/src/if_i82559.c,v
retrieving revision 1.5
diff -u -5 -p -r1.5 if_i82559.c
--- devs/eth/intel/i82559/current/src/if_i82559.c 13 Oct 2003 18:01:22 -0000 1.5
+++ devs/eth/intel/i82559/current/src/if_i82559.c 5 Jan 2004 20:47:27 -0000
@@ -189,15 +189,15 @@
CYGACC_CALL_IF_SET_CONSOLE_COMM(CYGNUM_CALL_IF_SET_COMM_ID_QUERY_CURRENT); \
{ \
int i; \
if ( CYGACC_CALL_IF_FLASH_CFG_OP( CYGNUM_CALL_IF_FLASH_CFG_GET, \
"info_console_force", &i, \
- CYGNUM_FLASH_CFG_OP_CONFIG_BOOL ) ) { \
+ CYGNUM_FLASH_CFG_TYPE_CONFIG_BOOL ) ) { \
if ( i ) { \
if ( CYGACC_CALL_IF_FLASH_CFG_OP( CYGNUM_CALL_IF_FLASH_CFG_GET, \
"info_console_number", &i, \
- CYGNUM_FLASH_CFG_OP_CONFIG_INT ) ) { \
+ CYGNUM_FLASH_CFG_TYPE_CONFIG_INT ) ){ \
/* Then i is the console to force it to: */ \
CYGACC_CALL_IF_SET_CONSOLE_COMM( i ); \
} \
} \
} \