1 /*
2  * This file is only used for doxygen document generation.
3  */
4 
5 /**
6  * @addtogroup group_thread_management
7  * @{
8  */
9 
10 /**
11  * @brief This function will handle IPI interrupt and do a scheduling in system.
12  *
13  * @param vector is the number of IPI interrupt for system scheduling.
14  *
15  * @param param is not used, and can be set to RT_NULL.
16  *
17  * @note this function should be invoke or register as ISR in BSP.
18  *
19  * @note this function is only implemented in scheduler_mp.c.
20  */
21 void rt_scheduler_ipi_handler(int vector, void *param);
22 
23 /**
24  * @brief This function will perform one scheduling. It will select one thread
25  *        with the highest priority level in global ready queue or local ready queue,
26  *        then switch to it.
27  *
28  * @note this function is implemented in both scheduler_up.c and scheduler_mp.c.
29  */
30 void rt_schedule(void);
31 
32 /**
33  * @brief This function checks whether a scheduling is needed after an IRQ context switching. If yes,
34  *        it will select one thread with the highest priority level, and then switch
35  *        to it.
36  *
37  * @param context is the context to be switched to.
38  *
39  * @note this function is only implemented in scheduler_mp.c.
40  */
41 void rt_scheduler_do_irq_switch(void *context);
42 
43 /**
44  * @brief This function will insert a thread to the system ready queue. The state of
45  *        thread will be set as READY and the thread will be removed from suspend queue.
46  *
47  * @param thread is the thread to be inserted.
48  *
49  * @note  Please do not invoke this function in user application.
50  *
51  * @note this function is implemented in both scheduler_up.c and scheduler_mp.c.
52  */
53 void rt_schedule_insert_thread(struct rt_thread *thread);
54 
55 /**
56  * @brief This function will remove a thread from system ready queue.
57  *
58  * @param thread is the thread to be removed.
59  *
60  * @note  Please do not invoke this function in user application.
61  *
62  * @note this function is implemented in both scheduler_up.c and scheduler_mp.c.
63  */
64 void rt_schedule_remove_thread(struct rt_thread *thread);
65 
66 /**
67  * @brief This function will lock the thread scheduler.
68  *
69  * @note this function is implemented in both scheduler_up.c and scheduler_mp.c.
70  */
71 void rt_enter_critical(void);
72 
73 /**
74  * @brief This function will unlock the thread scheduler.
75  *
76  * @note this function is implemented in both scheduler_up.c and scheduler_mp.c.
77  */
78 void rt_exit_critical(void);
79 
80 /**
81  * @brief Get the scheduler lock level.
82  *
83  * @return the level of the scheduler lock. 0 means unlocked.
84  *
85  * @note this function is implemented in both scheduler_up.c and scheduler_mp.c.
86  */
87 rt_uint16_t rt_critical_level(void);
88 
89 /**@}*/
90