[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Simulavr-devel] (no subject)
From: |
Keith Gudger |
Subject: |
Re: [Simulavr-devel] (no subject) |
Date: |
Tue, 14 Oct 2003 14:23:16 -0700 (PDT) |
On Tue, 14 Oct 2003, Theodore A. Roth wrote:
> > This is the wrong irq. It's supposed to be #7.
>
> Actually, it is correct. Have a look at the _irq_sources enum in
> intvects.h. IRQ_TIMER0_OVF is irq #10 in simulavr space. The strange
> mapping was done to make the irq vector somewhat device independant.
> It's debatable as to wether I achieved that.
>
> The problem is really a bug in how my gdbserver.c hack is passing the
> irq number down to the simulator. I mistakenly assumed that the signal
> number (minus whatever offset) translates directly to an index into
> the vtab_* arrays. What really needs to happen is this:
>
> - convert signal into address [ addr = (signal - offset) * vect_size ]
> where vect_size is 1 or 2 words.
> - vector to the address.
>
Ted:
OK, I see the table in intvects.h. That's where the '10' comes from.
What I see that's missing is the link between "IRQ_TIMER0_OVF" (the enum)
that's used to get the irq (10) and the "IRQ_TIMER0_OVF" string in
intvects.c. If the "static IntVect vtab_at..." table had the enums in it,
you could resolve it that way pretty easily. Maybe the structure would
look like this:
struct _IntVect {
char *name; /* The name of the interrupt. */
int addr; /* Where to vector to when interrupt occurs. */
uint32_t can_wake; /* If the interrupt occurs while in sleep
mode, can it wake the processor? Each bit
represents a different sleep mode which the
processor might be in. */
enum _irq_sources ; /* the actual irq enum value */
};
Just an idea.
Keith