[patch][rfa] Mapping base for BoardCfg::add_memory

Dave Brolley <[email protected]>
Newsgroups gmane.comp.emulators.sid.devel
Message-ID <[email protected]>
Hi,

Some architectures have complex memory maps and so I found it necessary 
on the port I'm working with to defer the setting of the base of the 
mapping passed to BoardCfg::add_memory. The base is now explictely set 
to zero where requred, but left unset when passed to add_memory.

Tested on an internal port and on xstormy16.

ok to commit?

Dave
mapbase.patch.txt (text/plain, 1.6 KB)
Index: sid/main/dynamic/commonCfg.cxx
===================================================================
RCS file: /cvs/src/src/sid/main/dynamic/commonCfg.cxx,v
retrieving revision 1.3
diff -c -p -r1.3 commonCfg.cxx
*** sid/main/dynamic/commonCfg.cxx	16 Apr 2003 22:01:07 -0000	1.3
--- sid/main/dynamic/commonCfg.cxx	26 May 2003 16:46:13 -0000
*************** void BoardCfg::add_icache (const string 
*** 1078,1084 ****
  void BoardCfg::add_memory (const Mapping &m)
  {
    if (main_mapper)
!     main_mapper->map (m);
  }
  
  
--- 1102,1111 ----
  void BoardCfg::add_memory (const Mapping &m)
  {
    if (main_mapper)
!     {
!       Mapping map(m);
!       main_mapper->map (map.base(0));
!     }
  }
  
  
Index: sid/main/dynamic/mainDynamic.cxx
===================================================================
RCS file: /cvs/src/src/sid/main/dynamic/mainDynamic.cxx,v
retrieving revision 1.3
diff -c -p -r1.3 mainDynamic.cxx
*** sid/main/dynamic/mainDynamic.cxx	9 Jan 2003 04:22:50 -0000	1.3
--- sid/main/dynamic/mainDynamic.cxx	26 May 2003 16:46:13 -0000
*************** void try_add_memory (const string memspe
*** 381,390 ****
         i != bases.end(); ++i)
      {
        Mapping m = Mapping()
! 	.slave(mem).bus(port).base(0)
  	.low(*i).high((*i) + size - 1);
        if (map)
! 	map->map (m);
        else if (board)
  	board->add_memory (m);
        else
--- 385,394 ----
         i != bases.end(); ++i)
      {
        Mapping m = Mapping()
! 	.slave(mem).bus(port)
  	.low(*i).high((*i) + size - 1);
        if (map)
! 	map->map (m.base(0));
        else if (board)
  	board->add_memory (m);
        else
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.