diff options
author | Jean-Philippe Brucker <jean-philippe.brucker@arm.com> | 2015-10-01 08:47:15 -0400 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2015-10-09 18:11:52 -0400 |
commit | f6c86a41e1dc2214363b00cc0eadb8a5401c892d (patch) | |
tree | ff47035d9a9b35c2b1aab591a26a8eb68eb396cf /drivers/irqchip/irq-gic-v3.c | |
parent | 7936e914f7b0827c2dcfe63fbefdc21de2d61dcb (diff) |
irqchip/gic-v3: Change unsigned types for AArch32 compatibility
This patch does a few simple compatibility-related changes:
- change the system register access prototypes to their actual size,
- homogenise mpidr accesses with unsigned long,
- force the 64bit register values to unsigned long long.
Note: the list registers are 64bit on GICv3, but the AArch32 vGIC driver
will need to split their values into two 32bit registers: LRn and LRCn.
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'drivers/irqchip/irq-gic-v3.c')
-rw-r--r-- | drivers/irqchip/irq-gic-v3.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index bf3df7961a5b..6125bbd777e7 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c | |||
@@ -319,11 +319,11 @@ static int gic_irq_set_vcpu_affinity(struct irq_data *d, void *vcpu) | |||
319 | return 0; | 319 | return 0; |
320 | } | 320 | } |
321 | 321 | ||
322 | static u64 gic_mpidr_to_affinity(u64 mpidr) | 322 | static u64 gic_mpidr_to_affinity(unsigned long mpidr) |
323 | { | 323 | { |
324 | u64 aff; | 324 | u64 aff; |
325 | 325 | ||
326 | aff = (MPIDR_AFFINITY_LEVEL(mpidr, 3) << 32 | | 326 | aff = ((u64)MPIDR_AFFINITY_LEVEL(mpidr, 3) << 32 | |
327 | MPIDR_AFFINITY_LEVEL(mpidr, 2) << 16 | | 327 | MPIDR_AFFINITY_LEVEL(mpidr, 2) << 16 | |
328 | MPIDR_AFFINITY_LEVEL(mpidr, 1) << 8 | | 328 | MPIDR_AFFINITY_LEVEL(mpidr, 1) << 8 | |
329 | MPIDR_AFFINITY_LEVEL(mpidr, 0)); | 329 | MPIDR_AFFINITY_LEVEL(mpidr, 0)); |
@@ -333,7 +333,7 @@ static u64 gic_mpidr_to_affinity(u64 mpidr) | |||
333 | 333 | ||
334 | static asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs) | 334 | static asmlinkage void __exception_irq_entry gic_handle_irq(struct pt_regs *regs) |
335 | { | 335 | { |
336 | u64 irqnr; | 336 | u32 irqnr; |
337 | 337 | ||
338 | do { | 338 | do { |
339 | irqnr = gic_read_iar(); | 339 | irqnr = gic_read_iar(); |
@@ -397,7 +397,7 @@ static void __init gic_dist_init(void) | |||
397 | 397 | ||
398 | static int gic_populate_rdist(void) | 398 | static int gic_populate_rdist(void) |
399 | { | 399 | { |
400 | u64 mpidr = cpu_logical_map(smp_processor_id()); | 400 | unsigned long mpidr = cpu_logical_map(smp_processor_id()); |
401 | u64 typer; | 401 | u64 typer; |
402 | u32 aff; | 402 | u32 aff; |
403 | int i; | 403 | int i; |
@@ -428,10 +428,9 @@ static int gic_populate_rdist(void) | |||
428 | u64 offset = ptr - gic_data.redist_regions[i].redist_base; | 428 | u64 offset = ptr - gic_data.redist_regions[i].redist_base; |
429 | gic_data_rdist_rd_base() = ptr; | 429 | gic_data_rdist_rd_base() = ptr; |
430 | gic_data_rdist()->phys_base = gic_data.redist_regions[i].phys_base + offset; | 430 | gic_data_rdist()->phys_base = gic_data.redist_regions[i].phys_base + offset; |
431 | pr_info("CPU%d: found redistributor %llx region %d:%pa\n", | 431 | pr_info("CPU%d: found redistributor %lx region %d:%pa\n", |
432 | smp_processor_id(), | 432 | smp_processor_id(), mpidr, i, |
433 | (unsigned long long)mpidr, | 433 | &gic_data_rdist()->phys_base); |
434 | i, &gic_data_rdist()->phys_base); | ||
435 | return 0; | 434 | return 0; |
436 | } | 435 | } |
437 | 436 | ||
@@ -446,8 +445,8 @@ static int gic_populate_rdist(void) | |||
446 | } | 445 | } |
447 | 446 | ||
448 | /* We couldn't even deal with ourselves... */ | 447 | /* We couldn't even deal with ourselves... */ |
449 | WARN(true, "CPU%d: mpidr %llx has no re-distributor!\n", | 448 | WARN(true, "CPU%d: mpidr %lx has no re-distributor!\n", |
450 | smp_processor_id(), (unsigned long long)mpidr); | 449 | smp_processor_id(), mpidr); |
451 | return -ENODEV; | 450 | return -ENODEV; |
452 | } | 451 | } |
453 | 452 | ||
@@ -524,10 +523,10 @@ static struct notifier_block gic_cpu_notifier = { | |||
524 | }; | 523 | }; |
525 | 524 | ||
526 | static u16 gic_compute_target_list(int *base_cpu, const struct cpumask *mask, | 525 | static u16 gic_compute_target_list(int *base_cpu, const struct cpumask *mask, |
527 | u64 cluster_id) | 526 | unsigned long cluster_id) |
528 | { | 527 | { |
529 | int cpu = *base_cpu; | 528 | int cpu = *base_cpu; |
530 | u64 mpidr = cpu_logical_map(cpu); | 529 | unsigned long mpidr = cpu_logical_map(cpu); |
531 | u16 tlist = 0; | 530 | u16 tlist = 0; |
532 | 531 | ||
533 | while (cpu < nr_cpu_ids) { | 532 | while (cpu < nr_cpu_ids) { |
@@ -588,7 +587,7 @@ static void gic_raise_softirq(const struct cpumask *mask, unsigned int irq) | |||
588 | smp_wmb(); | 587 | smp_wmb(); |
589 | 588 | ||
590 | for_each_cpu(cpu, mask) { | 589 | for_each_cpu(cpu, mask) { |
591 | u64 cluster_id = cpu_logical_map(cpu) & ~0xffUL; | 590 | unsigned long cluster_id = cpu_logical_map(cpu) & ~0xffUL; |
592 | u16 tlist; | 591 | u16 tlist; |
593 | 592 | ||
594 | tlist = gic_compute_target_list(&cpu, mask, cluster_id); | 593 | tlist = gic_compute_target_list(&cpu, mask, cluster_id); |