Lines Matching +full:poll +full:- +full:timeout +full:- +full:ms

4  * SPDX-License-Identifier: Apache-2.0
53 #define K_PRIO_COOP(x) (-(CONFIG_NUM_COOP_PRIORITIES - (x)))
56 #define K_HIGHEST_THREAD_PRIO (-CONFIG_NUM_COOP_PRIORITIES)
60 #define K_LOWEST_APPLICATION_THREAD_PRIO (K_LOWEST_THREAD_PRIO - 1)
245 * bits, arch-specific use high bits.
289 * from within a user-provided callback they have been invoked.
290 * Effectively it serves as a tiny bit of zero-overhead TLS data.
328 /* end - thread options */
335 * - @ref K_USER allocate a userspace thread (requires `CONFIG_USERSPACE=y`)
353 * @retval -EBUSY if the thread stack is in use.
354 * @retval -EINVAL if @p stack is invalid.
355 * @retval -ENOSYS if dynamic thread stack allocation is disabled
371 * Thread options are architecture-specific, and can include K_ESSENTIAL,
378 * - K_THREAD_STACK_DEFINE() - For stacks that may support either user or
380 * - K_KERNEL_STACK_DEFINE() - For stacks that may support supervisor
386 * - The original size value passed to K_THREAD_STACK_DEFINE() or
388 * - The return value of K_THREAD_STACK_SIZEOF(stack) if the stack was
390 * - The return value of K_KERNEL_STACK_SIZEOF(stack) if the stack was
419 * This allows a supervisor thread to be re-used as a user thread.
424 * Any thread-local storage will be reverted to a pristine state.
429 * A common use of this function is to re-use the main thread as a user thread
430 * once all supervisor mode-only tasks have been completed.
474 thread->resource_pool = heap; in k_thread_heap_assign()
492 * @return -EBADF Bad thread object (user mode only)
493 * @return -EPERM No permissions on thread object (user mode only)
494 * #return -ENOTSUP Forbidden by hardware policy
495 * @return -EINVAL Thread is uninitialized or exited (user mode only)
496 * @return -EFAULT Bad memory address for unused_ptr (user mode only)
522 * to being aborted, self-exiting, or taking a fatal error. This API returns
525 * This API may only be called from ISRs with a K_NO_WAIT timeout,
530 * @param timeout upper bound time to wait for the thread to exit.
532 * @retval -EBUSY returned without waiting
533 * @retval -EAGAIN waiting period timed out
534 * @retval -EDEADLK target thread is joining on the caller, or target thread
537 __syscall int k_thread_join(struct k_thread *thread, k_timeout_t timeout);
545 * @param timeout Desired duration of sleep.
551 __syscall int32_t k_sleep(k_timeout_t timeout);
558 * @param ms Number of milliseconds to sleep.
564 static inline int32_t k_msleep(int32_t ms) in k_msleep() argument
566 return k_sleep(Z_TIMEOUT_MS(ms)); in k_msleep()
593 * @note The clock used for the microsecond-resolution delay here may
665 /* Thread-local cache of current thread ID, set in z_thread_entry() */ in k_current_get()
678 * off all kernel queues it is part of (i.e. the ready queue, the timeout
695 k_ticks_t z_timeout_expires(const struct _timeout *timeout);
696 k_ticks_t z_timeout_remaining(const struct _timeout *timeout);
712 return z_timeout_expires(&thread->base.timeout); in z_impl_k_thread_timeout_expires_ticks()
727 return z_timeout_remaining(&thread->base.timeout); in z_impl_k_thread_timeout_remaining_ticks()
755 #define Z_THREAD_INIT_DELAY_INITIALIZER(ms) .init_delay_ms = (ms) argument
756 #define Z_THREAD_INIT_DELAY(thread) SYS_TIMEOUT_MS((thread)->init_delay_ms)
758 #define Z_THREAD_INIT_DELAY_INITIALIZER(ms) .init_delay = SYS_TIMEOUT_MS(ms) argument
759 #define Z_THREAD_INIT_DELAY(thread) (thread)->init_delay
804 * Thread options are architecture-specific, and can include K_ESSENTIAL,
842 * Thread options are architecture-specific, and can include K_ESSENTIAL,
855 * or in power-of-two size (if MPU).
893 * - If its priority is raised above the priority of a currently scheduled
896 * - If the caller lowers the priority of a currently scheduled preemptible
900 * Priority can be assigned in the range of -CONFIG_NUM_COOP_PRIORITIES to
901 * CONFIG_NUM_PREEMPT_PRIORITIES-1, where -CONFIG_NUM_COOP_PRIORITIES is the
927 * a signed non-negative quantity). Failure to adhere to this rule
1045 * still handed to it. Thread suspension does not impact any timeout
1046 * upon which the thread may be waiting (such as a timeout from a call
1047 * to k_sem_take() or k_sleep()). Thus if the timeout expires while the
1094 * @brief Set time-slicing period and scope.
1099 * To enable time slicing, @a slice must be non-zero. The scheduler
1126 * thread. When non-zero, this timeslice will take precedence over
1130 * will be called before the thread is removed/re-added to the run
1133 * currently-executing ISR. Such a callback is free to, for example,
1142 * @note Threads with a non-zero slice time set will be timesliced
1151 * fine-grained timing decisions within this callback should use the
1189 * - The code is running in a thread, not at ISR.
1190 * - The thread's priority is in the preemptible range.
1191 * - The thread has not locked the scheduler.
1196 * @return Non-zero if invoked by a preemptible thread.
1201 * @brief Test whether startup is in the before-main-task phase.
1208 * @return true if invoked before post-kernel initialization
1209 * @return false if invoked during/after post-kernel initialization
1234 * again becomes the current thread, its non-preemptible status is maintained.
1239 * extremely fast for non-userspace threads (just one byte
1249 * In general this is a historical API not well-suited to modern
1270 * upon which to build thread-local storage.
1295 * @retval -EFAULT Memory access error with supplied string
1296 * @retval -ENOSYS Thread name configuration option not enabled
1297 * @retval -EINVAL Thread name too long
1317 * @retval -ENOSPC Destination buffer too small
1318 * @retval -EFAULT Memory access error
1319 * @retval -ENOSYS Thread name feature not enabled
1349 * @brief Generate null timeout delay.
1351 * This macro generates a timeout delay that instructs a kernel API
1354 * @return Timeout delay value.
1359 * @brief Generate timeout delay from nanoseconds.
1361 * This macro generates a timeout delay that instructs a kernel API to
1368 * @return Timeout delay value.
1373 * @brief Generate timeout delay from microseconds.
1375 * This macro generates a timeout delay that instructs a kernel API
1382 * @return Timeout delay value.
1387 * @brief Generate timeout delay from cycles.
1389 * This macro generates a timeout delay that instructs a kernel API
1394 * @return Timeout delay value.
1399 * @brief Generate timeout delay from system ticks.
1401 * This macro generates a timeout delay that instructs a kernel API
1406 * @return Timeout delay value.
1411 * @brief Generate timeout delay from milliseconds.
1413 * This macro generates a timeout delay that instructs a kernel API
1414 * to wait up to @a ms milliseconds to perform the requested operation.
1416 * @param ms Duration in milliseconds.
1418 * @return Timeout delay value.
1420 #define K_MSEC(ms) Z_TIMEOUT_MS(ms) argument
1423 * @brief Generate timeout delay from seconds.
1425 * This macro generates a timeout delay that instructs a kernel API
1430 * @return Timeout delay value.
1435 * @brief Generate timeout delay from minutes.
1437 * This macro generates a timeout delay that instructs a kernel API
1442 * @return Timeout delay value.
1447 * @brief Generate timeout delay from hours.
1449 * This macro generates a timeout delay that instructs a kernel API
1454 * @return Timeout delay value.
1459 * @brief Generate infinite timeout delay.
1461 * This macro generates a timeout delay that instructs a kernel API
1464 * @return Timeout delay value.
1471 * @brief Generates an absolute/uptime timeout value from system ticks
1473 * This macro generates a timeout delay that represents an expiration
1475 * timeout will expire immediately after the system uptime reaches the
1479 * @return Timeout delay value
1485 * @brief Generates an absolute/uptime timeout value from milliseconds
1487 * This macro generates a timeout delay that represents an expiration
1489 * the timeout will expire immediately after the system uptime reaches
1493 * @return Timeout delay value
1498 * @brief Generates an absolute/uptime timeout value from microseconds
1500 * This macro generates a timeout delay that represents an expiration
1502 * the timeout will expire immediately after the system uptime reaches
1504 * system tick rate and not the requested timeout value.
1507 * @return Timeout delay value
1512 * @brief Generates an absolute/uptime timeout value from nanoseconds
1514 * This macro generates a timeout delay that represents an expiration
1516 * the timeout will expire immediately after the system uptime reaches
1518 * system tick rate and not the requested timeout value.
1521 * @return Timeout delay value
1526 * @brief Generates an absolute/uptime timeout value from system cycles
1528 * This macro generates a timeout delay that represents an expiration
1530 * timeout will expire immediately after the system uptime reaches the
1532 * tick rate and not the requested timeout value.
1535 * @return Timeout delay value
1552 * dynamic timer allocation. timeout.node is used in the double-linked
1555 struct _timeout timeout; member
1572 /* user-specific data, also used to support legacy features */
1584 .timeout = { \
1625 * callable from interrupt context (isr-ok).
1714 * This routine blocks the calling thread until the timer's status is non-zero
1716 * or the timer is stopped. If the timer status is already non-zero,
1747 return z_timeout_expires(&timer->timeout); in z_impl_k_timer_expires_ticks()
1765 return z_timeout_remaining(&timer->timeout); in z_impl_k_timer_remaining_ticks()
1786 * @brief Associate user-specific data with a timer.
1805 timer->user_data = user_data; in z_impl_k_timer_user_data_set()
1809 * @brief Retrieve the user-specific data from a timer.
1819 return timer->user_data; in z_impl_k_timer_user_data_get()
1860 * @brief Get system uptime (32-bit version).
1869 * interrupt blocking and 64-bit math.
1912 delta = uptime - *reftime; in k_uptime_delta()
1924 * @return Current hardware clock up-counter (in cycles).
1932 * @brief Read the 64-bit hardware clock.
1934 * This routine returns the current time in 64-bits, as measured by the
1939 * @return Current hardware clock up-counter (in cycles).
1944 __ASSERT(0, "64-bit cycle counter not enabled on this platform. " in k_cycle_get_64()
2001 * return from k_queue_get() call with NULL value (as if timeout expired).
2003 * -EINTR and K_POLL_STATE_CANCELLED state (and per above, subsequent
2040 * @retval -ENOMEM if there isn't sufficient RAM in the caller's resource pool
2072 * @retval -ENOMEM if there isn't sufficient RAM in the caller's resource pool
2095 * The data items must be in a singly-linked list, with the first word
2097 * NULL-terminated.
2102 * @param head Pointer to first node in singly-linked list.
2103 * @param tail Pointer to last node in singly-linked list.
2106 * @retval -EINVAL on invalid supplied data
2115 * The data items must be in a singly-linked list implemented using a
2124 * @retval -EINVAL on invalid data
2134 * @note @a timeout must be set to K_NO_WAIT if called from ISR.
2139 * @param timeout Waiting period to obtain a data item, or one of the special
2145 __syscall void *k_queue_get(struct k_queue *queue, k_timeout_t timeout);
2154 * @note @a timeout must be set to K_NO_WAIT if called from ISR.
2191 * @return Non-zero if the queue is empty.
2198 return sys_sflist_is_empty(&queue->data_q) ? 1 : 0; in z_impl_k_queue_is_empty()
2284 * @param timeout Waiting period on the futex, or one of the special values
2286 * @retval -EACCES Caller does not have read access to futex address.
2287 * @retval -EAGAIN If the futex value did not match the expected parameter.
2288 * @retval -EINVAL Futex parameter address not recognized by the kernel.
2289 * @retval -ETIMEDOUT Thread woke up due to timeout and not a futex wakeup.
2295 k_timeout_t timeout);
2307 * @retval -EACCES Caller does not have access to the futex address.
2308 * @retval -EINVAL Futex parameter address not recognized by the kernel.
2423 * @a timeout has expired. A thread may wait on up to 32 distinctly numbered
2424 * events that are expressed as bits in a single 32-bit word.
2433 * @param timeout Waiting period for the desired set of events or one of the
2440 bool reset, k_timeout_t timeout);
2447 * @a timeout has expired. A thread may wait on up to 32 distinctly numbered
2448 * events that are expressed as bits in a single 32-bit word.
2457 * @param timeout Waiting period for the desired set of events or one of the
2464 bool reset, k_timeout_t timeout);
2529 k_queue_init(&(fifo)->_queue); \
2539 * return from k_fifo_get() call with NULL value (as if timeout
2549 k_queue_cancel_wait(&(fifo)->_queue); \
2569 k_queue_append(&(fifo)->_queue, _data); \
2587 * @retval -ENOMEM if there isn't sufficient RAM in the caller's resource pool
2593 int fap_ret = k_queue_alloc_append(&(fifo)->_queue, _data); \
2602 * The data items must be in a singly-linked list, with the first word of
2604 * NULL-terminated.
2609 * @param head Pointer to first node in singly-linked list.
2610 * @param tail Pointer to last node in singly-linked list.
2615 k_queue_append_list(&(fifo)->_queue, head, tail); \
2623 * The data items must be in a singly-linked list implemented using a
2625 * and must be re-initialized via sys_slist_init().
2635 k_queue_merge_slist(&(fifo)->_queue, list); \
2645 * @note @a timeout must be set to K_NO_WAIT if called from ISR.
2650 * @param timeout Waiting period to obtain a data item,
2656 #define k_fifo_get(fifo, timeout) \ argument
2658 SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_fifo, get, fifo, timeout); \
2659 void *fg_ret = k_queue_get(&(fifo)->_queue, timeout); \
2660 SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_fifo, get, fifo, timeout, fg_ret); \
2674 * @return Non-zero if the FIFO queue is empty.
2678 k_queue_is_empty(&(fifo)->_queue)
2696 void *fph_ret = k_queue_peek_head(&(fifo)->_queue); \
2715 void *fpt_ret = k_queue_peek_tail(&(fifo)->_queue); \
2771 k_queue_init(&(lifo)->_queue); \
2793 k_queue_prepend(&(lifo)->_queue, _data); \
2811 * @retval -ENOMEM if there isn't sufficient RAM in the caller's resource pool
2817 int lap_ret = k_queue_alloc_prepend(&(lifo)->_queue, _data); \
2828 * @note @a timeout must be set to K_NO_WAIT if called from ISR.
2833 * @param timeout Waiting period to obtain a data item,
2839 #define k_lifo_get(lifo, timeout) \ argument
2841 SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_lifo, get, lifo, timeout); \
2842 void *lg_ret = k_queue_get(&(lifo)->_queue, timeout); \
2843 SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_lifo, get, lifo, timeout, lg_ret); \
2925 * @return -ENOMEM if memory couldn't be allocated
2940 * @retval -EAGAIN when object is still in use
2955 * @retval -ENOMEM if stack is full
2965 * @note @a timeout must be set to K_NO_WAIT if called from ISR.
2971 * @param timeout Waiting period to obtain a value,
2976 * @retval -EBUSY Returned without waiting.
2977 * @retval -EAGAIN Waiting period timed out.
2980 k_timeout_t timeout);
3091 * a timeout occurs.
3099 * @param timeout Waiting period to lock the mutex,
3104 * @retval -EBUSY Returned without waiting.
3105 * @retval -EAGAIN Waiting period timed out.
3107 __syscall int k_mutex_lock(struct k_mutex *mutex, k_timeout_t timeout);
3125 * @retval -EPERM The current thread does not own the mutex
3126 * @retval -EINVAL The mutex is not locked
3192 * @param timeout Waiting period for the condition variable
3195 * @retval -EAGAIN Waiting period timed out.
3198 k_timeout_t timeout);
3275 * @retval -EINVAL Invalid values
3286 * @note @a timeout must be set to K_NO_WAIT if called from ISR.
3291 * @param timeout Waiting period to take the semaphore,
3295 * @retval -EBUSY Returned without waiting.
3296 * @retval -EAGAIN Waiting period timed out,
3299 __syscall int k_sem_take(struct k_sem *sem, k_timeout_t timeout);
3318 * with -EAGAIN.
3340 return sem->count; in z_impl_k_sem_count_get()
3388 /** @brief Initialize a (non-delayable) work structure.
3392 * re-invoked to change the associated handler, but this must be done when the
3422 * Wrapper to determine whether a work item is in a non-idle dstate.
3431 * @return true if and only if k_work_busy_get() returns a non-zero value.
3448 * @retval -EBUSY
3452 * @retval -EINVAL if @p queue is null and the work item has never been run.
3453 * @retval -ENODEV if @p queue has not been started.
3468 /** @brief Wait for last-submitted instance to complete.
3497 * This attempts to prevent a pending (non-delayable) work item from being
3562 * should not be re-invoked on a queue.
3629 * @retval -EALREADY if the work queue was not plugged.
3640 * @param timeout Maximum time to wait for the work queue to stop.
3643 * @retval -EALREADY if the work queue was not started (or already stopped)
3644 * @retval -EBUSY if the work queue is actively processing work items
3645 * @retval -ETIMEDOUT if the work queue did not stop within the stipulated timeout
3647 int k_work_queue_stop(struct k_work_q *queue, k_timeout_t timeout);
3653 * can be re-invoked to change the associated handler, but this must be done
3696 * Wrapper to determine whether a delayed work item is in a non-idle state.
3705 * @return true if and only if k_work_delayable_busy_get() returns a non-zero
3745 * Unlike k_work_reschedule_for_queue() this is a no-op if the work item is
3763 * @retval -EBUSY if @p delay is @c K_NO_WAIT and
3765 * @retval -EINVAL if @p delay is @c K_NO_WAIT and
3767 * @retval -ENODEV if @p delay is @c K_NO_WAIT and
3818 * @retval -EBUSY if @p delay is @c K_NO_WAIT and
3820 * @retval -EINVAL if @p delay is @c K_NO_WAIT and
3822 * @retval -ENODEV if @p delay is @c K_NO_WAIT and
3973 * Accessed via k_work_busy_get(). May co-occur with other flags.
3979 * Accessed via k_work_busy_get(). May co-occur with other flags.
3986 * Accessed via k_work_busy_get(). May co-occur with other flags.
3993 * Accessed via k_work_busy_get(). May co-occur with other flags.
3999 * Accessed via k_work_busy_get(). May co-occur with other flags.
4037 /* Timeout used to submit work after a delay. */
4038 struct _timeout timeout; member
4052 * @brief Initialize a statically-defined delayable work item.
4054 * This macro can be used to initialize a statically-defined delayable
4113 * is generally not coherent. be stack-allocated. Violations are detected by
4200 return z_timeout_expires(&dwork->timeout); in k_work_delayable_expires_get()
4206 return z_timeout_remaining(&dwork->timeout); in k_work_delayable_remaining_get()
4211 return &queue->thread; in k_work_queue_thread_get()
4257 #if defined(__cplusplus) && ((__cplusplus - 0) < 202002L)
4269 * @brief Initialize a statically-defined user work item.
4271 * This macro can be used to initialize a statically-defined user work
4315 return atomic_test_bit(&work->flags, K_WORK_USER_STATE_PENDING); in k_work_user_is_pending()
4332 * @retval -EBUSY if the work item was already in some workqueue
4333 * @retval -ENOMEM if no memory for thread resource pool allocation
4339 int ret = -EBUSY; in k_work_user_submit_to_queue()
4341 if (!atomic_test_and_set_bit(&work->flags, in k_work_user_submit_to_queue()
4343 ret = k_queue_alloc_append(&work_q->queue, work); in k_work_user_submit_to_queue()
4349 atomic_clear_bit(&work->flags, in k_work_user_submit_to_queue()
4393 return &work_q->thread; in k_work_user_queue_thread_get()
4409 struct _timeout timeout; member
4423 * @brief Initialize a statically-defined work item.
4425 * This macro can be used to initialize a statically-defined workqueue work
4460 * to race conditions with the pre-existing triggered work item and work queue,
4474 * @param timeout Timeout after which the work will be scheduled
4479 * @retval -EINVAL Work item is being processed or has completed its work.
4480 * @retval -EADDRINUSE Work item is pending on a different workqueue.
4486 k_timeout_t timeout);
4500 * to race conditions with the pre-existing triggered work item and work queue,
4512 * @param timeout Timeout after which the work will be scheduled
4516 * @retval -EINVAL Work item is being processed or has completed its work.
4517 * @retval -EADDRINUSE Work item is pending on a different workqueue.
4522 k_timeout_t timeout);
4536 * @retval -EINVAL Work item is being processed or has completed its work.
4677 * @return 0 on success, -ENOMEM if there was insufficient memory in the
4678 * thread's resource pool, or -EINVAL if the size parameters cause
4692 * @retval -EBUSY Queue not empty
4709 * @param timeout Waiting period to add the message, or one of the special
4713 * @retval -ENOMSG Returned without waiting or queue purged.
4714 * @retval -EAGAIN Waiting period timed out.
4716 __syscall int k_msgq_put(struct k_msgq *msgq, const void *data, k_timeout_t timeout);
4724 * @note @a timeout must be set to K_NO_WAIT if called from ISR.
4730 * @param timeout Waiting period to receive the message,
4735 * @retval -ENOMSG Returned without waiting or queue purged.
4736 * @retval -EAGAIN Waiting period timed out.
4738 __syscall int k_msgq_get(struct k_msgq *msgq, void *data, k_timeout_t timeout);
4752 * @retval -ENOMSG Returned when the queue has no message.
4770 * @retval -ENOMSG Returned when the queue has no message at index.
4779 * message queue are unblocked and see an -ENOMSG error code.
4811 return msgq->max_msgs - msgq->used_msgs; in z_impl_k_msgq_num_free_get()
4827 return msgq->used_msgs; in z_impl_k_msgq_num_used_get()
4845 /** application-defined information value */
4853 /** internal use only - thread waiting on send (may be a dummy) */
4856 /** internal use only - semaphore used during asynchronous send */
4917 * receive and process it. The message data may be in a buffer or non-existent
4922 * @param timeout Waiting period for the message to be received,
4929 * @retval -ENOMSG Returned without waiting.
4930 * @retval -EAGAIN Waiting period timed out.
4933 k_timeout_t timeout);
4939 * to process it. The message data may be in a buffer or non-existent
4961 * @param timeout Waiting period for a message to be received,
4965 * @retval -ENOMSG Returned without waiting.
4966 * @retval -EAGAIN Waiting period timed out.
4969 void *buffer, k_timeout_t timeout);
5085 * @retval -EAGAIN nothing to cleanup
5102 * @retval -ENOMEM if memory couldn't be allocated
5116 * @param timeout Waiting period to wait for the data to be written,
5120 * @retval -EIO Returned without waiting; zero data bytes were written.
5121 * @retval -EAGAIN Waiting period timed out; between zero and @a min_xfer
5126 size_t min_xfer, k_timeout_t timeout);
5138 * @param timeout Waiting period to wait for the data to be read,
5142 * @retval -EINVAL invalid parameters supplied
5143 * @retval -EIO Returned without waiting; zero data bytes were read.
5144 * @retval -EAGAIN Waiting period timed out; between zero and @a min_xfer
5149 size_t min_xfer, k_timeout_t timeout);
5247 * @brief Statically define and initialize a memory slab in a public (non-static) scope.
5251 * @a slab_align -byte boundary. To ensure that each memory block is similarly
5261 * If such a use-case is desired, use @ref K_MEM_SLAB_DEFINE_STATIC
5282 * @a slab_align -byte boundary. To ensure that each memory block is similarly
5306 * N-byte boundary matching a word boundary, where N is a power of 2
5307 * (i.e. 4 on 32-bit systems, 8, 16, ...).
5317 * @retval -EINVAL invalid data supplied
5328 * @note @a timeout must be set to K_NO_WAIT if called from ISR.
5329 * @note When CONFIG_MULTITHREADING=n any @a timeout is treated as K_NO_WAIT.
5335 * @param timeout Waiting period to wait for operation to complete.
5341 * @retval -ENOMEM Returned without waiting.
5342 * @retval -EAGAIN Waiting period timed out.
5343 * @retval -EINVAL Invalid data supplied
5346 k_timeout_t timeout);
5371 return slab->info.num_used; in k_mem_slab_num_used_get()
5387 return slab->info.max_used; in k_mem_slab_max_used_get()
5406 return slab->info.num_blocks - slab->info.num_used; in k_mem_slab_num_free_get()
5418 * @retval -EINVAL Any parameter points to NULL
5432 * @retval -EINVAL Memory slab is NULL
5472 * is a multiple of the specified power-of-two alignment value in
5476 * @note @a timeout must be set to K_NO_WAIT if called from ISR.
5477 * @note When CONFIG_MULTITHREADING=n any @a timeout is treated as K_NO_WAIT.
5484 * @param timeout How long to wait, or K_NO_WAIT
5488 k_timeout_t timeout) __attribute_nonnull(1);
5495 * block for the specified timeout (constructed via the standard
5496 * timeout API, or K_NO_WAIT or K_FOREVER) waiting for memory to be
5498 * the timeout, NULL will be returned.
5501 * @note @a timeout must be set to K_NO_WAIT if called from ISR.
5502 * @note When CONFIG_MULTITHREADING=n any @a timeout is treated as K_NO_WAIT.
5508 * @param timeout How long to wait, or K_NO_WAIT
5512 k_timeout_t timeout) __attribute_nonnull(1);
5519 * immediately, the call will block for the specified timeout (constructed
5520 * via the standard timeout API, or K_NO_WAIT or K_FOREVER) waiting for memory
5522 * the timeout, NULL will be returned.
5525 * @note @a timeout must be set to K_NO_WAIT if called from ISR.
5526 * @note When CONFIG_MULTITHREADING=n any @a timeout is treated as K_NO_WAIT.
5533 * @param timeout How long to wait, or K_NO_WAIT
5536 void *k_heap_calloc(struct k_heap *h, size_t num, size_t size, k_timeout_t timeout)
5544 * block for the specified timeout (constructed via the standard
5545 * timeout API, or K_NO_WAIT or K_FOREVER) waiting for memory to be
5547 * the timeout, NULL will be returned.
5550 * @note @a timeout must be set to K_NO_WAIT if called from ISR.
5551 * @note When CONFIG_MULTITHREADING=n any @a timeout is treated as K_NO_WAIT.
5558 * @param timeout How long to wait, or K_NO_WAIT
5562 void *k_heap_realloc(struct k_heap *h, void *ptr, size_t bytes, k_timeout_t timeout)
5577 /* Hand-calculated minimum heap sizes needed to return a successful
5578 * 1-byte allocation. See details in lib/os/heap.[ch]
5659 * difference is that k_aligned_alloc() accepts any non-zero @p size,
5665 * The aligned_alloc function (p: 347-348)
5733 /* polling API - PRIVATE */
5736 #define _INIT_OBJ_POLL_EVENT(obj) do { (obj)->poll_event = NULL; } while (false)
5741 /* private - types bit positions */
5764 #define Z_POLL_TYPE_BIT(type) (1U << ((type) - 1U))
5766 /* private - states bit positions */
5792 #define Z_POLL_STATE_BIT(state) (1U << ((state) - 1U))
5795 (32 - (0 \
5802 /* end of polling API - PRIVATE */
5813 /* public - values for k_poll_event.type bitfield */
5822 /* public - polling modes */
5830 /* public - values for k_poll_event.state bitfield */
5840 /* public - poll signal object */
5842 /** PRIVATE - DO NOT TOUCH */
5862 * @brief Poll Event
5866 /** PRIVATE - DO NOT TOUCH */
5869 /** PRIVATE - DO NOT TOUCH */
5872 /** optional user-specified tag, opaque, untouched by the API */
5875 /** bitfield of event types (bitwise-ORed K_POLL_TYPE_xxx values) */
5878 /** bitfield of event states (bitwise-ORed K_POLL_STATE_xxx values) */
5884 /** unused bits in 32-bit word */
5887 /** per-type data */
5932 * After this routine is called on a poll event, the event it ready to be
5941 * @param obj Kernel object or poll signal.
5948 * @brief Wait for one or many of multiple poll events to occur
5951 * multiple poll events to have occurred. Such events can be a kernel object
5952 * being available, like a semaphore, or a poll signal event.
5959 * means that the polling thread will never get the poll event on an object
5976 * @param timeout Waiting period for an event to be ready,
5980 * @retval -EAGAIN Waiting period timed out.
5981 * @retval -EINTR Polling has been interrupted, e.g. with
5984 * words, -EINTR status means that at least one of output events is
5986 * @retval -ENOMEM Thread resource pool insufficient memory (user mode only)
5987 * @retval -EINVAL Bad parameters (user mode only)
5991 k_timeout_t timeout);
5994 * @brief Initialize a poll signal object.
5996 * Ready a poll signal object to be signaled via k_poll_signal_raise().
5998 * @param sig A poll signal.
6004 * @brief Reset a poll signal object's state to unsignaled.
6006 * @param sig A poll signal object
6011 * @brief Fetch the signaled state and result value of a poll signal
6013 * @param sig A poll signal object
6024 * @brief Signal a poll signal object.
6026 * This routine makes ready a poll signal, which is basically a poll event of
6030 * The poll signal contains a 'signaled' field that, when set by
6037 * this function returns an error indicating that an expiring poll was
6040 * @param sig A poll signal.
6044 * @retval -EAGAIN The polling thread's timeout is in the process of expiring.
6063 * However, in some more constrained systems, such as a single-threaded system,
6079 * Enabling interrupts and entering a low-power mode will be atomic,
6081 * the processor enters a low-power mode.
6083 * After waking up from the low-power mode, the interrupt lockout state will
6163 void z_timer_expiration_handler(struct _timeout *timeout);
6202 * @retval -ENOTSUP If the floating point disabling is not implemented.
6203 * -EINVAL If the floating point disabling could not be performed.
6227 * - K_FP_REGS indicates x87 FPU and MMX registers only
6228 * - K_SSE_REGS indicates SSE registers (and also x87 FPU and MMX registers)
6242 * @retval -ENOTSUP If the floating point enabling is not implemented.
6243 * -EINVAL If the floating point enabling could not be performed.
6256 * @return -EINVAL if null pointers, otherwise 0
6265 * @return -EINVAL if null pointers, otherwise 0
6274 * @return -EINVAL if null pointers, otherwise 0
6285 * @return -EINVAL if invalid thread ID, otherwise 0
6296 * @return -EINVAL if invalid thread ID, otherwise 0