From 16fd5a99e1a8c433077e70c1a48e42cc01bf7d29 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 15 Aug 2006 21:02:55 +0000 Subject: 2006-08-15 Kolja Waschk * linkcmds.c, linkcmds.h, memory.c, memory.h, sample.ptf: New files. * bridges.c: corrected detection of bridged connections * clocks.c: removed a printf * linkcmds.[ch] new files, added output of linker script * Makefile.am: added new files * memory.[ch]: new files, detection of memory in SOPC configuration * nios2gen.c: updated command line parsing and output control * output.[ch]: improved output of BSP header file * ptf.[ch]: added ptf_dump_ptf_item and small fixes * sample.ptf: new file, sample configuration for nios2gen * README: updated --- tools/cpu/nios2/bridges.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'tools/cpu/nios2/bridges.c') diff --git a/tools/cpu/nios2/bridges.c b/tools/cpu/nios2/bridges.c index f792d5e1aa..e5f36e07c4 100644 --- a/tools/cpu/nios2/bridges.c +++ b/tools/cpu/nios2/bridges.c @@ -29,6 +29,9 @@ now we simply assume that bridges never translate anything. */ +#include +#include + #include "ptf.h" #include "bridges.h" @@ -40,24 +43,15 @@ int is_bridged( char *curr_master; bus_bridge_pair *bbp; - curr_master = dev_master; - while(curr_master != NULL) - { - /* Does cpu_master master curr_master? */ - if(strcmp(cpu_master, curr_master) == 0) return 1; /* yes, cpu_masters cm */ + if(strcmp(cpu_master, dev_master) == 0) return 1; /* cpu directly masters dev */ - /* No, cm is attached to a bridge? */ - bbp = bridges; - while(bbp != NULL) + for(bbp = bridges; bbp != NULL; bbp=bbp->next) + { + if(strcmp(cpu_master, bbp->mastered_by) == 0 && + is_bridged(bbp->bridges_to, dev_master, bridges)) { - if(strcmp(bbp->bridges_to, curr_master) == 0) - { - curr_master = bbp->mastered_by; - break; - }; - bbp = bbp->next; - }; - if(bbp == NULL) curr_master = NULL; + return 1; /* cpu masters dev via bridge */ + } }; return 0; -- cgit v1.2.3