39#if (CH_CFG_USE_JOBS == TRUE) || defined(__DOXYGEN__)
48#define MSG_JOB_NULL ((msg_t)-2)
58#if CH_CFG_USE_MEMPOOLS == FALSE
59#error "CH_CFG_USE_JOBS requires CH_CFG_USE_MEMPOOLS"
62#if CH_CFG_USE_SEMAPHORES == FALSE
63#error "CH_CFG_USE_JOBS requires CH_CFG_USE_SEMAPHORES"
66#if CH_CFG_USE_MAILBOXES == FALSE
67#error "CH_CFG_USE_JOBS requires CH_CFG_USE_MAILBOXES"
144 chDbgCheck((jobsn > 0U) && (jobsbuf != NULL) && (msgbuf != NULL));
#define chDbgAssert(c, r)
Condition assertion.
#define chDbgCheck(c)
Function parameters check.
static void chJobPostS(jobs_queue_t *jqp, job_descriptor_t *jp)
Posts a job object.
static void chJobPost(jobs_queue_t *jqp, job_descriptor_t *jp)
Posts a job object.
static msg_t chJobDispatchTimeout(jobs_queue_t *jqp, sysinterval_t timeout)
Waits for a job then executes it.
static job_descriptor_t * chJobGet(jobs_queue_t *jqp)
Allocates a free job object.
static void chJobPostAheadS(jobs_queue_t *jqp, job_descriptor_t *jp)
Posts an high priority job object.
static void chJobPostI(jobs_queue_t *jqp, job_descriptor_t *jp)
Posts a job object.
static void chJobObjectInit(jobs_queue_t *jqp, size_t jobsn, job_descriptor_t *jobsbuf, msg_t *msgbuf)
Initializes a jobs queue object.
void(* job_function_t)(void *arg)
Type of a job function.
static job_descriptor_t * chJobGetI(jobs_queue_t *jqp)
Allocates a free job object.
static void chJobPostAheadI(jobs_queue_t *jqp, job_descriptor_t *jp)
Posts an high priority job object.
static job_descriptor_t * chJobGetTimeout(jobs_queue_t *jqp, sysinterval_t timeout)
Allocates a free job object.
#define MSG_JOB_NULL
Dispatcher return code in case of a JOB_NUL has been received.
static job_descriptor_t * chJobGetTimeoutS(jobs_queue_t *jqp, sysinterval_t timeout)
Allocates a free job object.
static void chJobPostAhead(jobs_queue_t *jqp, job_descriptor_t *jp)
Posts an high priority job object.
struct ch_jobs_queue jobs_queue_t
Type of a jobs queue.
static msg_t chJobDispatch(jobs_queue_t *jqp)
Waits for a job then executes it.
struct ch_job_descriptor job_descriptor_t
Type of a job descriptor.
void chMBObjectInit(mailbox_t *mbp, msg_t *buf, size_t n)
Initializes a mailbox_t object.
msg_t chMBFetchTimeout(mailbox_t *mbp, msg_t *msgp, sysinterval_t timeout)
Retrieves a message from a mailbox.
msg_t chMBPostTimeout(mailbox_t *mbp, msg_t msg, sysinterval_t timeout)
Posts a message into a mailbox.
msg_t chMBPostI(mailbox_t *mbp, msg_t msg)
Posts a message into a mailbox.
msg_t chMBPostAheadTimeout(mailbox_t *mbp, msg_t msg, sysinterval_t timeout)
Posts an high priority message into a mailbox.
msg_t chMBPostTimeoutS(mailbox_t *mbp, msg_t msg, sysinterval_t timeout)
Posts a message into a mailbox.
msg_t chMBPostAheadTimeoutS(mailbox_t *mbp, msg_t msg, sysinterval_t timeout)
Posts an high priority message into a mailbox.
msg_t chMBPostAheadI(mailbox_t *mbp, msg_t msg)
Posts an high priority message into a mailbox.
void * chGuardedPoolAllocTimeout(guarded_memory_pool_t *gmp, sysinterval_t timeout)
Allocates an object from a guarded memory pool.
void * chGuardedPoolAllocTimeoutS(guarded_memory_pool_t *gmp, sysinterval_t timeout)
Allocates an object from a guarded memory pool.
void chGuardedPoolLoadArray(guarded_memory_pool_t *gmp, void *p, size_t n)
Loads a guarded memory pool with an array of static objects.
static void chGuardedPoolObjectInit(guarded_memory_pool_t *gmp, size_t size)
Initializes an empty guarded memory pool.
void chGuardedPoolFree(guarded_memory_pool_t *gmp, void *objp)
Releases an object into a guarded memory pool.
static void * chGuardedPoolAllocI(guarded_memory_pool_t *gmp)
Allocates an object from a guarded memory pool.
#define MSG_OK
Normal wakeup message.
#define TIME_IMMEDIATE
Zero interval specification for some functions with a timeout specification.
uint64_t sysinterval_t
Type of time interval.
#define TIME_INFINITE
Infinite interval specification for all functions with a timeout specification.
Type of a job descriptor.
void * jobarg
Argument to be passed to the job function.
job_function_t jobfunc
Job function.
guarded_memory_pool_t free
Pool of the free jobs.
mailbox_t mbx
Mailbox of the sent jobs.
Guarded memory pool descriptor.
Structure representing a mailbox object.