Changeset 33b1903 in mainline for kernel/genarch/src/ofw/pci.c


Ignore:
Timestamp:
2006-10-07T11:24:19Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8d4a577
Parents:
e2cc9a0
Message:

Separate mapping of EBUS interrupts into two parts: EBUS and PCI.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/ofw/pci.c

    re2cc9a0 r33b1903  
    3737
    3838#include <genarch/ofw/ofw_tree.h>
     39#include <arch/drivers/pci.h>
     40#include <arch/trap/interrupt.h>
    3941#include <arch/memstr.h>
    4042#include <func.h>
     
    4547#define PCI_ABS_MASK            0x80000000     
    4648#define PCI_REG_MASK            0x000000ff
     49
     50#define PCI_IGN                 0x1f
    4751
    4852bool ofw_pci_apply_ranges(ofw_tree_node_t *node, ofw_pci_reg_t *reg, uintptr_t *pa)
     
    111115}
    112116
     117/** Map PCI interrupt.
     118 *
     119 * So far, we only know how to map interrupts of non-PCI devices connected
     120 * to a PCI bridge.
     121 */
     122bool ofw_pci_map_interrupt(ofw_tree_node_t *node, ofw_pci_reg_t *reg, int ino, int *inr)
     123{
     124        pci_t *pci = node->device;
     125        if (!pci) {
     126                pci = pci_init(node);
     127                if (!pci)
     128                        return false;
     129                node->device = pci;
     130        }
     131
     132        pci_enable_interrupt(pci, ino);
     133
     134        *inr = (PCI_IGN << IGN_SHIFT) | ino;
     135
     136        return true;
     137}
     138
    113139/** @}
    114140 */
Note: See TracChangeset for help on using the changeset viewer.