mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-03-23 20:08:13 +07:00
[SPARC64]: Kill ugly __irq_ino() macro.
We have a place to stick INO information in the virt_to_real_irq_table[], which is currently only used for VIRQs. And that is readily accessible from the one __irq_ino() call site. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
42d5f99b1d
commit
bb74b734a6
@ -122,8 +122,6 @@ static void bucket_set_virt_irq(unsigned long bucket_pa,
|
|||||||
"i" (ASI_PHYS_USE_EC));
|
"i" (ASI_PHYS_USE_EC));
|
||||||
}
|
}
|
||||||
|
|
||||||
#define __irq_ino(irq) \
|
|
||||||
(((struct ino_bucket *)(irq)) - &ivector_table[0])
|
|
||||||
#define __bucket(irq) ((struct ino_bucket *)(irq))
|
#define __bucket(irq) ((struct ino_bucket *)(irq))
|
||||||
#define __irq(bucket) ((unsigned long)(bucket))
|
#define __irq(bucket) ((unsigned long)(bucket))
|
||||||
|
|
||||||
@ -136,7 +134,9 @@ static struct {
|
|||||||
} virt_to_real_irq_table[NR_IRQS];
|
} virt_to_real_irq_table[NR_IRQS];
|
||||||
static DEFINE_SPINLOCK(virt_irq_alloc_lock);
|
static DEFINE_SPINLOCK(virt_irq_alloc_lock);
|
||||||
|
|
||||||
unsigned char virt_irq_alloc(unsigned long real_irq)
|
unsigned char virt_irq_alloc(unsigned long real_irq,
|
||||||
|
unsigned int dev_handle,
|
||||||
|
unsigned int dev_ino)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
unsigned char ent;
|
unsigned char ent;
|
||||||
@ -154,6 +154,8 @@ unsigned char virt_irq_alloc(unsigned long real_irq)
|
|||||||
ent = 0;
|
ent = 0;
|
||||||
} else {
|
} else {
|
||||||
virt_to_real_irq_table[ent].irq = real_irq;
|
virt_to_real_irq_table[ent].irq = real_irq;
|
||||||
|
virt_to_real_irq_table[ent].dev_handle = dev_handle;
|
||||||
|
virt_to_real_irq_table[ent].dev_ino = dev_ino;
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_unlock_irqrestore(&virt_irq_alloc_lock, flags);
|
spin_unlock_irqrestore(&virt_irq_alloc_lock, flags);
|
||||||
@ -554,11 +556,12 @@ static void sun4v_virq_end(unsigned int virt_irq)
|
|||||||
|
|
||||||
static void run_pre_handler(unsigned int virt_irq)
|
static void run_pre_handler(unsigned int virt_irq)
|
||||||
{
|
{
|
||||||
struct ino_bucket *bucket = virt_irq_to_bucket(virt_irq);
|
|
||||||
struct irq_handler_data *data = get_irq_chip_data(virt_irq);
|
struct irq_handler_data *data = get_irq_chip_data(virt_irq);
|
||||||
|
unsigned int ino;
|
||||||
|
|
||||||
|
ino = virt_to_real_irq_table[virt_irq].dev_ino;
|
||||||
if (likely(data->pre_handler)) {
|
if (likely(data->pre_handler)) {
|
||||||
data->pre_handler(__irq_ino(__irq(bucket)),
|
data->pre_handler(ino,
|
||||||
data->pre_handler_arg1,
|
data->pre_handler_arg1,
|
||||||
data->pre_handler_arg2);
|
data->pre_handler_arg2);
|
||||||
}
|
}
|
||||||
@ -633,7 +636,7 @@ unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap)
|
|||||||
bucket = &ivector_table[ino];
|
bucket = &ivector_table[ino];
|
||||||
virt_irq = bucket_get_virt_irq(__pa(bucket));
|
virt_irq = bucket_get_virt_irq(__pa(bucket));
|
||||||
if (!virt_irq) {
|
if (!virt_irq) {
|
||||||
virt_irq = virt_irq_alloc(__irq(bucket));
|
virt_irq = virt_irq_alloc(__irq(bucket), 0, ino);
|
||||||
bucket_set_virt_irq(__pa(bucket), virt_irq);
|
bucket_set_virt_irq(__pa(bucket), virt_irq);
|
||||||
set_irq_chip(virt_irq, &sun4u_irq);
|
set_irq_chip(virt_irq, &sun4u_irq);
|
||||||
}
|
}
|
||||||
@ -668,7 +671,7 @@ static unsigned int sun4v_build_common(unsigned long sysino,
|
|||||||
bucket = &ivector_table[sysino];
|
bucket = &ivector_table[sysino];
|
||||||
virt_irq = bucket_get_virt_irq(__pa(bucket));
|
virt_irq = bucket_get_virt_irq(__pa(bucket));
|
||||||
if (!virt_irq) {
|
if (!virt_irq) {
|
||||||
virt_irq = virt_irq_alloc(__irq(bucket));
|
virt_irq = virt_irq_alloc(__irq(bucket), 0, sysino);
|
||||||
bucket_set_virt_irq(__pa(bucket), virt_irq);
|
bucket_set_virt_irq(__pa(bucket), virt_irq);
|
||||||
set_irq_chip(virt_irq, chip);
|
set_irq_chip(virt_irq, chip);
|
||||||
}
|
}
|
||||||
@ -716,7 +719,7 @@ unsigned int sun4v_build_virq(u32 devhandle, unsigned int devino)
|
|||||||
((unsigned long) bucket +
|
((unsigned long) bucket +
|
||||||
sizeof(struct ino_bucket)));
|
sizeof(struct ino_bucket)));
|
||||||
|
|
||||||
virt_irq = virt_irq_alloc(__irq(bucket));
|
virt_irq = virt_irq_alloc(__irq(bucket), devhandle, devino);
|
||||||
bucket_set_virt_irq(__pa(bucket), virt_irq);
|
bucket_set_virt_irq(__pa(bucket), virt_irq);
|
||||||
set_irq_chip(virt_irq, &sun4v_virq);
|
set_irq_chip(virt_irq, &sun4v_virq);
|
||||||
|
|
||||||
@ -741,9 +744,6 @@ unsigned int sun4v_build_virq(u32 devhandle, unsigned int devino)
|
|||||||
prom_halt();
|
prom_halt();
|
||||||
}
|
}
|
||||||
|
|
||||||
virt_to_real_irq_table[virt_irq].dev_handle = devhandle;
|
|
||||||
virt_to_real_irq_table[virt_irq].dev_ino = devino;
|
|
||||||
|
|
||||||
return virt_irq;
|
return virt_irq;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ int sparc64_setup_msi_irq(unsigned int *virt_irq_p,
|
|||||||
int msi, err;
|
int msi, err;
|
||||||
u32 msiqid;
|
u32 msiqid;
|
||||||
|
|
||||||
*virt_irq_p = virt_irq_alloc(~0);
|
*virt_irq_p = virt_irq_alloc(~0, 0, 0);
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
if (!*virt_irq_p)
|
if (!*virt_irq_p)
|
||||||
goto out_err;
|
goto out_err;
|
||||||
|
@ -59,7 +59,9 @@ extern unsigned int sun4u_build_msi(u32 portid, unsigned int *virt_irq_p,
|
|||||||
extern void sun4u_destroy_msi(unsigned int virt_irq);
|
extern void sun4u_destroy_msi(unsigned int virt_irq);
|
||||||
extern unsigned int sbus_build_irq(void *sbus, unsigned int ino);
|
extern unsigned int sbus_build_irq(void *sbus, unsigned int ino);
|
||||||
|
|
||||||
extern unsigned char virt_irq_alloc(unsigned long real_irq);
|
extern unsigned char virt_irq_alloc(unsigned long real_irq,
|
||||||
|
unsigned int dev_handle,
|
||||||
|
unsigned int dev_ino);
|
||||||
#ifdef CONFIG_PCI_MSI
|
#ifdef CONFIG_PCI_MSI
|
||||||
extern void virt_irq_free(unsigned int virt_irq);
|
extern void virt_irq_free(unsigned int virt_irq);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user