# HG changeset patch # User gthomas # Date 1073339896 0 # Node ID 9bf998a57d3018d542b092dc7191a6d8014fd4a8 # Parent 17c50425fc7271e06859c73d862ec53f41f2759f Handle changes in FLASH CFG API diff --git a/packages/devs/eth/intel/i82559/current/ChangeLog b/packages/devs/eth/intel/i82559/current/ChangeLog --- a/packages/devs/eth/intel/i82559/current/ChangeLog +++ b/packages/devs/eth/intel/i82559/current/ChangeLog @@ -1,3 +1,7 @@ +2004-01-05 Gary Thomas + + * src/if_i82559.c: Names of FLASH config types changed. + 2003-02-27 Mark Salter * src/if_i82559.c (eth_set_mac_address): Correct writing diff --git a/packages/devs/eth/intel/i82559/current/src/if_i82559.c b/packages/devs/eth/intel/i82559/current/src/if_i82559.c --- a/packages/devs/eth/intel/i82559/current/src/if_i82559.c +++ b/packages/devs/eth/intel/i82559/current/src/if_i82559.c @@ -191,11 +191,11 @@ 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 ); \ } \ diff --git a/packages/hal/common/current/ChangeLog b/packages/hal/common/current/ChangeLog --- a/packages/hal/common/current/ChangeLog +++ b/packages/hal/common/current/ChangeLog @@ -1,3 +1,10 @@ +2004-01-05 Gary Thomas + + * 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 * src/hal_if.c (flash_config_op): diff --git a/packages/hal/common/current/include/hal_if.h b/packages/hal/common/current/include/hal_if.h --- a/packages/hal/common/current/include/hal_if.h +++ b/packages/hal/common/current/include/hal_if.h @@ -12,7 +12,7 @@ // ------------------------------------------- // 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 @@ -652,9 +652,22 @@ static __inline__ _rt_ #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_) diff --git a/packages/infra/current/ChangeLog b/packages/infra/current/ChangeLog --- a/packages/infra/current/ChangeLog +++ b/packages/infra/current/ChangeLog @@ -1,3 +1,8 @@ +2004-01-05 Gary Thomas + + * tests/fc_test.c: + * src/tcdiag.cxx (cyg_assert_msg): 'fconfig' API changed again. + 2003-12-21 Gary Thomas * tests/fc_test.c: New test/demonstration of 'fconfig' access. diff --git a/packages/infra/current/src/tcdiag.cxx b/packages/infra/current/src/tcdiag.cxx --- a/packages/infra/current/src/tcdiag.cxx +++ b/packages/infra/current/src/tcdiag.cxx @@ -159,11 +159,11 @@ cyg_assert_msg( const char *psz_func, co 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); } diff --git a/packages/infra/current/tests/fc_test.c b/packages/infra/current/tests/fc_test.c --- a/packages/infra/current/tests/fc_test.c +++ b/packages/infra/current/tests/fc_test.c @@ -8,7 +8,7 @@ //####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 @@ -72,7 +72,7 @@ main(void) 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); } @@ -80,18 +80,18 @@ main(void) 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); } diff --git a/packages/io/eth/current/ChangeLog b/packages/io/eth/current/ChangeLog --- a/packages/io/eth/current/ChangeLog +++ b/packages/io/eth/current/ChangeLog @@ -1,3 +1,7 @@ +2004-01-05 Gary Thomas + + * src/net/eth_drv.c: Names of FLASH config types changed. + 2003-10-09 Gary Thomas * src/stand_alone/eth_drv.c: Obviate __local_enet_addr, since this diff --git a/packages/io/eth/current/src/net/eth_drv.c b/packages/io/eth/current/src/net/eth_drv.c --- a/packages/io/eth/current/src/net/eth_drv.c +++ b/packages/io/eth/current/src/net/eth_drv.c @@ -292,11 +292,11 @@ simulate_fail_corrupt_sglist( struct eth 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 ); \ } \