aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-03-30 16:51:36 -0700
committerChristian Cunningham <cc@localhost>2022-03-30 16:51:36 -0700
commitb6ca3a4df6ca34cd40f09d4b97e54679eb95840a (patch)
treea83556c6639cb5d605b2579e6034a889319edc7e /kernel
parent90227ef8d65052622d09698dc80a27cd67f4bc0a (diff)
Timer execute once
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cpu/irq.c8
1 files changed, 8 insertions, 0 deletions
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