projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove obsolete header.
[bertos.git]
/
bertos
/
kern
/
irq.c
diff --git
a/bertos/kern/irq.c
b/bertos/kern/irq.c
index 9b87d69b25420b03798c027adad670524a1ff65f..dba432ef890a2d8af77a5257f9d1fc35db35b113 100644
(file)
--- a/
bertos/kern/irq.c
+++ b/
bertos/kern/irq.c
@@
-38,6
+38,7
@@
#include <cfg/module.h>
#include <kern/proc_p.h>
#include <cfg/module.h>
#include <kern/proc_p.h>
+#include <kern/proc.h>
#include <cfg/cfg_kern.h>
#include <cfg/cfg_kern.h>
@@
-52,7
+53,9
@@
static void (*irq_handlers[100])(void);
/* signal handler */
void irq_entry(int signum)
{
/* signal handler */
void irq_entry(int signum)
{
+#if CONFIG_KERN_PREEMPT
Process * const old_process = CurrentProcess;
Process * const old_process = CurrentProcess;
+#endif
irq_handlers[signum]();
irq_handlers[signum]();
@@
-61,18
+64,20
@@
void irq_entry(int signum)
if (old_process != CurrentProcess)
{
if (old_process != CurrentProcess)
{
+ IRQ_DISABLE;
+
TRACEMSG("switching from %p:%s to %p:%s",
old_process, old_process ? old_process->monitor.name : "---",
TRACEMSG("switching from %p:%s to %p:%s",
old_process, old_process ? old_process->monitor.name : "---",
- CurrentProcess,
CurrentProcess->monitor.name
);
+ CurrentProcess,
proc_currentName()
);
if (old_process)
swapcontext(&old_process->context, &CurrentProcess->context);
else
setcontext(&CurrentProcess->context);
if (old_process)
swapcontext(&old_process->context, &CurrentProcess->context);
else
setcontext(&CurrentProcess->context);
- // not reached
+ IRQ_ENABLE;
}
}
-
//TRACEMSG("keep
ing %p:%s", CurrentProcess, CurrentProcess->monitor.name);
+
TRACEMSG("resum
ing %p:%s", CurrentProcess, CurrentProcess->monitor.name);
#endif // CONFIG_KERN_PREEMPT
}
#endif // CONFIG_KERN_PREEMPT
}
@@
-84,6
+89,7
@@
void irq_register(int irq, void (*callback)(void))
void irq_init(void)
{
struct sigaction act;
void irq_init(void)
{
struct sigaction act;
+
act.sa_handler = irq_entry;
sigemptyset(&act.sa_mask);
//sigaddset(&act.sa_mask, irq);
act.sa_handler = irq_entry;
sigemptyset(&act.sa_mask);
//sigaddset(&act.sa_mask, irq);