• Just looking around
    Jolo
    Posts: 12 from 2006/10/7
    While I was trying to port m68k code (a software interrupt) I got the
    response of a tester that the code in question was not executed,
    although a noticeable slow down on the part of the OS could be
    noticed. Before I grope in the dark and confront him with different
    approaches, I decided first to exclude my private speculation.

    I post here the relevant code snippet and the question.

    Code:

    static const struct EmulLibEntry irqgate =
    {
    TRAP_LIB, 0, (void (*)()) code_entry_morphos
    };

    INTERRUPT long code_entry_morphos( void)
    {
    struct mydata *md = (APTR) REG_A1;
    #else
    ASM SAVEDS INTERRUPT long code_entry(
    REG(a1, struct mydata *md) )
    {
    #endif
    struct timerequest *tr;

    if ( (tr = (struct timerequest *)
    RemHead( &md->irqport->mp_MsgList)) )
    {
    tr->tr_node.io_Command = TR_ADDREQUEST;
    tr->tr_time.tv_micro = md->timeout;
    BeginIO( &tr->tr_node);
    ...normal work is done here...
    }

    #if defined(__MORPHOS__)
    REG_SR |= 4; /* Set virual Z flag */
    #endif

    return 0;
    }


    A part of the initialisation looks like this,

    Code:

    #if defined(__MORPHOS__)
    md->timer_irq->is_Code = (void (*)()) &irqgate;
    #else
    md->timer_irq->is_Code = (void (*)()) code_entry;
    #endif
    md->irqport->mp_Flags = PA_SOFTINT;


    Now my questions, what to put in mp_Sigtask?

    Code:

    a) md->irqport->mp_SigTask = (struct Task *) md->timer_irq;

    as used for m68k, or

    Code:

    b) md->irqport->mp_SigTask = (struct Task *) &irqgate;



    The interrupt is started as followed,
    Code:

    /* Start one time, rest managed by interrupt code */
    md->request->tr_node.io_Command = TR_ADDREQUEST;
    md->request->tr_time.tv_micro = md->timeout;
    BeginIO( &md->request->tr_node);


    Can someone enlighten me?

    Thanks in advance.
  • »13.01.11 - 20:52
    Profile