arm/gic: add missing parameter names and uniform function declarations

Add missing parameter names and remove inconsistencies between GICv3
and GICv2. No functional change.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
Federico Serafini authored and Stefano Stabellini committed 2023-11-07 12:42:30 -08:00
1 parent dc79336075
commit f3795523dc
2 files changed
+17 -17

No files matched your search

+11 -11
View File
@@ -1086,29 +1086,29 @@ static void gicv3_read_lr(int lr, struct gic_lr *lr_reg)
}
}
static void gicv3_write_lr(int lr_reg, const struct gic_lr *lr)
static void gicv3_write_lr(int lr, const struct gic_lr *lr_reg)
{
uint64_t lrv = 0;
const enum gic_version vgic_version = current->domain->arch.vgic.version;
lrv = ( ((u64)(lr->virq & ICH_LR_VIRTUAL_MASK) << ICH_LR_VIRTUAL_SHIFT) |
((u64)(lr->priority & ICH_LR_PRIORITY_MASK) << ICH_LR_PRIORITY_SHIFT) );
lrv = ( ((u64)(lr_reg->virq & ICH_LR_VIRTUAL_MASK) << ICH_LR_VIRTUAL_SHIFT) |
((u64)(lr_reg->priority & ICH_LR_PRIORITY_MASK) << ICH_LR_PRIORITY_SHIFT) );
if ( lr->active )
if ( lr_reg->active )
lrv |= ICH_LR_STATE_ACTIVE;
if ( lr->pending )
if ( lr_reg->pending )
lrv |= ICH_LR_STATE_PENDING;
if ( lr->hw_status )
if ( lr_reg->hw_status )
{
lrv |= ICH_LR_HW;
lrv |= (uint64_t)lr->hw.pirq << ICH_LR_PHYSICAL_SHIFT;
lrv |= (uint64_t)lr_reg->hw.pirq << ICH_LR_PHYSICAL_SHIFT;
}
else
{
if ( lr->virt.eoi )
if ( lr_reg->virt.eoi )
lrv |= ICH_LR_MAINTENANCE_IRQ;
/* Source is only set in GICv2 compatible mode */
if ( vgic_version == GIC_V2 )
@@ -1117,8 +1117,8 @@ static void gicv3_write_lr(int lr_reg, const struct gic_lr *lr)
* Source is only valid for SGIs, the caller should make
* sure the field virt.source is always 0 for non-SGI.
*/
ASSERT(!lr->virt.source || lr->virq < NR_GIC_SGI);
lrv |= (uint64_t)lr->virt.source << ICH_LR_CPUID_SHIFT;
ASSERT(!lr_reg->virt.source || lr_reg->virq < NR_GIC_SGI);
lrv |= (uint64_t)lr_reg->virt.source << ICH_LR_CPUID_SHIFT;
}
}
@@ -1129,7 +1129,7 @@ static void gicv3_write_lr(int lr_reg, const struct gic_lr *lr)
if ( vgic_version == GIC_V3 )
lrv |= ICH_LR_GRP1;
gicv3_ich_write_lr(lr_reg, lrv);
gicv3_ich_write_lr(lr, lrv);
}
static void gicv3_hcr_status(uint32_t flag, bool status)
+6 -6
View File
@@ -246,7 +246,7 @@ void gic_set_irq_type(struct irq_desc *desc, unsigned int type);
/* Program the GIC to route an interrupt */
extern void gic_route_irq_to_xen(struct irq_desc *desc, unsigned int priority);
extern int gic_route_irq_to_guest(struct domain *, unsigned int virq,
extern int gic_route_irq_to_guest(struct domain *d, unsigned int virq,
struct irq_desc *desc,
unsigned int priority);
@@ -330,11 +330,11 @@ struct gic_hw_operations {
/* Initialize the GIC and the boot CPU */
int (*init)(void);
/* Save GIC registers */
void (*save_state)(struct vcpu *);
void (*save_state)(struct vcpu *v);
/* Restore GIC registers */
void (*restore_state)(const struct vcpu *);
void (*restore_state)(const struct vcpu *v);
/* Dump GIC LR register information */
void (*dump_state)(const struct vcpu *);
void (*dump_state)(const struct vcpu *v);
/* hw_irq_controller to enable/disable/eoi host irq */
hw_irq_controller *gic_host_irq_type;
@@ -369,9 +369,9 @@ struct gic_hw_operations {
/* Clear LR register */
void (*clear_lr)(int lr);
/* Read LR register and populate gic_lr structure */
void (*read_lr)(int lr, struct gic_lr *);
void (*read_lr)(int lr, struct gic_lr *lr_reg);
/* Write LR register from gic_lr structure */
void (*write_lr)(int lr, const struct gic_lr *);
void (*write_lr)(int lr, const struct gic_lr *lr_reg);
/* Read VMCR priority */
unsigned int (*read_vmcr_priority)(void);
/* Read APRn register */
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.