From ef180f50da34b713713b58c5518357668a797851 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 23 Jan 2010 19:12:01 +0000 Subject: [PATCH] unify the list of buses in one place git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1711 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/ChangeLog | 3 + urjtag/src/bus/buses.c | 120 +----------------------------- urjtag/src/bus/buses.h | 43 +---------- urjtag/src/bus/buses_list.h | 144 ++++++++++++++++++++++++++++++++++++ 4 files changed, 152 insertions(+), 158 deletions(-) create mode 100644 urjtag/src/bus/buses_list.h diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index c5bfbfc1..1d71ac68 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -33,6 +33,9 @@ * src/bus/avr32.c, src/bus/buses.c, src/bus/buses.h: Rename the avr32 bus driver to match the common convention. + * src/bus/buses.h, src/bus/buses_list.h, src/bus/buses.c: Unify the list of + commands in one place. + 2010-01-22 Mike Frysinger * src/cmd/cmd_bit.c (cmd_bit_print_params): Fix strncat length handling. diff --git a/urjtag/src/bus/buses.c b/urjtag/src/bus/buses.c index 03b362ca..b9acf168 100644 --- a/urjtag/src/bus/buses.c +++ b/urjtag/src/bus/buses.c @@ -36,124 +36,8 @@ #include "buses.h" const urj_bus_driver_t *urj_bus_drivers[] = { -#ifdef ENABLE_BUS_ARM9TDMI - &urj_bus_arm9tdmi_bus, -#endif -#ifdef ENABLE_BUS_AU1500 - &urj_bus_au1500_bus, -#endif -#ifdef ENABLE_BUS_AVR32 - &urj_bus_avr32_bus, -#endif -#ifdef ENABLE_BUS_BCM1250 - &urj_bus_bcm1250_bus, -#endif -#ifdef ENABLE_BUS_BF526_EZKIT - &urj_bus_bf526_ezkit_bus, -#endif -#ifdef ENABLE_BUS_BF527_EZKIT - &urj_bus_bf527_ezkit_bus, -#endif -#ifdef ENABLE_BUS_BF533_STAMP - &urj_bus_bf533_stamp_bus, -#endif -#ifdef ENABLE_BUS_BF533_EZKIT - &urj_bus_bf533_ezkit_bus, -#endif -#ifdef ENABLE_BUS_BF537_STAMP - &urj_bus_bf537_stamp_bus, -#endif -#ifdef ENABLE_BUS_BF537_EZKIT - &urj_bus_bf537_ezkit_bus, -#endif -#ifdef ENABLE_BUS_BF538F_EZKIT - &urj_bus_bf538f_ezkit_bus, -#endif -#ifdef ENABLE_BUS_BF548_EZKIT - &urj_bus_bf548_ezkit_bus, -#endif -#ifdef ENABLE_BUS_BF561_EZKIT - &urj_bus_bf561_ezkit_bus, -#endif -#ifdef ENABLE_BUS_BSCOACH - &urj_bus_bscoach_bus, -#endif -#ifdef ENABLE_BUS_EJTAG - &urj_bus_ejtag_bus, - &urj_bus_ejtag_dma_bus, -#endif -#ifdef ENABLE_BUS_FJMEM - &urj_bus_fjmem_bus, -#endif -#ifdef ENABLE_BUS_IXP425 - &urj_bus_ixp425_bus, -#endif -#ifdef ENABLE_BUS_IXP435 - &urj_bus_ixp435_bus, -#endif -#ifdef ENABLE_BUS_IXP465 - &urj_bus_ixp465_bus, -#endif -#ifdef ENABLE_BUS_JOPCYC - &urj_bus_jopcyc_bus, -#endif -#ifdef ENABLE_BUS_H7202 - &urj_bus_h7202_bus, -#endif -#ifdef ENABLE_BUS_LH7A400 - &urj_bus_lh7a400_bus, -#endif -#ifdef ENABLE_BUS_MPC5200 - &urj_bus_mpc5200_bus, -#endif -#ifdef ENABLE_BUS_MPC824X - &urj_bus_mpc824x_bus, -#endif -#ifdef ENABLE_BUS_PPC405EP - &urj_bus_ppc405ep_bus, -#endif -#ifdef ENABLE_BUS_PPC440GX_EBC8 - &urj_bus_ppc440gx_ebc8_bus, -#endif -#ifdef ENABLE_BUS_PROTOTYPE - &urj_bus_prototype_bus, -#endif -#ifdef ENABLE_BUS_PXA2X0 - &urj_bus_pxa2x0_bus, -#endif -#ifdef ENABLE_BUS_PXA27X - &urj_bus_pxa27x_bus, -#endif -#ifdef ENABLE_BUS_S3C4510 - &urj_bus_s3c4510_bus, -#endif -#ifdef ENABLE_BUS_SA1110 - &urj_bus_sa1110_bus, -#endif -#ifdef ENABLE_BUS_SH7727 - &urj_bus_sh7727_bus, -#endif -#ifdef ENABLE_BUS_SH7750R - &urj_bus_sh7750r_bus, -#endif -#ifdef ENABLE_BUS_SH7751R - &urj_bus_sh7751r_bus, -#endif -#ifdef ENABLE_BUS_SHARC_21065L - &urj_bus_sharc_21065L_bus, -#endif -#ifdef ENABLE_BUS_SHARC_21369_EZKIT - &urj_bus_sharc_21369_ezkit_bus, -#endif -#ifdef ENABLE_BUS_SLSUP3 - &urj_bus_slsup3_bus, -#endif -#ifdef ENABLE_BUS_TX4925 - &urj_bus_tx4925_bus, -#endif -#ifdef ENABLE_BUS_ZEFANT_XS3 - &urj_bus_zefant_xs3_bus, -#endif +#define _URJ_BUS(bus) &urj_bus_##bus##_bus, +#include "buses_list.h" NULL /* last must be NULL */ }; diff --git a/urjtag/src/bus/buses.h b/urjtag/src/bus/buses.h index a8917fea..3152e2fc 100644 --- a/urjtag/src/bus/buses.h +++ b/urjtag/src/bus/buses.h @@ -25,44 +25,7 @@ #ifndef URJ_BUS_BUSES_H #define URJ_BUS_BUSES_H -extern const urj_bus_driver_t urj_bus_arm9tdmi_bus; -extern const urj_bus_driver_t urj_bus_au1500_bus; -extern const urj_bus_driver_t urj_bus_avr32_bus; -extern const urj_bus_driver_t urj_bus_bcm1250_bus; -extern const urj_bus_driver_t urj_bus_bf526_ezkit_bus; -extern const urj_bus_driver_t urj_bus_bf527_ezkit_bus; -extern const urj_bus_driver_t urj_bus_bf533_stamp_bus; -extern const urj_bus_driver_t urj_bus_bf533_ezkit_bus; -extern const urj_bus_driver_t urj_bus_bf537_stamp_bus; -extern const urj_bus_driver_t urj_bus_bf537_ezkit_bus; -extern const urj_bus_driver_t urj_bus_bf538f_ezkit_bus; -extern const urj_bus_driver_t urj_bus_bf548_ezkit_bus; -extern const urj_bus_driver_t urj_bus_bf561_ezkit_bus; -extern const urj_bus_driver_t urj_bus_bscoach_bus; -extern const urj_bus_driver_t urj_bus_ejtag_bus; -extern const urj_bus_driver_t urj_bus_fjmem_bus; -extern const urj_bus_driver_t urj_bus_h7202_bus; -extern const urj_bus_driver_t urj_bus_ixp425_bus; -extern const urj_bus_driver_t urj_bus_ixp435_bus; -extern const urj_bus_driver_t urj_bus_ixp465_bus; -extern const urj_bus_driver_t urj_bus_jopcyc_bus; -extern const urj_bus_driver_t urj_bus_lh7a400_bus; -extern const urj_bus_driver_t urj_bus_mpc5200_bus; -extern const urj_bus_driver_t urj_bus_mpc824x_bus; -extern const urj_bus_driver_t urj_bus_ppc405ep_bus; -extern const urj_bus_driver_t urj_bus_ppc440gx_ebc8_bus; -extern const urj_bus_driver_t urj_bus_prototype_bus; -extern const urj_bus_driver_t urj_bus_pxa2x0_bus; -extern const urj_bus_driver_t urj_bus_pxa27x_bus; -extern const urj_bus_driver_t urj_bus_s3c4510_bus; -extern const urj_bus_driver_t urj_bus_sa1110_bus; -extern const urj_bus_driver_t urj_bus_sh7727_bus; -extern const urj_bus_driver_t urj_bus_sh7750r_bus; -extern const urj_bus_driver_t urj_bus_sh7751r_bus; -extern const urj_bus_driver_t urj_bus_sharc_21065L_bus; -extern const urj_bus_driver_t urj_bus_sharc_21369_ezkit_bus; -extern const urj_bus_driver_t urj_bus_slsup3_bus; -extern const urj_bus_driver_t urj_bus_tx4925_bus; -extern const urj_bus_driver_t urj_bus_zefant_xs3_bus; -extern const urj_bus_driver_t urj_bus_ejtag_dma_bus; +#define _URJ_BUS(bus) extern const urj_bus_driver_t urj_bus_##bus##_bus; +#include "buses_list.h" + #endif /* URJ_BUS_BUSES_H */ diff --git a/urjtag/src/bus/buses_list.h b/urjtag/src/bus/buses_list.h new file mode 100644 index 00000000..1e557b81 --- /dev/null +++ b/urjtag/src/bus/buses_list.h @@ -0,0 +1,144 @@ +/* + * $Id: buses.h 1687 2009-12-29 23:53:09Z arniml $ + * + * Copyright (C) 2003 ETC s.r.o. + * + * This program 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 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + * Written by Marcel Telka , 2003. + * + */ + +#ifdef ENABLE_BUS_ARM9TDMI +_URJ_BUS(arm9tdmi) +#endif +#ifdef ENABLE_BUS_AU1500 +_URJ_BUS(au1500) +#endif +#ifdef ENABLE_BUS_AVR32 +_URJ_BUS(avr32) +#endif +#ifdef ENABLE_BUS_BCM1250 +_URJ_BUS(bcm1250) +#endif +#ifdef ENABLE_BUS_BF526_EZKIT +_URJ_BUS(bf526_ezkit) +#endif +#ifdef ENABLE_BUS_BF527_EZKIT +_URJ_BUS(bf527_ezkit) +#endif +#ifdef ENABLE_BUS_BF533_STAMP +_URJ_BUS(bf533_stamp) +#endif +#ifdef ENABLE_BUS_BF533_EZKIT +_URJ_BUS(bf533_ezkit) +#endif +#ifdef ENABLE_BUS_BF537_STAMP +_URJ_BUS(bf537_stamp) +#endif +#ifdef ENABLE_BUS_BF537_EZKIT +_URJ_BUS(bf537_ezkit) +#endif +#ifdef ENABLE_BUS_BF538F_EZKIT +_URJ_BUS(bf538f_ezkit) +#endif +#ifdef ENABLE_BUS_BF548_EZKIT +_URJ_BUS(bf548_ezkit) +#endif +#ifdef ENABLE_BUS_BF561_EZKIT +_URJ_BUS(bf561_ezkit) +#endif +#ifdef ENABLE_BUS_BSCOACH +_URJ_BUS(bscoach) +#endif +#ifdef ENABLE_BUS_EJTAG +_URJ_BUS(ejtag) +_URJ_BUS(ejtag_dma) +#endif +#ifdef ENABLE_BUS_FJMEM +_URJ_BUS(fjmem) +#endif +#ifdef ENABLE_BUS_IXP425 +_URJ_BUS(ixp425) +#endif +#ifdef ENABLE_BUS_IXP435 +_URJ_BUS(ixp435) +#endif +#ifdef ENABLE_BUS_IXP465 +_URJ_BUS(ixp465) +#endif +#ifdef ENABLE_BUS_JOPCYC +_URJ_BUS(jopcyc) +#endif +#ifdef ENABLE_BUS_H7202 +_URJ_BUS(h7202) +#endif +#ifdef ENABLE_BUS_LH7A400 +_URJ_BUS(lh7a400) +#endif +#ifdef ENABLE_BUS_MPC5200 +_URJ_BUS(mpc5200) +#endif +#ifdef ENABLE_BUS_MPC824X +_URJ_BUS(mpc824x) +#endif +#ifdef ENABLE_BUS_PPC405EP +_URJ_BUS(ppc405ep) +#endif +#ifdef ENABLE_BUS_PPC440GX_EBC8 +_URJ_BUS(ppc440gx_ebc8) +#endif +#ifdef ENABLE_BUS_PROTOTYPE +_URJ_BUS(prototype) +#endif +#ifdef ENABLE_BUS_PXA2X0 +_URJ_BUS(pxa2x0) +#endif +#ifdef ENABLE_BUS_PXA27X +_URJ_BUS(pxa27x) +#endif +#ifdef ENABLE_BUS_S3C4510 +_URJ_BUS(s3c4510) +#endif +#ifdef ENABLE_BUS_SA1110 +_URJ_BUS(sa1110) +#endif +#ifdef ENABLE_BUS_SH7727 +_URJ_BUS(sh7727) +#endif +#ifdef ENABLE_BUS_SH7750R +_URJ_BUS(sh7750r) +#endif +#ifdef ENABLE_BUS_SH7751R +_URJ_BUS(sh7751r) +#endif +#ifdef ENABLE_BUS_SHARC_21065L +_URJ_BUS(sharc_21065L) +#endif +#ifdef ENABLE_BUS_SHARC_21369_EZKIT +_URJ_BUS(sharc_21369_ezkit) +#endif +#ifdef ENABLE_BUS_SLSUP3 +_URJ_BUS(slsup3) +#endif +#ifdef ENABLE_BUS_TX4925 +_URJ_BUS(tx4925) +#endif +#ifdef ENABLE_BUS_ZEFANT_XS3 +_URJ_BUS(zefant_xs3) +#endif + +#undef _URJ_BUS