summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown2006-04-29 18:42:09 +0200
committerMichael Brown2006-04-29 18:42:09 +0200
commit23c494d14efafdd1dd06cec53665ddfd1c20fa34 (patch)
tree272441de75567c13f2d6075b771b0fad2ab1ba5a /src/include
parentGive uIP a static IP address for proof-of-concept testing (diff)
downloadipxe-23c494d14efafdd1dd06cec53665ddfd1c20fa34.tar.gz
ipxe-23c494d14efafdd1dd06cec53665ddfd1c20fa34.tar.xz
ipxe-23c494d14efafdd1dd06cec53665ddfd1c20fa34.zip
Added basic code for implementing co-operative multitasking.
Yes, you really can do it in 65 bytes.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gpxe/process.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/include/gpxe/process.h b/src/include/gpxe/process.h
new file mode 100644
index 00000000..83ff8393
--- /dev/null
+++ b/src/include/gpxe/process.h
@@ -0,0 +1,32 @@
+#ifndef _GPXE_PROCESS_H
+#define _GPXE_PROCESS_H
+
+/** @file
+ *
+ * Processes
+ *
+ */
+
+#include <gpxe/list.h>
+
+/** A process */
+struct process {
+ /** List of processes */
+ struct list_head list;
+ /**
+ * Single-step the process
+ *
+ * This method should execute a single step of the process.
+ * Returning from this method is isomorphic to yielding the
+ * CPU to another process.
+ *
+ * If the process wishes to be executed again, it must re-add
+ * itself to the run queue using schedule().
+ */
+ void ( * step ) ( struct process *process );
+};
+
+extern void schedule ( struct process *process );
+extern void step ( void );
+
+#endif /* _GPXE_PROCESS_H */