ChibiOS
21.6.0
|
Macros | |
#define | MSG_JOB_NULL ((msg_t)-2) |
Dispatcher return code in case of a JOB_NUL has been received. More... | |
Typedefs | |
typedef struct ch_jobs_queue | jobs_queue_t |
Type of a jobs queue. More... | |
typedef void(* | job_function_t) (void *arg) |
Type of a job function. More... | |
typedef struct ch_job_descriptor | job_descriptor_t |
Type of a job descriptor. More... | |
Data Structures | |
struct | ch_jobs_queue |
Type of a jobs queue. More... | |
struct | ch_job_descriptor |
Type of a job descriptor. More... | |
Functions | |
static void | chJobObjectInit (jobs_queue_t *jqp, size_t jobsn, job_descriptor_t *jobsbuf, msg_t *msgbuf) |
Initializes a jobs queue object. More... | |
static job_descriptor_t * | chJobGet (jobs_queue_t *jqp) |
Allocates a free job object. More... | |
static job_descriptor_t * | chJobGetI (jobs_queue_t *jqp) |
Allocates a free job object. More... | |
static job_descriptor_t * | chJobGetTimeoutS (jobs_queue_t *jqp, sysinterval_t timeout) |
Allocates a free job object. More... | |
static job_descriptor_t * | chJobGetTimeout (jobs_queue_t *jqp, sysinterval_t timeout) |
Allocates a free job object. More... | |
static void | chJobPostI (jobs_queue_t *jqp, job_descriptor_t *jp) |
Posts a job object. More... | |
static void | chJobPostS (jobs_queue_t *jqp, job_descriptor_t *jp) |
Posts a job object. More... | |
static void | chJobPost (jobs_queue_t *jqp, job_descriptor_t *jp) |
Posts a job object. More... | |
static void | chJobPostAheadI (jobs_queue_t *jqp, job_descriptor_t *jp) |
Posts an high priority job object. More... | |
static void | chJobPostAheadS (jobs_queue_t *jqp, job_descriptor_t *jp) |
Posts an high priority job object. More... | |
static void | chJobPostAhead (jobs_queue_t *jqp, job_descriptor_t *jp) |
Posts an high priority job object. More... | |
static msg_t | chJobDispatch (jobs_queue_t *jqp) |
Waits for a job then executes it. More... | |
static msg_t | chJobDispatchTimeout (jobs_queue_t *jqp, sysinterval_t timeout) |
Waits for a job then executes it. More... | |
#define MSG_JOB_NULL ((msg_t)-2) |
typedef struct ch_jobs_queue jobs_queue_t |
Type of a jobs queue.
typedef void(* job_function_t) (void *arg) |
typedef struct ch_job_descriptor job_descriptor_t |
Type of a job descriptor.
|
inlinestatic |
Initializes a jobs queue object.
[out] | jqp | pointer to a jobs_queue_t structure |
[in] | jobsn | number of jobs available |
[in] | jobsbuf | pointer to the buffer of jobs, it must be able to hold jobsn job_descriptor_t structures |
[in] | msgbuf | pointer to the buffer of messages, it must be able to hold jobsn msg_t messages |
Definition at line 139 of file chjobs.h.
References chDbgCheck, chGuardedPoolLoadArray(), chGuardedPoolObjectInit(), chMBObjectInit(), ch_jobs_queue::free, and ch_jobs_queue::mbx.
|
inlinestatic |
Allocates a free job object.
[in] | jqp | pointer to a jobs_queue_t structure |
Definition at line 159 of file chjobs.h.
References chGuardedPoolAllocTimeout(), ch_jobs_queue::free, and TIME_INFINITE.
|
inlinestatic |
Allocates a free job object.
[in] | jqp | pointer to a jobs_queue_t structure |
NULL | if a job object is not immediately available. |
Definition at line 173 of file chjobs.h.
References chGuardedPoolAllocI(), and ch_jobs_queue::free.
|
inlinestatic |
Allocates a free job object.
[in] | jqp | pointer to a jobs_queue_t structure |
[in] | timeout | the number of ticks before the operation timeouts, the following special values are allowed:
|
NULL | if a job object is not available within the specified timeout. |
Definition at line 193 of file chjobs.h.
References chGuardedPoolAllocTimeoutS(), and ch_jobs_queue::free.
|
inlinestatic |
Allocates a free job object.
[in] | jqp | pointer to a jobs_queue_t structure |
[in] | timeout | the number of ticks before the operation timeouts, the following special values are allowed:
|
NULL | if a job object is not available within the specified timeout. |
Definition at line 214 of file chjobs.h.
References chGuardedPoolAllocTimeout(), and ch_jobs_queue::free.
|
inlinestatic |
Posts a job object.
[in] | jqp | pointer to a jobs_queue_t structure |
[in] | jp | pointer to the job object to be posted |
Definition at line 229 of file chjobs.h.
References chDbgAssert, chMBPostI(), ch_jobs_queue::mbx, and MSG_OK.
|
inlinestatic |
Posts a job object.
[in] | jqp | pointer to a jobs_queue_t structure |
[in] | jp | pointer to the job object to be posted |
Definition at line 245 of file chjobs.h.
References chDbgAssert, chMBPostTimeoutS(), ch_jobs_queue::mbx, MSG_OK, and TIME_IMMEDIATE.
|
inlinestatic |
Posts a job object.
[in] | jqp | pointer to a jobs_queue_t structure |
[in] | jp | pointer to the job object to be posted |
Definition at line 261 of file chjobs.h.
References chDbgAssert, chMBPostTimeout(), ch_jobs_queue::mbx, MSG_OK, and TIME_IMMEDIATE.
|
inlinestatic |
Posts an high priority job object.
[in] | jqp | pointer to a jobs_queue_t structure |
[in] | jp | pointer to the job object to be posted |
Definition at line 277 of file chjobs.h.
References chDbgAssert, chMBPostAheadI(), ch_jobs_queue::mbx, and MSG_OK.
|
inlinestatic |
Posts an high priority job object.
[in] | jqp | pointer to a jobs_queue_t structure |
[in] | jp | pointer to the job object to be posted |
Definition at line 293 of file chjobs.h.
References chDbgAssert, chMBPostAheadTimeoutS(), ch_jobs_queue::mbx, MSG_OK, and TIME_IMMEDIATE.
|
inlinestatic |
Posts an high priority job object.
[in] | jqp | pointer to a jobs_queue_t structure |
[in] | jp | pointer to the job object to be posted |
Definition at line 309 of file chjobs.h.
References chDbgAssert, chMBPostAheadTimeout(), ch_jobs_queue::mbx, MSG_OK, and TIME_IMMEDIATE.
|
inlinestatic |
Waits for a job then executes it.
[in] | jqp | pointer to a jobs_queue_t structure |
MSG_OK | if a job has been executed. |
MSG_RESET | if the internal mailbox has been reset. |
MSG_JOB_NULL | if a JOB_NULL has been received. |
Definition at line 325 of file chjobs.h.
References chDbgAssert, chGuardedPoolFree(), chMBFetchTimeout(), ch_jobs_queue::free, ch_job_descriptor::jobarg, ch_job_descriptor::jobfunc, ch_jobs_queue::mbx, MSG_JOB_NULL, MSG_OK, and TIME_INFINITE.
|
inlinestatic |
Waits for a job then executes it.
[in] | jqp | pointer to a jobs_queue_t structure |
[in] | timeout | the number of ticks before the operation timeouts, the following special values are allowed:
|
MSG_OK | if a job has been executed. |
MSG_TIMEOUT | if a timeout occurred. |
MSG_RESET | if the internal mailbox has been reset. |
MSG_JOB_NULL | if a JOB_NULL has been received. |
Definition at line 366 of file chjobs.h.
References chDbgAssert, chGuardedPoolFree(), chMBFetchTimeout(), ch_jobs_queue::free, ch_job_descriptor::jobarg, ch_job_descriptor::jobfunc, ch_jobs_queue::mbx, MSG_JOB_NULL, and MSG_OK.