mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-19 03:06:39 +00:00
L4Linux: fix IRQ save functions (fix #406)
This commit is contained in:
parent
42a263b74f
commit
0114391e0a
@ -514,11 +514,11 @@ Index: arch/l4/kernel/main.c
|
||||
|
||||
+static spinlock_t migrate_lock;
|
||||
+
|
||||
+void l4x_irq_save(unsigned long flags) { local_irq_save(flags); }
|
||||
+void l4x_irq_save(unsigned long *flags) { local_irq_save(*flags); }
|
||||
+void l4x_irq_restore(unsigned long flags) { local_irq_restore(flags); }
|
||||
+unsigned long l4x_hz(void) { return HZ; }
|
||||
+int l4x_nr_irqs(void) { return NR_IRQS; }
|
||||
+void l4x_migrate_lock(unsigned long flags) { spin_lock_irqsave(&migrate_lock, flags); }
|
||||
+void l4x_migrate_lock(unsigned long *flags) { spin_lock_irqsave(&migrate_lock, *flags); }
|
||||
+void l4x_migrate_unlock(unsigned long flags) { spin_unlock_irqrestore(&migrate_lock, flags);}
|
||||
+
|
||||
+unsigned l4x_target_cpu(const struct cpumask *dest)
|
||||
|
@ -22,9 +22,9 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
FASTCALL void l4x_irq_save(unsigned long flags);
|
||||
FASTCALL void l4x_irq_save(unsigned long *flags);
|
||||
FASTCALL void l4x_irq_restore(unsigned long flags);
|
||||
FASTCALL void l4x_migrate_lock(unsigned long flags);
|
||||
FASTCALL void l4x_migrate_lock(unsigned long *flags);
|
||||
FASTCALL void l4x_migrate_unlock(unsigned long flags);
|
||||
FASTCALL unsigned long l4x_hz();
|
||||
FASTCALL int l4x_nr_irqs(void);
|
||||
@ -35,7 +35,7 @@ FASTCALL void l4x_cpumask_copy(struct irq_data*, const struct cpumask*);
|
||||
|
||||
#define IRQ_SAFE(x) do { \
|
||||
unsigned long flags = 0; \
|
||||
l4x_irq_save(flags); \
|
||||
l4x_irq_save(&flags); \
|
||||
x; \
|
||||
l4x_irq_restore(flags); \
|
||||
} while(0)
|
||||
@ -56,7 +56,7 @@ namespace Linux {
|
||||
|
||||
public:
|
||||
|
||||
Irq_guard() : _flags(0) { l4x_irq_save(_flags); }
|
||||
Irq_guard() : _flags(0) { l4x_irq_save(&_flags); }
|
||||
~Irq_guard() { l4x_irq_restore(_flags); }
|
||||
};
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ void l4lx_irq_dev_enable(struct irq_data *data)
|
||||
if (DEBUG)
|
||||
PDBG("irq=%d cap=%lx", data->irq, p->irq_cap);
|
||||
|
||||
l4x_irq_save(flags);
|
||||
l4x_irq_save(&flags);
|
||||
l4_msgtag_t ret = l4_irq_attach(p->irq_cap, data->irq << 2,
|
||||
l4x_cpu_thread_get_cap(p->cpu));
|
||||
if (l4_error(ret))
|
||||
@ -165,7 +165,7 @@ int l4lx_irq_dev_set_affinity(struct irq_data *data,
|
||||
return 0;
|
||||
|
||||
unsigned long flags;
|
||||
l4x_migrate_lock(flags);
|
||||
l4x_migrate_lock(&flags);
|
||||
|
||||
{
|
||||
Linux::Irq_guard guard;
|
||||
|
@ -159,14 +159,11 @@ int l4lx_task_delete_task(l4_cap_idx_t task, unsigned option)
|
||||
{
|
||||
using namespace L4lx;
|
||||
|
||||
unsigned long flags = 0;
|
||||
l4x_irq_save(flags);
|
||||
Linux::Irq_guard guard;
|
||||
|
||||
Task *entry = Env::env()->tasks()->find_by_ref(task);
|
||||
Env::env()->tasks()->remove(entry);
|
||||
destroy(Genode::env()->heap(), entry);
|
||||
|
||||
l4x_irq_restore(flags);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user