1 /*----------------------------------------------------------------------------
2  *      CMSIS-RTOS  -  RTX
3  *----------------------------------------------------------------------------
4  *      Name:    RT_LIST.H
5  *      Purpose: Functions for the management of different lists
6  *      Rev.:    V4.79
7  *----------------------------------------------------------------------------
8  *
9  * Copyright (c) 1999-2009 KEIL, 2009-2015 ARM Germany GmbH
10  * All rights reserved.
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions are met:
13  *  - Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  *  - Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  *  - Neither the name of ARM  nor the names of its contributors may be used
19  *    to endorse or promote products derived from this software without
20  *    specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25  * ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
26  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *---------------------------------------------------------------------------*/
34 
35 /* Definitions */
36 
37 /* Values for 'cb_type' */
38 #define TCB             0U
39 #define MCB             1U
40 #define SCB             2U
41 #define MUCB            3U
42 #define HCB             4U
43 
44 /* Variables */
45 extern struct OS_XCB os_rdy;
46 extern struct OS_XCB os_dly;
47 
48 /* Functions */
49 extern void  rt_put_prio      (P_XCB p_CB, P_TCB p_task);
50 extern P_TCB rt_get_first     (P_XCB p_CB);
51 extern void  rt_put_rdy_first (P_TCB p_task);
52 extern P_TCB rt_get_same_rdy_prio (void);
53 extern void  rt_resort_prio   (P_TCB p_task);
54 extern void  rt_put_dly       (P_TCB p_task, U16 delay);
55 extern void  rt_dec_dly       (void);
56 extern void  rt_rmv_list      (P_TCB p_task);
57 extern void  rt_rmv_dly       (P_TCB p_task);
58 extern void  rt_psq_enq       (OS_ID entry, U32 arg);
59 
60 /* This is a fast macro generating in-line code */
61 #define rt_rdy_prio(void) (os_rdy.p_lnk->prio)
62 
63 /*----------------------------------------------------------------------------
64  * end of file
65  *---------------------------------------------------------------------------*/
66