[syslinux:lwip] core: pxe: pm return hook to examine timer ticks and PXE ISR status

syslinux-bot for H. Peter Anvin hpa at zytor.com
Fri Apr 22 20:05:22 PDT 2011


Commit-ID:  d6103068834b100a2a636ce0d9f2dfc727829c4f
Gitweb:     http://syslinux.zytor.com/commit/d6103068834b100a2a636ce0d9f2dfc727829c4f
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Thu, 10 Sep 2009 17:51:05 -0700
Committer:  Eric W. Biederman <ebiederm at xmission.com>
CommitDate: Sat, 9 Apr 2011 18:27:07 -0700

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 at zytor.com>


---
 core/fs/pxe/isr.c |   44 ++++++++++++++++++++++++++++++++++++++++++++
 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 0000000..105f971
--- /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;
+}
+
+    



More information about the Syslinux-commits mailing list