@@ -171,26 +171,67 @@ static inline void arch_allocate_tasks(void)
171171{
172172 /* irq low */
173173 struct irq_task * * low = task_irq_low_get ();
174- * low = rzalloc (RZONE_SYS , SOF_MEM_CAPS_RAM , sizeof (* * low ));
174+ * low = rzalloc (RZONE_RUNTIME , SOF_MEM_CAPS_RAM , sizeof (* * low ));
175175 list_init (& ((* low )-> list ));
176176 spinlock_init (& ((* low )-> lock ));
177177 (* low )-> irq = PLATFORM_IRQ_TASK_LOW ;
178178
179179 /* irq medium */
180180 struct irq_task * * med = task_irq_med_get ();
181- * med = rzalloc (RZONE_SYS , SOF_MEM_CAPS_RAM , sizeof (* * med ));
181+ * med = rzalloc (RZONE_RUNTIME , SOF_MEM_CAPS_RAM , sizeof (* * med ));
182182 list_init (& ((* med )-> list ));
183183 spinlock_init (& ((* med )-> lock ));
184184 (* med )-> irq = PLATFORM_IRQ_TASK_MED ;
185185
186186 /* irq high */
187187 struct irq_task * * high = task_irq_high_get ();
188- * high = rzalloc (RZONE_SYS , SOF_MEM_CAPS_RAM , sizeof (* * high ));
188+ * high = rzalloc (RZONE_RUNTIME , SOF_MEM_CAPS_RAM , sizeof (* * high ));
189189 list_init (& ((* high )-> list ));
190190 spinlock_init (& ((* high )-> lock ));
191191 (* high )-> irq = PLATFORM_IRQ_TASK_HIGH ;
192192}
193193
194+ /**
195+ * \brief Frees IRQ tasks.
196+ */
197+ static inline void arch_free_tasks (void )
198+ {
199+ uint32_t flags ;
200+
201+ /* free IRQ low task */
202+ struct irq_task * * low = task_irq_low_get ();
203+
204+ spin_lock_irq (& (* low )-> lock , flags );
205+ interrupt_disable (PLATFORM_IRQ_TASK_LOW );
206+ interrupt_unregister (PLATFORM_IRQ_TASK_LOW );
207+ list_item_del (& (* low )-> list );
208+ spin_unlock_irq (& (* low )-> lock , flags );
209+
210+ rfree (* low );
211+
212+ /* free IRQ medium task */
213+ struct irq_task * * med = task_irq_med_get ();
214+
215+ spin_lock_irq (& (* med )-> lock , flags );
216+ interrupt_disable (PLATFORM_IRQ_TASK_MED );
217+ interrupt_unregister (PLATFORM_IRQ_TASK_MED );
218+ list_item_del (& (* med )-> list );
219+ spin_unlock_irq (& (* med )-> lock , flags );
220+
221+ rfree (* med );
222+
223+ /* free IRQ high task */
224+ struct irq_task * * high = task_irq_high_get ();
225+
226+ spin_lock_irq (& (* high )-> lock , flags );
227+ interrupt_disable (PLATFORM_IRQ_TASK_HIGH );
228+ interrupt_unregister (PLATFORM_IRQ_TASK_HIGH );
229+ list_item_del (& (* high )-> list );
230+ spin_unlock_irq (& (* high )-> lock , flags );
231+
232+ rfree (* high );
233+ }
234+
194235/**
195236 * \brief Assigns IRQ tasks to interrupts.
196237 */
0 commit comments