Line 226... |
Line 226... |
{
|
{
|
struct dev_memarea *ptmp;
|
struct dev_memarea *ptmp;
|
|
|
/* Check list of registered devices. */
|
/* Check list of registered devices. */
|
for(ptmp = dev_list; ptmp; ptmp = ptmp->next)
|
for(ptmp = dev_list; ptmp; ptmp = ptmp->next)
|
if ((addr & ptmp->addr_mask) == ptmp->addr_compare)
|
if (ptmp->valid && ((addr & ptmp->addr_mask) == (ptmp->addr_compare & ptmp->addr_mask)))
|
return cur_area = ptmp;
|
return cur_area = ptmp;
|
return cur_area = NULL;
|
return cur_area = NULL;
|
}
|
}
|
|
|
/* Returns 32-bit values from mem array. Big endian version. */
|
/* Returns 32-bit values from mem array. Big endian version. */
|
Line 677... |
Line 677... |
debug (1, "%08X %08X (%i KB): %s (activated by CE%i; read delay = %icyc, write delay = %icyc)\n",
|
debug (1, "%08X %08X (%i KB): %s (activated by CE%i; read delay = %icyc, write delay = %icyc)\n",
|
start, length, length >> 10, type, ce, rd, wd);
|
start, length, length >> 10, type, ce, rd, wd);
|
register_memoryarea(start, length, 4, &simmem_read_word, &simmem_write_word);
|
register_memoryarea(start, length, 4, &simmem_read_word, &simmem_write_word);
|
cur_area->misc = memory_needed;
|
cur_area->misc = memory_needed;
|
cur_area->chip_select = ce;
|
cur_area->chip_select = ce;
|
|
cur_area->valid = 1;
|
cur_area->delayw = wd;
|
cur_area->delayw = wd;
|
cur_area->delayr = rd;
|
cur_area->delayr = rd;
|
if (config.memory.table[i].log[0] != '\0') {
|
if (config.memory.table[i].log[0] != '\0') {
|
if ((cur_area->log = fopen (config.memory.table[i].log, "wt+")) == NULL)
|
if ((cur_area->log = fopen (config.memory.table[i].log, "wt+")) == NULL)
|
fprintf (stderr, "WARNING: Cannot open '%s'.\n", config.memory.table[i].log);
|
fprintf (stderr, "WARNING: Cannot open '%s'.\n", config.memory.table[i].log);
|
Line 713... |
Line 714... |
for(ptmp = dev_list; ptmp; ptmp = ptmp->next) {
|
for(ptmp = dev_list; ptmp; ptmp = ptmp->next) {
|
if (ptmp->delayr < 0 && ptmp->readfunc == &simmem_read_word)
|
if (ptmp->delayr < 0 && ptmp->readfunc == &simmem_read_word)
|
ptmp->readfunc = &simmem_read_zero;
|
ptmp->readfunc = &simmem_read_zero;
|
if (ptmp->delayw < 0 && ptmp->writefunc == &simmem_write_word)
|
if (ptmp->delayw < 0 && ptmp->writefunc == &simmem_write_word)
|
ptmp->writefunc = &simmem_write_null;
|
ptmp->writefunc = &simmem_write_null;
|
|
|
|
/* If this mem area is not for memory chip under MC control
|
|
then this area is valid all the time */
|
|
if (ptmp->readfunc != &simmem_read_word) {
|
|
ptmp->valid = 1;
|
|
ptmp->chip_select = -1;
|
|
}
|
}
|
}
|
}
|
}
|
|
|
/* Closes files, etc. */
|
/* Closes files, etc. */
|
|
|