diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2011-06-26 18:20:37 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2011-06-26 18:20:37 +0000 |
commit | f113e30f6563dfc57bc40cf991a22d7c3eb4c136 (patch) | |
tree | 1529218f815d166ea2fe9d61e200f7b8a16901aa /sys/arch/sparc64/dev | |
parent | 6a06d1f4fa889d4bb75e5353760a0c3711b5b16e (diff) |
Implement pci_intr_map_msi().
Diffstat (limited to 'sys/arch/sparc64/dev')
-rw-r--r-- | sys/arch/sparc64/dev/pci_machdep.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/sys/arch/sparc64/dev/pci_machdep.c b/sys/arch/sparc64/dev/pci_machdep.c index 964063c2ef5..04aae58666f 100644 --- a/sys/arch/sparc64/dev/pci_machdep.c +++ b/sys/arch/sparc64/dev/pci_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.c,v 1.40 2010/12/04 17:06:32 miod Exp $ */ +/* $OpenBSD: pci_machdep.c,v 1.41 2011/06/26 18:20:36 kettenis Exp $ */ /* $NetBSD: pci_machdep.c,v 1.22 2001/07/20 00:07:13 eeh Exp $ */ /* @@ -404,6 +404,20 @@ pci_intr_map(pa, ihp) } int +pci_intr_map_msi(struct pci_attach_args *pa, pci_intr_handle_t *ihp) +{ + pci_chipset_tag_t pc = pa->pa_pc; + pcitag_t tag = pa->pa_tag; + + if ((pa->pa_flags & PCI_FLAGS_MSI_ENABLED) == 0 || + pci_get_capability(pc, tag, PCI_CAP_MSI, NULL, NULL) == 0) + return (-1); + + *ihp = PCITAG_OFFSET(pa->pa_tag) | PCI_INTR_MSI; + return (0); +} + +int pci_intr_line(pci_chipset_tag_t pc, pci_intr_handle_t ih) { return (ih); @@ -417,7 +431,10 @@ pci_intr_string(pc, ih) static char str[16]; DPRINTF(SPDB_INTR, ("pci_intr_string: ih %u", ih)); - snprintf(str, sizeof str, "ivec 0x%x", INTVEC(ih)); + if (ih & PCI_INTR_MSI) + snprintf(str, sizeof str, "msi"); + else + snprintf(str, sizeof str, "ivec 0x%x", INTVEC(ih)); DPRINTF(SPDB_INTR, ("; returning %s\n", str)); return (str); |