diff --git a/libcpu/aarch64/common/interrupt.c b/libcpu/aarch64/common/interrupt.c index 5a0b67160c..e30223a696 100644 --- a/libcpu/aarch64/common/interrupt.c +++ b/libcpu/aarch64/common/interrupt.c @@ -237,7 +237,7 @@ unsigned int rt_hw_interrupt_get_target_cpus(int vector) */ void rt_hw_interrupt_set_triger_mode(int vector, unsigned int mode) { - arm_gic_set_configuration(0, vector, mode); + arm_gic_set_configuration(0, vector, mode & IRQ_MODE_MASK); } /** diff --git a/libcpu/aarch64/common/interrupt.h b/libcpu/aarch64/common/interrupt.h index 1c4199c61b..4ff642a874 100644 --- a/libcpu/aarch64/common/interrupt.h +++ b/libcpu/aarch64/common/interrupt.h @@ -19,6 +19,7 @@ #define IRQ_MODE_TRIG_LEVEL (0x00) /* Trigger: level triggered interrupt */ #define IRQ_MODE_TRIG_EDGE (0x01) /* Trigger: edge triggered interrupt */ +#define IRQ_MODE_MASK (0x01) void rt_hw_vector_init(void); diff --git a/libcpu/arm/cortex-a/interrupt.c b/libcpu/arm/cortex-a/interrupt.c index d0cc89d6e2..bfb3b27170 100644 --- a/libcpu/arm/cortex-a/interrupt.c +++ b/libcpu/arm/cortex-a/interrupt.c @@ -179,7 +179,7 @@ unsigned int rt_hw_interrupt_get_target_cpus(int vector) */ void rt_hw_interrupt_set_triger_mode(int vector, unsigned int mode) { - arm_gic_set_configuration(0, vector, mode); + arm_gic_set_configuration(0, vector, mode & IRQ_MODE_MASK); } /** diff --git a/libcpu/arm/cortex-a/interrupt.h b/libcpu/arm/cortex-a/interrupt.h index dda6c5534a..eddaba8bde 100644 --- a/libcpu/arm/cortex-a/interrupt.h +++ b/libcpu/arm/cortex-a/interrupt.h @@ -19,6 +19,7 @@ #define IRQ_MODE_TRIG_LEVEL (0x00) /* Trigger: level triggered interrupt */ #define IRQ_MODE_TRIG_EDGE (0x01) /* Trigger: edge triggered interrupt */ +#define IRQ_MODE_MASK (0x01) void rt_hw_vector_init(void);