This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


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

68000/RTEMS question..


Howdy,

I am working on a port of the gen68302 BSP to my own 68302 based module.
In reading through the initialization code I am having trouble seeing how
interrupts are set in the vector table for a 68000 (ie NO_VBR). Does anyone
actually have RTEMS running on a 68000 based processor?

Overview:

        1: I cannot explain why the vector number is multiplied by 6
           and then 10 subtracted to get the address to store the ISR
           service routine.

        2: How does ISR_Handler calculate the vector number to then use
           to call into the ISR dispatch table.

Details:

Basically I have followed where Install_clock from ckinit.c calls set_vector
with the vector number of 137 (correct for timer 1), then ISR address and a
1 for RTEMS_TYPE (not RAW).

   set_vector( clock_isr, CLOCK_VECTOR, 1 );

set_vector in turn calls  :

    rtems_interrupt_catch( handler, vector,
                         (rtems_isr_entry *) &previous_isr );

rtems_interrupt_catch calls:

  _ISR_Install_vector (vector,
                      (proc_ptr)new_isr_handler,
                      (proc_ptr *)old_isr_handler );


This is really a call to _CPU_ISR_install vector in m68k\cpu.c.
_CPU_ISR_install_vector then places the timer handler into the rtems
interrupt dispatch table and loads the address of the common _ISR_Handler
into the interrupt vector by calling:

  _CPU_ISR_install_raw_handler( vector, _ISR_Handler, &ignored );

In  _CPU_ISR_install_raw_handler for the case where there is no VBR, the
handler is stored at an address (vector*6-10). Why is the number *6-10???

Also in ISR_Handler, how is the vector number determined. From the code it
looks like ISR_Handler (in the case of a 68000) is supposed to be called
from a jump routine at the actual vector. Is this the case? I could not find
anywhere where a dump jump routine was loaded at the actual vector location.
If however that is the case then the stack does not look like it is cleaned
up enough to allow the rte to work.

Thanks for any help....

-Don

------
Don Post                           BlazeNet, Inc.
post@blaze-net.com                 www.blaze-net.com

               Because IT should be Easy