PPC OpenPIC: Polarity and Sense ignored?

Kamen Penev kamen at penev.net
Fri Jan 24 03:02:06 UTC 2003


In the following excerpt from openpic.c:

void openpic_initirq(unsigned int irq, unsigned int pri, unsigned int 
vec, int pol, int sense)
{
    check_arg_irq(irq);
    check_arg_pri(pri);
    check_arg_vec(vec);
    openpic_safe_writefield(&OpenPIC->Source[irq].Vector_Priority,
                    OPENPIC_PRIORITY_MASK | OPENPIC_VECTOR_MASK |
                    OPENPIC_SENSE_POLARITY | OPENPIC_SENSE_LEVEL,
                    (pri << OPENPIC_PRIORITY_SHIFT) | vec |
                (pol ? OPENPIC_SENSE_POLARITY : 0) |
                (sense ? OPENPIC_SENSE_LEVEL : 0));
}

the last two arguments of the function (pol and sense) don't seem to 
make any difference, since the value that is being written into the 
vector/priority register is always OR-ed with OPENPIC_SENSE_POLARITY | 
OPENPIC_SENSE_LEVEL.

Am I missing something?

Thanks.

Kamen





More information about the users mailing list