This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MIPS simulator initializes LSI pmon vector table with code


On Apr 18, 2002, cgd@broadcom.com wrote:

> The code at 0xbfc00200, etc., _ARE_ supposed to be code; in MIPS
> they're various exception entry points.  If they are data which is
> invalid code, the wrong thing will almost certainly happen.

Ok, so could you please explain to me how these two chunks of code can
possibly be correct:

	if (lsipmon_monitor_base != 0)
	  {
	    address_word vaddr = (lsipmon_monitor_base + (loop * 4));
	    sim_write (sd, vaddr, (char *)&value, sizeof (value));
	  }

(where lsipmon_monitor_base is 0xBFC00200, and loop varies from 0 to
23.  I read that as writing pointers into lsipmon_monitor_base)

      sim_write (sd, 0xBFC00200, (char *) halt, sizeof (halt));
      sim_write (sd, 0xBFC00380, (char *) halt, sizeof (halt));
      sim_write (sd, 0xBFC00400, (char *) halt, sizeof (halt));

(where halt is 64-byte long chunk of code, which means that one of
these halts overwrites not only its own entry in lsipmon_monitor_base,
but also the following entry.)

> I cannot believe that any monitor does what you describe (puts a table
> of addresses here), as doing so (instead of putting vectors there)
> would be fundamentally incompatible with the MIPS architecture.

I stand corrected.  It doesn't write pointers into chose chunks.  I
misremembered what I had seen.  The values of `value' that are written
in the first chunk of code as numbers that range from 6 to 28, except
for the printf service.  However, I don't see how a code sequence that
halts the machine could possibly fit there as an entry in the vector
table.

Enlightenment would be appreciated.

Thanks,

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]