summaryrefslogtreecommitdiffstats
path: root/src/include/gpxe/process.h
blob: 83ff8393455a2a77e9302e605fd1da7f2de3b131 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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 */