summaryrefslogtreecommitdiffstats
path: root/src/include/gpxe/process.h
diff options
context:
space:
mode:
authorMichael Brown2007-07-03 21:09:14 +0200
committerMichael Brown2007-07-03 21:09:14 +0200
commitfd86c819ba559760b9bf7eaca1b21a0fd81ef6b6 (patch)
treeba4c0aa4612bed0a66d420a93356df09316214e0 /src/include/gpxe/process.h
parentMerge branch 'master' of /pub/scm/gpxe (diff)
downloadipxe-fd86c819ba559760b9bf7eaca1b21a0fd81ef6b6.tar.gz
ipxe-fd86c819ba559760b9bf7eaca1b21a0fd81ef6b6.tar.xz
ipxe-fd86c819ba559760b9bf7eaca1b21a0fd81ef6b6.zip
Use a linker-table based system to automatically mark and start up
permanent processes, rather than requiring each one to have its own initialisation function.
Diffstat (limited to 'src/include/gpxe/process.h')
-rw-r--r--src/include/gpxe/process.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/include/gpxe/process.h b/src/include/gpxe/process.h
index c0837fa4..595787c0 100644
--- a/src/include/gpxe/process.h
+++ b/src/include/gpxe/process.h
@@ -9,6 +9,7 @@
#include <gpxe/list.h>
#include <gpxe/refcnt.h>
+#include <gpxe/tables.h>
/** A process */
struct process {
@@ -33,6 +34,7 @@ struct process {
extern void process_add ( struct process *process );
extern void process_del ( struct process *process );
extern void step ( void );
+extern void init_processes ( void );
/**
* Initialise process without adding to process list
@@ -62,4 +64,13 @@ process_init ( struct process *process,
process_add ( process );
}
+/**
+ * Declare a permanent process
+ *
+ * Permanent processes will be automatically added to the process list
+ * at initialisation time.
+ */
+#define __permanent_process \
+ __table ( struct process, processes, 01 )
+
#endif /* _GPXE_PROCESS_H */