Tue Apr 21 19:03:51 2020 UTC ()
adjust so that this at least compiles and links with __HAVE_PCI_MSI_MSIX


(jdolecek)
diff -r1.53 -r1.54 src/sys/arch/xen/include/intr.h
diff -r1.22 -r1.23 src/sys/arch/xen/x86/xen_intr.c

cvs diff -r1.53 -r1.54 src/sys/arch/xen/include/intr.h (expand / switch to unified diff)

--- src/sys/arch/xen/include/intr.h 2019/12/23 13:35:37 1.53
+++ src/sys/arch/xen/include/intr.h 2020/04/21 19:03:51 1.54
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: intr.h,v 1.53 2019/12/23 13:35:37 thorpej Exp $ */ 1/* $NetBSD: intr.h,v 1.54 2020/04/21 19:03:51 jdolecek Exp $ */
2/* NetBSD intr.h,v 1.15 2004/10/31 10:39:34 yamt Exp */ 2/* NetBSD intr.h,v 1.15 2004/10/31 10:39:34 yamt Exp */
3 3
4/*- 4/*-
5 * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. 5 * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * This code is derived from software contributed to The NetBSD Foundation 8 * This code is derived from software contributed to The NetBSD Foundation
9 * by Charles M. Hannum, and by Jason R. Thorpe. 9 * by Charles M. Hannum, and by Jason R. Thorpe.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -85,16 +85,19 @@ void xen_broadcast_ipi(uint32_t); @@ -85,16 +85,19 @@ void xen_broadcast_ipi(uint32_t);
85#define xen_ipi_init(_1) ((void) 0) /* nothing */ 85#define xen_ipi_init(_1) ((void) 0) /* nothing */
86#define xen_send_ipi(_i1, _i2) (0) /* nothing */ 86#define xen_send_ipi(_i1, _i2) (0) /* nothing */
87#define xen_broadcast_ipi(_i1) ((void) 0) /* nothing */ 87#define xen_broadcast_ipi(_i1) ((void) 0) /* nothing */
88#endif /* MULTIPROCESSOR */ 88#endif /* MULTIPROCESSOR */
89 89
90void *xen_intr_establish_xname(int, struct pic *, int, int, int, int (*)(void *), 90void *xen_intr_establish_xname(int, struct pic *, int, int, int, int (*)(void *),
91 void *, bool, const char *); 91 void *, bool, const char *);
92void *xen_intr_establish(int, struct pic *, int, int, int, int (*)(void *), 92void *xen_intr_establish(int, struct pic *, int, int, int, int (*)(void *),
93 void *, bool); 93 void *, bool);
94void xen_intr_mask(struct intrhand *); 94void xen_intr_mask(struct intrhand *);
95void xen_intr_unmask(struct intrhand *); 95void xen_intr_unmask(struct intrhand *);
96void xen_intr_disestablish(struct intrhand *); 96void xen_intr_disestablish(struct intrhand *);
97 97
 98struct intrsource *xen_intr_allocate_io_intrsource(const char *);
 99void xen_intr_free_io_intrsource(const char *);
 100
98#endif /* !_LOCORE */ 101#endif /* !_LOCORE */
99 102
100#endif /* _XEN_INTR_H_ */ 103#endif /* _XEN_INTR_H_ */

cvs diff -r1.22 -r1.23 src/sys/arch/xen/x86/xen_intr.c (expand / switch to unified diff)

