|
@@ -39,6 +39,8 @@ struct process_descriptor {
|
39
|
39
|
* CPU to another process.
|
40
|
40
|
*/
|
41
|
41
|
void ( * step ) ( void *object );
|
|
42
|
+ /** Automatically reschedule the process */
|
|
43
|
+ int reschedule;
|
42
|
44
|
};
|
43
|
45
|
|
44
|
46
|
/**
|
|
@@ -78,6 +80,21 @@ struct process_descriptor {
|
78
|
80
|
#define PROC_DESC( object_type, process, _step ) { \
|
79
|
81
|
.offset = process_offset ( object_type, process ), \
|
80
|
82
|
.step = PROC_STEP ( object_type, _step ), \
|
|
83
|
+ .reschedule = 1, \
|
|
84
|
+ }
|
|
85
|
+
|
|
86
|
+/**
|
|
87
|
+ * Define a process descriptor for a process that runs only once
|
|
88
|
+ *
|
|
89
|
+ * @v object_type Containing object data type
|
|
90
|
+ * @v process Process name (i.e. field within object data type)
|
|
91
|
+ * @v step Process' step() method
|
|
92
|
+ * @ret desc Object interface descriptor
|
|
93
|
+ */
|
|
94
|
+#define PROC_DESC_ONCE( object_type, process, _step ) { \
|
|
95
|
+ .offset = process_offset ( object_type, process ), \
|
|
96
|
+ .step = PROC_STEP ( object_type, _step ), \
|
|
97
|
+ .reschedule = 0, \
|
81
|
98
|
}
|
82
|
99
|
|
83
|
100
|
/**
|
|
@@ -91,6 +108,7 @@ struct process_descriptor {
|
91
|
108
|
#define PROC_DESC_PURE( _step ) { \
|
92
|
109
|
.offset = 0, \
|
93
|
110
|
.step = PROC_STEP ( struct process, _step ), \
|
|
111
|
+ .reschedule = 1, \
|
94
|
112
|
}
|
95
|
113
|
|
96
|
114
|
extern void * __attribute__ (( pure ))
|