notify.h

Defines

EMB_NOTIFY_BITS
EMB_NOTIFY_KERNEL_BITS
EMB_NOTIFY_BIT(n)
EMB_NOTIFY_APP_BITS
EMB_NOTIFY_APP_MASK
EMB_NOTIFY_K_WORK
EMB_NOTIFY_K_FAULT
EMB_NOTIFY_K_BUDGET
EMB_NOTIFY_ANY
EMB_NOTIFY_ALL
EMB_NOTIFY_CLEAR

Typedefs

typedef uint32_t emb_notify_bits_t

Functions

emb_status_t emb_notify_set(emb_thread_t thread, emb_notify_bits_t bits)

emb_notify_set() - OR bits into thread's

notification word; wake it if satisfied.

Context: thread isr Blocking: no Timing: O(1) bit update, plus profile-specific timeout removal and scheduling Ownership: none Configuration: CONFIG_EMB_NOTIFY Requirements: KRN-NOTIF-001 KRN-NOTIF-007 KRN-NOTIF-008 Since: 0.2 Stability: yes

Return: EMB_OK; EMB_EINVAL for a bad handle, zero bits, or a kernel bit; EMB_ESTATE for a TERMINATED thread (the bits are discarded).

Parameters:
  • thread – Target thread.

  • bits – Application bits only; a kernel bit is EMB_EINVAL.

emb_status_t emb_notify_wait(emb_notify_bits_t mask, uint8_t mode, emb_timeout_t timeout, emb_notify_bits_t *out_bits)

emb_notify_wait() - Wait until the caller’s word satisfies mask in mode

.

Context: thread Blocking: timeout Timing: O(1) bit test; O(timeouts) finite timeout arm Ownership: none Configuration: CONFIG_EMB_NOTIFY Requirements: KRN-NOTIF-002 KRN-NOTIF-008 Since: 0.2 Stability: yes

Return: EMB_OK; EMB_ETIMEDOUT; EMB_ECANCELED; EMB_EINVAL.

Parameters:
  • mask – Bits of interest; zero is EMB_EINVAL.

  • mode – EMB_NOTIFY_ANY or EMB_NOTIFY_ALL, optionally | EMB_NOTIFY_CLEAR.

  • timeout – How long to wait.

  • out_bits – Receives word & mask on EMB_OK; may be NULL.

emb_status_t emb_notify_wait_until(emb_notify_bits_t mask, uint8_t mode, emb_instant_t deadline, emb_notify_bits_t *out_bits)

emb_notify_wait_until() - Absolute-deadline form of emb_notify_wait()

.

Context: thread Blocking: timeout Timing: O(1) bit test; O(timeouts) finite timeout arm Ownership: none Configuration: CONFIG_EMB_NOTIFY Requirements: KRN-NOTIF-002 KRN-NOTIF-008 KRN-TIM-011 API-024 Since: 0.2 Stability: yes

Parameters:
  • mask – Nonzero bits of interest; application code uses EMB_NOTIFY_APP_MASK bits.

  • mode – EMB_NOTIFY_ANY or EMB_NOTIFY_ALL, optionally ORed with EMB_NOTIFY_CLEAR.

  • deadline – Kernel-clock deadline; past means no wait, subject to 32-bit half-range limits.

  • out_bits – Receives the satisfied masked bits only on EMB_OK; may be NULL.

emb_notify_bits_t emb_notify_get(void)

emb_notify_get() - Snapshot of the caller’s notification word.

Context: thread Blocking: no Timing: O(1) Ownership: none Configuration: CONFIG_EMB_NOTIFY Requirements: KRN-NOTIF-001 Since: 0.2 Stability: yes

emb_status_t emb_notify_clear(emb_notify_bits_t bits)

emb_notify_clear() - Clear bits

in the caller’s word.

Context: thread Blocking: no Timing: O(1) Ownership: none Configuration: CONFIG_EMB_NOTIFY Requirements: KRN-NOTIF-001 Since: 0.2 Stability: yes

Return: EMB_OK.

Parameters:
  • bits – Bits to clear from the caller word; zero is a no-op. Applications use application bits only.