44 void ( *
step ) (
void *object );
56#define PROC_STEP( object_type, step ) \
57 ( ( ( ( typeof ( step ) * ) NULL ) == \
58 ( ( void ( * ) ( object_type *object ) ) NULL ) ) ? \
59 ( void ( * ) ( void *object ) ) step : \
60 ( void ( * ) ( void *object ) ) step )
69#define process_offset( object_type, name ) \
70 ( ( ( ( typeof ( ( ( object_type * ) NULL )->name ) * ) NULL ) \
71 == ( ( struct process * ) NULL ) ) \
72 ? offsetof ( object_type, name ) \
73 : offsetof ( object_type, name ) )
83#define PROC_DESC( object_type, process, _step ) { \
85 .offset = process_offset ( object_type, process ), \
86 .step = PROC_STEP ( object_type, _step ), \
98#define PROC_DESC_ONCE( object_type, process, _step ) { \
100 .offset = process_offset ( object_type, process ), \
101 .step = PROC_STEP ( object_type, _step ), \
113#define PROC_DESC_PURE( _step ) { \
116 .step = PROC_STEP ( struct process, _step ), \
124extern void step (
void );
132#define PROC_INIT( _process, _desc ) { \
133 .list = LIST_HEAD_INIT ( (_process).list ), \
181#define PERMANENT_PROCESSES __table ( struct process, "processes" )
189#define __permanent_process __table_entry ( PERMANENT_PROCESSES, 01 )
194#define PERMANENT_PROCESS( name, step ) \
195static struct process_descriptor name ## _desc = PROC_DESC_PURE ( step ); \
196struct process name __permanent_process = PROC_INIT ( name, & name ## _desc );
206#define PROC_COL( process ) process_object ( process )
209#define PROC_FMT "%p %s()"
217#define PROC_DBG( process ) process_object ( process ), (process)->desc->name
struct ena_llq_option desc
Descriptor counts.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
#define INIT_LIST_HEAD(list)
Initialise a list head.
#define list_empty(list)
Test whether a list is empty.
void * process_object(struct process *process)
Get pointer to object containing process.
static void process_init(struct process *process, struct process_descriptor *desc, struct refcnt *refcnt)
Initialise process and add to process list.
void process_del(struct process *process)
Remove process from process list.
static int process_running(struct process *process)
Check if process is running.
static void process_init_stopped(struct process *process, struct process_descriptor *desc, struct refcnt *refcnt)
Initialise process without adding to process list.
void step(void)
Single-step a single process.
void process_add(struct process *process)
Add process to process list.
A doubly-linked list entry (or list head)
const char * name
Process name.
int reschedule
Automatically reschedule the process.
size_t offset
Offset of process within containing object.
void(* step)(void *object)
Single-step the process.
struct list_head list
List of processes.
struct refcnt * refcnt
Reference counter.
struct process_descriptor * desc
Process descriptor.