Skip to content

Commit dae274e

Browse files
author
shaojinchun
committed
fix gic ack irq problem
1 parent e68ec7a commit dae274e

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

Diff for: libcpu/arm/cortex-a/gic.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,8 @@ void arm_gic_ack(rt_uint32_t index, int irq)
7474
irq = irq - _gic_table[index].offset;
7575
RT_ASSERT(irq >= 0);
7676

77-
GIC_DIST_ENABLE_CLEAR(_gic_table[index].dist_hw_base, irq) = mask;
77+
GIC_DIST_PENDING_CLEAR(_gic_table[index].dist_hw_base, irq) = mask;
7878
GIC_CPU_EOI(_gic_table[index].cpu_hw_base) = irq;
79-
GIC_DIST_ENABLE_SET(_gic_table[index].dist_hw_base, irq) = mask;
8079
}
8180

8281
void arm_gic_mask(rt_uint32_t index, int irq)

Diff for: libcpu/arm/zynq7000/gic.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static struct arm_gic _gic_table[ARM_GIC_MAX_NR];
3737
#define GIC_DIST_ENABLE_SET(hw_base, n) __REG32((hw_base) + 0x100 + (n/32) * 4)
3838
#define GIC_DIST_ENABLE_CLEAR(hw_base, n) __REG32((hw_base) + 0x180 + (n/32) * 4)
3939
#define GIC_DIST_PENDING_SET(hw_base, n) __REG32((hw_base) + 0x200)
40-
#define GIC_DIST_PENDING_CLEAR(hw_base, n) __REG32((hw_base) + 0x280)
40+
#define GIC_DIST_PENDING_CLEAR(hw_base, n) __REG32((hw_base) + 0x280 + (n/32) * 4)
4141
#define GIC_DIST_ACTIVE_BIT(hw_base) __REG32((hw_base) + 0x300)
4242
#define GIC_DIST_PRI(hw_base, n) __REG32((hw_base) + 0x400 + (n/4) * 4)
4343
#define GIC_DIST_TARGET(hw_base, n) __REG32((hw_base) + 0x800 + (n/4) * 4)
@@ -68,9 +68,8 @@ void arm_gic_ack(rt_uint32_t index, int irq)
6868
irq = irq - _gic_table[index].offset;
6969
RT_ASSERT(irq >= 0);
7070

71-
GIC_DIST_ENABLE_CLEAR(_gic_table[index].dist_hw_base, irq) = mask;
71+
GIC_DIST_PENDING_CLEAR(_gic_table[index].dist_hw_base, irq) = mask;
7272
GIC_CPU_EOI(_gic_table[index].cpu_hw_base) = irq;
73-
GIC_DIST_ENABLE_SET(_gic_table[index].dist_hw_base, irq) = mask;
7473
}
7574

7675
void arm_gic_mask(rt_uint32_t index, int irq)

0 commit comments

Comments
 (0)