xen: remove nr_irqs_gsi from generic code

The concept is X86 specific.

AFAICT the generic concept here is the number of static physical IRQs
which the current hardware has, so call this nr_static_irqs.

Also using "defined NR_IRQS" as a standin for x86 might have made
sense at one point but its just cleaner to push the necessary
definitions into asm/irq.h.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
Ian Campbell committed 2012-12-19 16:04:49 +00:00
1 parent f9e681d3d1
commit 2a80634d67
6 files changed
+11 -14

No files matched your search

-2
View File
@@ -6,5 +6,3 @@ x: .word 0xe7f000f0 /* Undefined instruction */
.globl x; \
x: mov pc, lr
/* PIRQ support */
DUMMY(nr_irqs_gsi);
+2 -2
View File
@@ -259,9 +259,9 @@ struct domain *domain_create(
atomic_inc(&d->pause_count);
if ( domid )
d->nr_pirqs = nr_irqs_gsi + extra_domU_irqs;
d->nr_pirqs = nr_static_irqs + extra_domU_irqs;
else
d->nr_pirqs = nr_irqs_gsi + extra_dom0_irqs;
d->nr_pirqs = nr_static_irqs + extra_dom0_irqs;
if ( d->nr_pirqs > nr_irqs )
d->nr_pirqs = nr_irqs;
+3
View File
@@ -21,6 +21,9 @@ struct irq_cfg {
#define NR_IRQS 1024
#define nr_irqs NR_IRQS
#define nr_irqs NR_IRQS
#define nr_static_irqs NR_IRQS
struct irq_desc;
struct irq_desc *__irq_to_desc(int irq);
+4
View File
@@ -11,6 +11,10 @@
#include <irq_vectors.h>
#include <asm/percpu.h>
extern unsigned int nr_irqs_gsi;
extern unsigned int nr_irqs;
#define nr_static_irqs nr_irqs_gsi
#define IO_APIC_IRQ(irq) (platform_legacy_irq(irq) ? \
(1 << (irq)) & io_apic_irqs : \
(irq) < nr_irqs_gsi)
-8
View File
@@ -58,14 +58,6 @@ typedef const struct hw_interrupt_type hw_irq_controller;
#include <asm/irq.h>
#ifdef NR_IRQS
# define nr_irqs NR_IRQS
# define nr_irqs_gsi NR_IRQS
#else
extern unsigned int nr_irqs_gsi;
extern unsigned int nr_irqs;
#endif
struct msi_desc;
/*
* This is the "IRQ descriptor", which contains various information
+2 -2
View File
@@ -72,7 +72,7 @@ static int get_irq_sid(int irq, u32 *sid, struct avc_audit_data *ad)
struct irq_desc *desc = irq_to_desc(irq);
if ( irq >= nr_irqs || irq < 0 )
return -EINVAL;
if ( irq < nr_irqs_gsi ) {
if ( irq < nr_static_irqs ) {
if (ad) {
AVC_AUDIT_DATA_INIT(ad, IRQ);
ad->irq = irq;
@@ -699,7 +699,7 @@ static int flask_map_domain_pirq (struct domain *d, int irq, void *data)
if ( rc )
return rc;
if ( irq >= nr_irqs_gsi && msi ) {
if ( irq >= nr_static_irqs && msi ) {
u32 machine_bdf = (msi->seg << 16) | (msi->bus << 8) | msi->devfn;
AVC_AUDIT_DATA_INIT(&ad, DEV);
ad.device = machine_bdf;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.