Changeset ec6422e in rtems


Ignore:
Timestamp:
Mar 25, 2003, 4:55:53 PM (17 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
c151cfc
Parents:
de22321
Message:

2003-03-25 Till Straumann <strauman@…>

PR 360/bsps

  • irq/irq.c, irq/irq_init.c, openpic/openpic.c, openpic/openpic.h: BSP code had set the task priority register multiple times of the OpenPIC instead of setting the individual source priorities. This patch adds openpic_get_source_priority() and openpic_set_source_priority() calls and lets IRQ management code use them.
Location:
c/src/lib/libbsp/powerpc/shared
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/shared/ChangeLog

    rde22321 rec6422e  
     12003-03-25  Till Straumann <strauman@slac.stanford.edu>
     2
     3        PR 360/bsps
     4        * irq/irq.c, irq/irq_init.c, openpic/openpic.c, openpic/openpic.h:
     5        BSP code had set the task priority register multiple times of
     6        the OpenPIC instead of setting the individual source priorities.
     7        This patch adds openpic_get_source_priority() and
     8        openpic_set_source_priority() calls and lets IRQ management code
     9        use them.
     10
    1112003-03-25  Till Straumann <strauman@slac.stanford.edu>
    212
  • c/src/lib/libbsp/powerpc/shared/irq/irq.c

    rde22321 rec6422e  
    2020#include <rtems/score/apiext.h>
    2121#include <libcpu/raw_exception.h>
     22#include <libcpu/io.h>
    2223#include <bsp/vectors.h>
    2324
     
    281282     */
    282283    for (i=BSP_PCI_IRQ_LOWEST_OFFSET; i < BSP_PCI_IRQ_LOWEST_OFFSET + BSP_PCI_IRQ_NUMBER ; i++) {
    283       openpic_set_priority(0, internal_config->irqPrioTbl [i]);
     284      /*
     285       * Note that openpic_set_priority() sets the TASK priority of the PIC
     286       */
     287      openpic_set_source_priority(i - BSP_PCI_IRQ_LOWEST_OFFSET,
     288                                  internal_config->irqPrioTbl[i]);
    284289      if (rtems_hdl_tbl[i].hdl != default_rtems_entry.hdl) {
    285290        openpic_enable_irq ((int) i - BSP_PCI_IRQ_LOWEST_OFFSET);
     
    318323int _BSP_vme_bridge_irq = -1;
    319324 
    320 static unsigned spuriousIntr = 0;
     325unsigned spuriousIntr = 0;
    321326/*
    322327 * High level IRQ handler called from shared_raw_irq_code_entry
     
    345350  irq = openpic_irq(0);
    346351  if (irq == OPENPIC_VEC_SPURIOUS) {
    347     ++spuriousIntr;
     352    ++BSP_spuriousIntr;
    348353    return;
    349354  }
  • c/src/lib/libbsp/powerpc/shared/irq/irq_init.c

    rde22321 rec6422e  
    8686   * PCI Interrupts
    8787   */
    88   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* for raven prio 0 means unactive... */
     88  8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, /* for raven prio 0 means unactive... */
    8989  /*
    9090   * Processor exceptions handled as interrupts
  • c/src/lib/libbsp/powerpc/shared/openpic/openpic.c

    rde22321 rec6422e  
    2020 */
    2121
     22#include <rtems.h>
    2223#include <rtems/bspIo.h>
    2324#include <bsp/openpic.h>
     
    9596    unsigned int val;
    9697
    97     val = ld_le32(addr);
     98    val = in_le32(addr);
    9899#ifdef REGISTER_DEBUG
    99100    printk("openpic_read(0x%08x) = 0x%08x\n", (unsigned int)addr, val);
     
    252253           
    253254            /* Initialize external interrupts */
    254             /* SIOint (8259 cascade) is special */
    255             openpic_initirq(0, 8, OPENPIC_VEC_SOURCE, 1, 1);
    256             /* Processor 0 */
    257             openpic_mapirq(0, 1<<0);
    258255            for (i = 0; i < NumSources; i++) {
    259256                    /* Enabled, Priority 8 */
     
    455452void openpic_enable_irq(unsigned int irq)
    456453{
    457     check_arg_irq(irq);
     454unsigned long flags;
     455    check_arg_irq(irq);
     456        rtems_interrupt_disable(flags);
    458457    openpic_clearfield(&OpenPIC->Source[irq].Vector_Priority, OPENPIC_MASK);
     458        rtems_interrupt_enable(flags);
    459459}
    460460
    461461void openpic_disable_irq(unsigned int irq)
    462462{
    463     check_arg_irq(irq);
     463unsigned long flags;
     464    check_arg_irq(irq);
     465        rtems_interrupt_disable(flags);
    464466    openpic_setfield(&OpenPIC->Source[irq].Vector_Priority, OPENPIC_MASK);
     467        rtems_interrupt_enable(flags);
    465468}
    466469
     
    500503}
    501504
    502 
     505        /*
     506         * Get the current priority of an external interrupt
     507         */
     508unsigned int openpic_get_source_priority(unsigned int irq)
     509{
     510    check_arg_irq(irq);
     511        return openpic_readfield(&OpenPIC->Source[irq].Vector_Priority,
     512                                                         OPENPIC_PRIORITY_MASK) >> OPENPIC_PRIORITY_SHIFT;
     513}
     514
     515void openpic_set_source_priority(unsigned int irq, unsigned int pri)
     516{
     517unsigned long flags;
     518    check_arg_irq(irq);
     519    check_arg_pri(pri);
     520        rtems_interrupt_disable(flags);
     521        openpic_writefield(
     522                                        &OpenPIC->Source[irq].Vector_Priority,
     523                                        OPENPIC_PRIORITY_MASK,
     524                                        pri << OPENPIC_PRIORITY_SHIFT);
     525        rtems_interrupt_enable(flags);
     526}
    503527    /*
    504528     *  Set the sense for an interrupt source (and disable it!)
  • c/src/lib/libbsp/powerpc/shared/openpic/openpic.h

    rde22321 rec6422e  
    335335extern void openpic_mapirq(unsigned int irq, unsigned int cpumask);
    336336extern void openpic_set_sense(unsigned int irq, int sense);
     337extern unsigned int openpic_get_source_priority(unsigned int irq);
     338extern void openpic_set_source_priority(unsigned int irq, unsigned int pri);
    337339
    338340#endif /* RTEMS_OPENPIC_H */
Note: See TracChangeset for help on using the changeset viewer.