iPXE
|
Processes. More...
Go to the source code of this file.
Data Structures | |
struct | process |
A process. More... | |
struct | process_descriptor |
A process descriptor. More... | |
Macros | |
#define | PROC_STEP(object_type, step) |
Define a process step() method. More... | |
#define | process_offset(object_type, name) |
Calculate offset of process within containing object. More... | |
#define | PROC_DESC(object_type, process, _step) |
Define a process descriptor. More... | |
#define | PROC_DESC_ONCE(object_type, process, _step) |
Define a process descriptor for a process that runs only once. More... | |
#define | PROC_DESC_PURE(_step) |
Define a process descriptor for a pure process. More... | |
#define | PROC_INIT(_process, _desc) |
Initialise a static process. More... | |
#define | PERMANENT_PROCESSES __table ( struct process, "processes" ) |
Permanent process table. More... | |
#define | __permanent_process __table_entry ( PERMANENT_PROCESSES, 01 ) |
Declare a permanent process. More... | |
#define | PERMANENT_PROCESS(name, step) |
Define a permanent process. More... | |
#define | PROC_COL(process) process_object ( process ) |
Find debugging colourisation for a process. More... | |
#define | PROC_FMT "%p %s()" |
printf() format string for PROC_DBG() More... | |
#define | PROC_DBG(process) process_object ( process ), (process)->desc->name |
printf() arguments for representing a process More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
void * | process_object (struct process *process) |
Get pointer to object containing process. More... | |
void | process_add (struct process *process) |
Add process to process list. More... | |
void | process_del (struct process *process) |
Remove process from process list. More... | |
void | step (void) |
Single-step a single process. More... | |
static void | process_init_stopped (struct process *process, struct process_descriptor *desc, struct refcnt *refcnt) |
Initialise process without adding to process list. More... | |
static void | process_init (struct process *process, struct process_descriptor *desc, struct refcnt *refcnt) |
Initialise process and add to process list. More... | |
static int | process_running (struct process *process) |
Check if process is running. More... | |
Processes.
Definition in file process.h.
#define PROC_STEP | ( | object_type, | |
step | |||
) |
#define process_offset | ( | object_type, | |
name | |||
) |
Calculate offset of process within containing object.
object_type | Containing object data type |
name | Process name (i.e. field within object data type) |
offset | Offset of process within containing object |
#define PROC_DESC | ( | object_type, | |
process, | |||
_step | |||
) |
Define a process descriptor.
object_type | Containing object data type |
process | Process name (i.e. field within object data type) |
step | Process' step() method |
desc | Object interface descriptor |
#define PROC_DESC_ONCE | ( | object_type, | |
process, | |||
_step | |||
) |
Define a process descriptor for a process that runs only once.
object_type | Containing object data type |
process | Process name (i.e. field within object data type) |
step | Process' step() method |
desc | Object interface descriptor |
#define PROC_DESC_PURE | ( | _step | ) |
Define a process descriptor for a pure process.
A pure process is a process that does not have a containing object.
step | Process' step() method |
desc | Object interface descriptor |
#define PROC_INIT | ( | _process, | |
_desc | |||
) |
Initialise a static process.
process | Process |
desc | Process descriptor |
#define __permanent_process __table_entry ( PERMANENT_PROCESSES, 01 ) |
Define a permanent process.
#define PROC_COL | ( | process | ) | process_object ( process ) |
#define PROC_FMT "%p %s()" |
printf() format string for PROC_DBG()
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
void* process_object | ( | struct process * | process | ) |
Get pointer to object containing process.
process | Process |
object | Containing object |
Definition at line 47 of file process.c.
References process::desc, and process_descriptor::offset.
Referenced by step().
void process_add | ( | struct process * | process | ) |
Add process to process list.
process | Process |
It is safe to call process_add() multiple times; further calls will have no effect.
Definition at line 59 of file process.c.
References DBGC, process::list, list_add_tail, PROC_COL, PROC_DBG, PROC_FMT, process_running(), ref_get, and process::refcnt.
Referenced by efi_local_open(), efi_pxe_udp_schedule_close(), fc_els_request(), fcpcmd_start_send(), gve_restart(), gve_startup(), http_reopen(), hub_complete(), hub_open(), ib_cmrc_close(), imux_probe(), init_processes(), iscsi_tx_resume(), net80211_autoassociate(), peerblk_dequeue(), peerblk_enqueue(), peerblk_retrieval_close(), peerblk_step(), peermux_block_close(), peermux_info_close(), process_init(), sanpath_open(), scsidev_ready(), tcp_close(), tcp_rx(), tls_tx_resume(), usbblk_in_complete(), usbblk_out_complete(), usbblk_start(), validator_xfer_close(), and xcm_reopen().
void process_del | ( | struct process * | process | ) |
Remove process from process list.
process | Process |
It is safe to call process_del() multiple times; further calls will have no effect.
Definition at line 79 of file process.c.
References DBGC, INIT_LIST_HEAD, process::list, list_del, PROC_COL, PROC_DBG, PROC_FMT, process_running(), ref_put, and process::refcnt.
Referenced by efi_local_close(), efi_pxe_udp_close(), efi_pxe_udp_open(), fc_els_close(), fc_ns_query_close(), fcpcmd_stop_send(), gve_close(), http_close(), hub_close(), hub_refill(), hw_finished(), ib_cmrc_shutdown(), imux_shutdown(), iscsi_close(), iscsi_tx_pause(), net80211_netdev_close(), net80211_step_associate(), peerblk_reset(), peermux_close(), peermux_step(), sanpath_close(), scsidev_close(), step(), tcp_close(), tls_close(), usbblk_stop(), validator_finished(), xcm_close(), xcm_destroy(), and xcm_reopen().
void step | ( | void | ) |
Single-step a single process.
This executes a single step of the first process in the run queue, and moves the process to the end of the run queue.
Definition at line 98 of file process.c.
References DBGC2, desc, process::desc, process::list, list_add_tail, list_del, list_first_entry, PROC_COL, PROC_DBG, PROC_FMT, process_del(), process_object(), ref_get, ref_put, and process::refcnt.
Referenced by ath5k_hw_rf_check_gainf_readback(), ath5k_hw_rf_gainf_corr(), comboot_resolv(), efi_download_poll(), efi_ifr_numeric_op(), efi_pxe_dhcp(), efi_pxe_mtftp(), efi_pxe_udp_read(), gdbmach_set_single_step(), getchar(), getchar_timeout(), int22(), iwlist(), md4_digest(), md5_digest(), monojob_wait(), open(), pxenv_tftp_get_fsize(), pxenv_tftp_open(), pxenv_tftp_read(), pxenv_tftp_read_file(), pxenv_udp_read(), read_user(), sandev_command(), sandev_describe(), sandev_reopen(), select(), sha1_digest(), sleep_interruptible(), spi_bit_transfer(), tcp_shutdown(), x25519_ladder(), and x25519_step().
|
inlinestatic |
Initialise process without adding to process list.
process | Process |
desc | Process descriptor |
refcnt | Containing object reference count, or NULL |
Definition at line 145 of file process.h.
References desc, process::desc, INIT_LIST_HEAD, process::list, process::refcnt, and refcnt.
Referenced by add_tls(), alloc_sandev(), efi_local_open(), efi_pxe_install(), fc_els_create(), fcpdev_scsi_command(), gve_probe(), hub_probe(), ib_cmrc_open(), iscsi_open(), net80211_alloc(), peerblk_open(), peermux_filter(), process_init(), tcp_open(), usbblk_probe(), and xcm_create().
|
inlinestatic |
Initialise process and add to process list.
process | Process |
desc | Process descriptor |
refcnt | Containing object reference count, or NULL |
Definition at line 161 of file process.h.
References desc, process_add(), and process_init_stopped().
Referenced by create_validator(), fc_ns_query(), http_open(), hw_open(), imux_probe(), numeric_resolv(), and scsi_open().
|
inlinestatic |
Check if process is running.
process | Process |
running | Process is running |
Definition at line 175 of file process.h.
References process::list, and list_empty.
Referenced by efi_pxe_udp_close(), efi_pxe_udp_open(), fc_els_free(), hub_remove(), imux_shutdown(), imux_step(), process_add(), process_del(), tcp_first_unfinished(), usbblk_start(), and xcm_free().