mirror of
https://github.com/t-crest/rtems.git
synced 2025-12-05 15:15:48 +00:00
Whitespace removal.
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
/* Find bus bridges */
|
/* Find bus bridges */
|
||||||
|
|
||||||
/* This part of the program builds a list with pairs of bus
|
/* This part of the program builds a list with pairs of bus
|
||||||
master port names (each is "device name/master port name").
|
master port names (each is "device name/master port name").
|
||||||
It is then possible to find if a given master is actually
|
It is then possible to find if a given master is actually
|
||||||
available under a different master port name through bridges.
|
available under a different master port name through bridges.
|
||||||
*/
|
*/
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
tristate_bridge_0/tristate_master, and
|
tristate_bridge_0/tristate_master, and
|
||||||
tristate_bridge_0 itself is slave of cpu0/data_master, the
|
tristate_bridge_0 itself is slave of cpu0/data_master, the
|
||||||
bridge information would be stored as this bus_bridge_pair:
|
bridge information would be stored as this bus_bridge_pair:
|
||||||
mastered_by = "cpu0/data_master" and
|
mastered_by = "cpu0/data_master" and
|
||||||
bridges_to = "tristate_bridge_0/tristate_master".
|
bridges_to = "tristate_bridge_0/tristate_master".
|
||||||
That allows to deduce that SRAM is actually mastered by
|
That allows to deduce that SRAM is actually mastered by
|
||||||
cpu0/data_master. If there were any address or bus width
|
cpu0/data_master. If there were any address or bus width
|
||||||
@@ -36,8 +36,8 @@
|
|||||||
#include "bridges.h"
|
#include "bridges.h"
|
||||||
|
|
||||||
int is_bridged(
|
int is_bridged(
|
||||||
char *cpu_master,
|
char *cpu_master,
|
||||||
char *dev_master,
|
char *dev_master,
|
||||||
bus_bridge_pair *bridges)
|
bus_bridge_pair *bridges)
|
||||||
{
|
{
|
||||||
char *curr_master;
|
char *curr_master;
|
||||||
@@ -47,7 +47,7 @@ int is_bridged(
|
|||||||
|
|
||||||
for(bbp = bridges; bbp != NULL; bbp=bbp->next)
|
for(bbp = bridges; bbp != NULL; bbp=bbp->next)
|
||||||
{
|
{
|
||||||
if(strcmp(cpu_master, bbp->mastered_by) == 0 &&
|
if(strcmp(cpu_master, bbp->mastered_by) == 0 &&
|
||||||
is_bridged(bbp->bridges_to, dev_master, bridges))
|
is_bridged(bbp->bridges_to, dev_master, bridges))
|
||||||
{
|
{
|
||||||
return 1; /* cpu masters dev via bridge */
|
return 1; /* cpu masters dev via bridge */
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ bus_bridge_pair;
|
|||||||
bus_bridge_pair *find_bridges(struct ptf *p);
|
bus_bridge_pair *find_bridges(struct ptf *p);
|
||||||
|
|
||||||
int is_bridged(
|
int is_bridged(
|
||||||
char *cpu_master,
|
char *cpu_master,
|
||||||
char *dev_master,
|
char *dev_master,
|
||||||
bus_bridge_pair *bridges);
|
bus_bridge_pair *bridges);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ clock_desc *find_clocks( struct ptf *sopc, struct ptf *cfg )
|
|||||||
|
|
||||||
struct ptf named = { item, 0, 0, 0, 0 };
|
struct ptf named = { item, 0, 0, 0, 0 };
|
||||||
struct ptf_item clk_cfg = { 2, &all, &named };
|
struct ptf_item clk_cfg = { 2, &all, &named };
|
||||||
|
|
||||||
clocks = NULL;
|
clocks = NULL;
|
||||||
ptf_match(sopc, &clk_spec, add_clock_spec, &clocks);
|
ptf_match(sopc, &clk_spec, add_clock_spec, &clocks);
|
||||||
|
|
||||||
|
|||||||
@@ -65,9 +65,9 @@ void set_dev_cfgname(struct ptf_item *pi, void *arg)
|
|||||||
|
|
||||||
|
|
||||||
device_desc *find_devices(
|
device_desc *find_devices(
|
||||||
struct ptf *ptf,
|
struct ptf *ptf,
|
||||||
struct ptf *cfg,
|
struct ptf *cfg,
|
||||||
struct ptf *cpu,
|
struct ptf *cpu,
|
||||||
bus_bridge_pair *bridges)
|
bus_bridge_pair *bridges)
|
||||||
{
|
{
|
||||||
struct ptf system = { section, "SYSTEM", 0, 0, 0 };
|
struct ptf system = { section, "SYSTEM", 0, 0, 0 };
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#include "ptf.h"
|
#include "ptf.h"
|
||||||
#include "bridges.h"
|
#include "bridges.h"
|
||||||
|
|
||||||
typedef struct dev_descr
|
typedef struct dev_descr
|
||||||
{
|
{
|
||||||
int slaves;
|
int slaves;
|
||||||
char *cfgname;
|
char *cfgname;
|
||||||
@@ -24,9 +24,9 @@ typedef struct dev_descr
|
|||||||
device_desc;
|
device_desc;
|
||||||
|
|
||||||
device_desc *find_devices(
|
device_desc *find_devices(
|
||||||
struct ptf *ptf,
|
struct ptf *ptf,
|
||||||
struct ptf *cfg,
|
struct ptf *cfg,
|
||||||
struct ptf *cpu,
|
struct ptf *cpu,
|
||||||
bus_bridge_pair *bridges);
|
bus_bridge_pair *bridges);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -112,11 +112,11 @@ void fwrite_linkcmds_file(FILE *file, struct ptf *cfg, struct ptf *cpu, device_d
|
|||||||
{
|
{
|
||||||
fprintf(file, " %s : ORIGIN = 0x%08X, LENGTH = 0x%08X\n", tmd->dev->cfgname, tmd->base, tmd->size);
|
fprintf(file, " %s : ORIGIN = 0x%08X, LENGTH = 0x%08X\n", tmd->dev->cfgname, tmd->base, tmd->size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fprintf(file, "}\n\n");
|
fprintf(file, "}\n\n");
|
||||||
|
|
||||||
ptf_match(cfg, &maliepil, fwrite_value, file);
|
ptf_match(cfg, &maliepil, fwrite_value, file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -72,14 +72,14 @@ memory_desc *find_memory(device_desc *devices)
|
|||||||
{
|
{
|
||||||
tmd->dev = dd;
|
tmd->dev = dd;
|
||||||
|
|
||||||
if(memory == NULL)
|
if(memory == NULL)
|
||||||
{
|
{
|
||||||
tmd->next = NULL;
|
tmd->next = NULL;
|
||||||
memory = tmd;
|
memory = tmd;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(tmd->size > memory->size)
|
if(tmd->size > memory->size)
|
||||||
{
|
{
|
||||||
tmd->next = memory;
|
tmd->next = memory;
|
||||||
memory = tmd;
|
memory = tmd;
|
||||||
@@ -101,4 +101,4 @@ memory_desc *find_memory(device_desc *devices)
|
|||||||
return memory;
|
return memory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ int main(int argc, char *argv[])
|
|||||||
output_order--;
|
output_order--;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'L': /* Do not output linker script */
|
case 'L': /* Do not output linker script */
|
||||||
output_linkcmds = 0;
|
output_linkcmds = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -241,7 +241,7 @@ int main(int argc, char *argv[])
|
|||||||
fprintf(stderr, "Couldn't parse '%s'.\n", argv[optind]);
|
fprintf(stderr, "Couldn't parse '%s'.\n", argv[optind]);
|
||||||
return -1;
|
return -1;
|
||||||
};
|
};
|
||||||
|
|
||||||
if(verbose) printf("Successfully read config PTF file %s.\n", argv[optind]);
|
if(verbose) printf("Successfully read config PTF file %s.\n", argv[optind]);
|
||||||
|
|
||||||
cfg = ptf_concat(cfg, morecfg);
|
cfg = ptf_concat(cfg, morecfg);
|
||||||
@@ -290,18 +290,18 @@ int main(int argc, char *argv[])
|
|||||||
fprintf(stderr, "you want to use with this BSP in your config file.\n");
|
fprintf(stderr, "you want to use with this BSP in your config file.\n");
|
||||||
fprintf(stderr, "The available CPUs are named as follows:\n");
|
fprintf(stderr, "The available CPUs are named as follows:\n");
|
||||||
ptf_match(sopc, &class_spec, printf_ptf_value, " %s\n");
|
ptf_match(sopc, &class_spec, printf_ptf_value, " %s\n");
|
||||||
return -1;
|
return -1;
|
||||||
};
|
};
|
||||||
|
|
||||||
if(cpu_count == 0)
|
if(cpu_count == 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "There is no NIOS2 cpu in the system.\n");
|
fprintf(stderr, "There is no NIOS2 cpu in the system.\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if(verbose)
|
if(verbose)
|
||||||
{
|
{
|
||||||
printf("Using NIOS II CPU '%s'.\n", cpu->value);
|
printf("Using NIOS II CPU '%s'.\n", cpu->value);
|
||||||
printf("Only modules mastered by this CPU are considered now.\n");
|
printf("Only modules mastered by this CPU are considered now.\n");
|
||||||
};
|
};
|
||||||
@@ -382,7 +382,7 @@ int main(int argc, char *argv[])
|
|||||||
if(verbose) printf("Looking for memory...\n");
|
if(verbose) printf("Looking for memory...\n");
|
||||||
|
|
||||||
memory = find_memory(devices);
|
memory = find_memory(devices);
|
||||||
|
|
||||||
if(verbose)
|
if(verbose)
|
||||||
{
|
{
|
||||||
if(memory)
|
if(memory)
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ void fwrite_devhead_line(struct ptf_item *pi, void *arg)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fprintf(dinfo->file, "#define %s_%s %s\n",
|
fprintf(dinfo->file, "#define %s_%s %s\n",
|
||||||
dinfo->dev->cfgname, dinfo->orig_value,
|
dinfo->dev->cfgname, dinfo->orig_value,
|
||||||
pi->item[pi->level]->value);
|
pi->item[pi->level]->value);
|
||||||
};
|
};
|
||||||
@@ -109,7 +109,7 @@ void fwrite_device_header(struct ptf_item *pi, void *arg)
|
|||||||
|
|
||||||
f = ptf_find(pi->item[pi->level]->sub, &fi, item, 0, 0);
|
f = ptf_find(pi->item[pi->level]->sub, &fi, item, 0, 0);
|
||||||
|
|
||||||
while(f != NULL)
|
while(f != NULL)
|
||||||
{
|
{
|
||||||
dinfo->orig_value = f->value;
|
dinfo->orig_value = f->value;
|
||||||
if(f->name && strncmp(f->name, "N2G_DEFINE_", 11)==0)
|
if(f->name && strncmp(f->name, "N2G_DEFINE_", 11)==0)
|
||||||
@@ -192,4 +192,4 @@ void fwrite_header_file( FILE *file, struct ptf *cfg, device_desc *devices, cloc
|
|||||||
ptf_match(cfg, &matchepilog, fwrite_value, file);
|
ptf_match(cfg, &matchepilog, fwrite_value, file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ struct ptf_parser_state
|
|||||||
whitespace_before_item_value,
|
whitespace_before_item_value,
|
||||||
more_section_name_chars,
|
more_section_name_chars,
|
||||||
more_item_value_chars,
|
more_item_value_chars,
|
||||||
} expectation;
|
} expectation;
|
||||||
};
|
};
|
||||||
|
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
@@ -240,7 +240,7 @@ void parse_char(struct ptf_parser_state *state, int c)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(is_not_quoted && c == '}')
|
if(is_not_quoted && c == '}')
|
||||||
{
|
{
|
||||||
parser_event = section_closed;
|
parser_event = section_closed;
|
||||||
}
|
}
|
||||||
else if(is_no_space)
|
else if(is_no_space)
|
||||||
@@ -469,7 +469,7 @@ struct ptf *ptf_parse_file(char *filename)
|
|||||||
|
|
||||||
f = fopen(filename, "r");
|
f = fopen(filename, "r");
|
||||||
if(f == NULL)
|
if(f == NULL)
|
||||||
{
|
{
|
||||||
perror(filename);
|
perror(filename);
|
||||||
return NULL;
|
return NULL;
|
||||||
};
|
};
|
||||||
@@ -686,7 +686,7 @@ int ptf_advance_until(
|
|||||||
{
|
{
|
||||||
if(strcmp(leaf->value, value) == 0) return 0; /* got it */
|
if(strcmp(leaf->value, value) == 0) return 0; /* got it */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(leaf->name != NULL)
|
else if(leaf->name != NULL)
|
||||||
{
|
{
|
||||||
if(strcmp(leaf->name, name) == 0)
|
if(strcmp(leaf->name, name) == 0)
|
||||||
@@ -712,7 +712,7 @@ int ptf_advance_until(
|
|||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
|
||||||
struct ptf *ptf_find(
|
struct ptf *ptf_find(
|
||||||
struct ptf *tree,
|
struct ptf *tree,
|
||||||
struct ptf_item *item,
|
struct ptf_item *item,
|
||||||
ptf_item_type ttype,
|
ptf_item_type ttype,
|
||||||
char *name,
|
char *name,
|
||||||
@@ -764,8 +764,8 @@ struct ptf *ptf_next(
|
|||||||
|
|
||||||
int ptf_match(
|
int ptf_match(
|
||||||
struct ptf *const ptf,
|
struct ptf *const ptf,
|
||||||
struct ptf_item *const match,
|
struct ptf_item *const match,
|
||||||
const ptf_match_action action,
|
const ptf_match_action action,
|
||||||
void *arg)
|
void *arg)
|
||||||
{
|
{
|
||||||
int count;
|
int count;
|
||||||
@@ -788,7 +788,7 @@ int ptf_match(
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(mtype == p->type &&
|
if(mtype == p->type &&
|
||||||
(mname==NULL || p->name==NULL || strcmp(mname, p->name)==0) &&
|
(mname==NULL || p->name==NULL || strcmp(mname, p->name)==0) &&
|
||||||
(mvalue==NULL || p->value==NULL || strcmp(mvalue, p->value)==0))
|
(mvalue==NULL || p->value==NULL || strcmp(mvalue, p->value)==0))
|
||||||
{
|
{
|
||||||
pi.item[pi.level] = p;
|
pi.item[pi.level] = p;
|
||||||
|
|||||||
@@ -46,22 +46,22 @@ void ptf_printf(FILE *s, struct ptf *tree, char *prefix);
|
|||||||
void ptf_dump_ptf_item(FILE *s, struct ptf_item *pi);
|
void ptf_dump_ptf_item(FILE *s, struct ptf_item *pi);
|
||||||
|
|
||||||
struct ptf *ptf_find(
|
struct ptf *ptf_find(
|
||||||
struct ptf *tree,
|
struct ptf *tree,
|
||||||
struct ptf_item *item,
|
struct ptf_item *item,
|
||||||
ptf_item_type ttype,
|
ptf_item_type ttype,
|
||||||
char *name,
|
char *name,
|
||||||
char *value);
|
char *value);
|
||||||
|
|
||||||
struct ptf *ptf_next(
|
struct ptf *ptf_next(
|
||||||
struct ptf_item *item,
|
struct ptf_item *item,
|
||||||
ptf_item_type ttype,
|
ptf_item_type ttype,
|
||||||
char *name,
|
char *name,
|
||||||
char *value);
|
char *value);
|
||||||
|
|
||||||
int ptf_match(
|
int ptf_match(
|
||||||
struct ptf *const ptf,
|
struct ptf *const ptf,
|
||||||
struct ptf_item *const match,
|
struct ptf_item *const match,
|
||||||
const ptf_match_action action,
|
const ptf_match_action action,
|
||||||
void *arg);
|
void *arg);
|
||||||
|
|
||||||
char *ptf_defused_name(char *);
|
char *ptf_defused_name(char *);
|
||||||
|
|||||||
Reference in New Issue
Block a user