From b6ca3a4df6ca34cd40f09d4b97e54679eb95840a Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Wed, 30 Mar 2022 16:51:36 -0700 Subject: Timer execute once --- kernel/cpu/irq.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'kernel') diff --git a/kernel/cpu/irq.c b/kernel/cpu/irq.c index f718b7e..2990881 100644 --- a/kernel/cpu/irq.c +++ b/kernel/cpu/irq.c @@ -61,6 +61,8 @@ unsigned long c_irq_handler(void) *nexttime = *timer_chi + stinfo->tick_rate; *timer_cs = SYS_TIMER_SC_M0; scheduled = 1; + if (stinfo->oneshot) + store32(SYS_TIMER_SC_M0, IRQ_DISABLE1); } // Check if System Time Compare 1 Triggered the Interrupt if (*(volatile unsigned long*)SYS_TIMER_CS & SYS_TIMER_SC_M1 && irqs[SYS_TIMER_1_IRQ].handler != 0) { @@ -72,6 +74,8 @@ unsigned long c_irq_handler(void) *nexttime = *timer_chi + stinfo->tick_rate; *timer_cs = SYS_TIMER_SC_M1; scheduled = 1; + if (stinfo->oneshot) + store32(SYS_TIMER_SC_M1, IRQ_DISABLE1); } // Check if System Time Compare 2 Triggered the Interrupt if (*(volatile unsigned long*)SYS_TIMER_CS & SYS_TIMER_SC_M2 && irqs[SYS_TIMER_2_IRQ].handler != 0) { @@ -83,6 +87,8 @@ unsigned long c_irq_handler(void) *nexttime = *timer_chi + stinfo->tick_rate; *timer_cs = SYS_TIMER_SC_M2; scheduled = 1; + if (stinfo->oneshot) + store32(SYS_TIMER_SC_M2, IRQ_DISABLE1); } // Check if System Time Compare 3 Triggered the Interrupt if (*(volatile unsigned long*)SYS_TIMER_CS & SYS_TIMER_SC_M3 && irqs[SYS_TIMER_3_IRQ].handler != 0) { @@ -94,6 +100,8 @@ unsigned long c_irq_handler(void) *nexttime = *timer_chi + stinfo->tick_rate; *timer_cs = SYS_TIMER_SC_M3; scheduled = 1; + if (stinfo->oneshot) + store32(SYS_TIMER_SC_M3, IRQ_DISABLE1); } } // Check if CNTV triggered the interrupt -- cgit v1.2.1