--- src/sys/arch/xen/x86/xen_intr.c 2020/04/13 22:54:12 1.22
+++ src/sys/arch/xen/x86/xen_intr.c 2020/04/21 19:03:51 1.23
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: xen_intr.c,v 1.22 2020/04/13 22:54:12 bouyer Exp $ */ 1/* $NetBSD: xen_intr.c,v 1.23 2020/04/21 19:03:51 jdolecek Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. 4 * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Charles M. Hannum, and by Jason R. Thorpe. 8 * by Charles M. Hannum, and by Jason R. Thorpe.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v 1.22 2020/04/13 22:54:12 bouyer Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v 1.23 2020/04/21 19:03:51 jdolecek Exp $");
34 34
35#include "opt_multiprocessor.h" 35#include "opt_multiprocessor.h"
36 36
37#include <sys/param.h> 37#include <sys/param.h>
38#include <sys/kernel.h> 38#include <sys/kernel.h>
39#include <sys/kmem.h> 39#include <sys/kmem.h>
40#include <sys/cpu.h> 40#include <sys/cpu.h>
41#include <sys/device.h> 41#include <sys/device.h>
42 42
43#include <xen/evtchn.h> 43#include <xen/evtchn.h>
44#include <xen/xenfunc.h> 44#include <xen/xenfunc.h>
45 45
46#include <uvm/uvm.h> 46#include <uvm/uvm.h>
@@ -57,26 +57,30 @@ __KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v @@ -57,26 +57,30 @@ __KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v
57#include <dev/acpi/acpivar.h> 57#include <dev/acpi/acpivar.h>
58#endif 58#endif
59 59
60#if NIOAPIC > 0 || NACPICA > 0 60#if NIOAPIC > 0 || NACPICA > 0
61#include <machine/i82093var.h> 61#include <machine/i82093var.h>
62#endif 62#endif
63 63
64#if NLAPIC > 0 64#if NLAPIC > 0
65#include <machine/i82489var.h> 65#include <machine/i82489var.h>
66#endif 66#endif
67 67
68#if NPCI > 0 68#if NPCI > 0
69#include <dev/pci/ppbreg.h> 69#include <dev/pci/ppbreg.h>
 70#ifdef __HAVE_PCI_MSI_MSIX
 71#include <x86/pci/msipic.h>
 72#include <x86/pci/pci_msi_machdep.h>
 73#endif
70#endif 74#endif
71 75
72#if defined(MULTIPROCESSOR) 76#if defined(MULTIPROCESSOR)
73static const char *xen_ipi_names[XEN_NIPIS] = XEN_IPI_NAMES; 77static const char *xen_ipi_names[XEN_NIPIS] = XEN_IPI_NAMES;
74#endif 78#endif
75 79
76/* 80/*
77 * Restore a value to cpl (unmasking interrupts). If any unmasked 81 * Restore a value to cpl (unmasking interrupts). If any unmasked
78 * interrupts are pending, call Xspllower() to process them. 82 * interrupts are pending, call Xspllower() to process them.
79 */ 83 */
80void xen_spllower(int nlevel); 84void xen_spllower(int nlevel);
81 85
82void 86void
@@ -517,29 +521,46 @@ xen_intr_create_intrid(int legacy_irq, s @@ -517,29 +521,46 @@ xen_intr_create_intrid(int legacy_irq, s
517#if NIOAPIC > 0 || NACPICA > 0 521#if NIOAPIC > 0 || NACPICA > 0
518 ih = ((pic->pic_apicid << APIC_INT_APIC_SHIFT) & APIC_INT_APIC_MASK) 522 ih = ((pic->pic_apicid << APIC_INT_APIC_SHIFT) & APIC_INT_APIC_MASK)
519 | ((pin << APIC_INT_PIN_SHIFT) & APIC_INT_PIN_MASK); 523 | ((pin << APIC_INT_PIN_SHIFT) & APIC_INT_PIN_MASK);
520 if (pic->pic_type == PIC_IOAPIC) { 524 if (pic->pic_type == PIC_IOAPIC) {
521 ih |= APIC_INT_VIA_APIC; 525 ih |= APIC_INT_VIA_APIC;
522 } 526 }
523 ih |= pin; 527 ih |= pin;
524 return intr_string(ih, buf, len); 528 return intr_string(ih, buf, len);
525#endif 529#endif
526 530
527 return NULL; /* No pic found! */ 531 return NULL; /* No pic found! */
528} 532}
529 533
 534static struct intrsource xen_dummy_intrsource;
 535
 536struct intrsource *
 537xen_intr_allocate_io_intrsource(const char *intrid)
 538{
 539 /* Nothing to do, required by MSI code */
 540 return &xen_dummy_intrsource;
 541}
 542
 543void
 544xen_intr_free_io_intrsource(const char *intrid)
 545{
 546 /* Nothing to do, required by MSI code */
 547}
 548
530#if !defined(XENPVHVM) 549#if !defined(XENPVHVM)
531__strong_alias(spllower, xen_spllower); 550__strong_alias(spllower, xen_spllower);
532__strong_alias(x86_read_psl, xen_read_psl); 551__strong_alias(x86_read_psl, xen_read_psl);
533__strong_alias(x86_write_psl, xen_write_psl); 552__strong_alias(x86_write_psl, xen_write_psl);
534 553
535__strong_alias(intr_string, xintr_string); 554__strong_alias(intr_string, xintr_string);
536__strong_alias(intr_create_intrid, xen_intr_create_intrid); 555__strong_alias(intr_create_intrid, xen_intr_create_intrid);
537__strong_alias(intr_establish, xen_intr_establish); 556__strong_alias(intr_establish, xen_intr_establish);
538__strong_alias(intr_establish_xname, xen_intr_establish_xname); 557__strong_alias(intr_establish_xname, xen_intr_establish_xname);
539__strong_alias(intr_mask, xen_intr_mask); 558__strong_alias(intr_mask, xen_intr_mask);
540__strong_alias(intr_unmask, xen_intr_unmask); 559__strong_alias(intr_unmask, xen_intr_unmask);
541__strong_alias(intr_disestablish, xen_intr_disestablish); 560__strong_alias(intr_disestablish, xen_intr_disestablish);
542__strong_alias(cpu_intr_redistribute, xen_cpu_intr_redistribute); 561__strong_alias(cpu_intr_redistribute, xen_cpu_intr_redistribute);
543__strong_alias(cpu_intr_count, xen_cpu_intr_count); 562__strong_alias(cpu_intr_count, xen_cpu_intr_count);
544__strong_alias(cpu_intr_init, xen_cpu_intr_init); 563__strong_alias(cpu_intr_init, xen_cpu_intr_init);
 564__strong_alias(intr_allocate_io_intrsource, xen_intr_allocate_io_intrsource);
 565__strong_alias(intr_free_io_intrsource, xen_intr_free_io_intrsource);
545#endif /* !XENPVHVM */ 566#endif /* !XENPVHVM */