aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-09-10 17:51:05 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-09-10 17:51:05 -0700
commit8ab3e6c4236a40674325a13cc9f5dceaee3400d3 (patch)
treea77b088b6bd4fcf2b099d24a5365afda84b2346b
parentfbab95e73c9f4ad26e29d4db5ce1ffc9e89b4e9d (diff)
downloadlwip-8ab3e6c4236a40674325a13cc9f5dceaee3400d3.tar.gz
lwip-8ab3e6c4236a40674325a13cc9f5dceaee3400d3.tar.xz
lwip-8ab3e6c4236a40674325a13cc9f5dceaee3400d3.zip
core: pxe: pm return hook to examine timer ticks and PXE ISR status
When returning to protected mode, check to see if we have any pending actions due to interrupts. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--core/fs/pxe/isr.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/core/fs/pxe/isr.c b/core/fs/pxe/isr.c
new file mode 100644
index 00000000..105f971f
--- /dev/null
+++ b/core/fs/pxe/isr.c
@@ -0,0 +1,44 @@
+/*
+ * core/fs/pxe/isr.c
+ *
+ * Stub invoked on return from real mode including from an interrupt.
+ * Interrupts are locked out on entry.
+ */
+
+#include "core.h"
+#include "thread.h"
+
+extern uint8_t pxe_irq_pending;
+struct semaphore pxe_receive_thread_sem;
+
+static void pm_return(void)
+{
+ static uint32_t last_jiffies = 0;
+ uint32_t now = jiffies();
+
+ __schedule_lock++;
+
+ if (now != last_jiffies) {
+ last_jiffies = now;
+ __thread_process_timeouts();
+ }
+
+ if (pxe_irq_pending) {
+ pxe_irq_pending = 0;
+ sem_up(&pxe_receive_thread_sem);
+ }
+
+ __schedule_lock--;
+
+ if (__need_schedule)
+ __schedule();
+}
+
+void pxe_init_isr(void)
+{
+ start_idle_thread();
+ sem_init(&pxe_receive_thread_sem, 0);
+ core_pm_hook = pm_return;
+}
+
+