mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-09-02 06:22:23 +00:00
Update reserved function names starting with one underscore, replacing them as follows: '_k_' with 'z_' '_K_' with 'Z_' '_handler_' with 'z_handl_' '_Cstart' with 'z_cstart' '_Swap' with 'z_swap' This renaming is done on both global and those static function names in kernel/include and include/. Other static function names in kernel/ are renamed by removing the leading underscore. Other function names not starting with any prefix listed above are renamed starting with a 'z_' or 'Z_' prefix. Function names starting with two or three leading underscores are not automatcally renamed since these names will collide with the variants with two or three leading underscores. Various generator scripts have also been updated as well as perf, linker and usb files. These are drivers/serial/uart_handlers.c include/linker/kobject-text.ld kernel/include/syscall_handler.h scripts/gen_kobject_list.py scripts/gen_syscall_header.py Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
64 lines
2.2 KiB
C
64 lines
2.2 KiB
C
/*
|
|
* Copyright (c) 2018 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
#ifndef ZEPHYR_INCLUDE_SCHED_PRIQ_H_
|
|
#define ZEPHYR_INCLUDE_SCHED_PRIQ_H_
|
|
|
|
#include <misc/util.h>
|
|
#include <misc/dlist.h>
|
|
#include <misc/rb.h>
|
|
|
|
/* Two abstractions are defined here for "thread priority queues".
|
|
*
|
|
* One is a "dumb" list implementation appropriate for systems with
|
|
* small numbers of threads and sensitive to code size. It is stored
|
|
* in sorted order, taking an O(N) cost every time a thread is added
|
|
* to the list. This corresponds to the way the original _wait_q_t
|
|
* abstraction worked and is very fast as long as the number of
|
|
* threads is small.
|
|
*
|
|
* The other is a balanced tree "fast" implementation with rather
|
|
* larger code size (due to the data structure itself, the code here
|
|
* is just stubs) and higher constant-factor performance overhead, but
|
|
* much better O(logN) scaling in the presence of large number of
|
|
* threads.
|
|
*
|
|
* Each can be used for either the wait_q or system ready queue,
|
|
* configurable at build time.
|
|
*/
|
|
|
|
struct k_thread;
|
|
|
|
struct k_thread *z_priq_dumb_best(sys_dlist_t *pq);
|
|
void z_priq_dumb_remove(sys_dlist_t *pq, struct k_thread *thread);
|
|
void z_priq_dumb_add(sys_dlist_t *pq, struct k_thread *thread);
|
|
|
|
struct _priq_rb {
|
|
struct rbtree tree;
|
|
int next_order_key;
|
|
};
|
|
|
|
void z_priq_rb_add(struct _priq_rb *pq, struct k_thread *thread);
|
|
void z_priq_rb_remove(struct _priq_rb *pq, struct k_thread *thread);
|
|
struct k_thread *z_priq_rb_best(struct _priq_rb *pq);
|
|
|
|
/* Traditional/textbook "multi-queue" structure. Separate lists for a
|
|
* small number (max 32 here) of fixed priorities. This corresponds
|
|
* to the original Zephyr scheduler. RAM requirements are
|
|
* comparatively high, but performance is very fast. Won't work with
|
|
* features like deadline scheduling which need large priority spaces
|
|
* to represet their requirements.
|
|
*/
|
|
struct _priq_mq {
|
|
sys_dlist_t queues[32];
|
|
unsigned int bitmask; /* bit 1<<i set if queues[i] is non-empty */
|
|
};
|
|
|
|
void z_priq_mq_add(struct _priq_mq *pq, struct k_thread *thread);
|
|
void z_priq_mq_remove(struct _priq_mq *pq, struct k_thread *thread);
|
|
struct k_thread *z_priq_mq_best(struct _priq_mq *pq);
|
|
|
|
#endif /* ZEPHYR_INCLUDE_SCHED_PRIQ_H_ */
|