• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2009-2022 Huawei Technologies Co., Ltd. All rights reserved.
3  *
4  * UniProton is licensed under Mulan PSL v2.
5  * You can use this software according to the terms and conditions of the Mulan PSL v2.
6  * You may obtain a copy of Mulan PSL v2 at:
7  *          http://license.coscl.org.cn/MulanPSL2
8  * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
9  * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
10  * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
11  * See the Mulan PSL v2 for more details.
12  * Create: 2009-12-22
13  * Description: tick后处理调度文件。
14  */
15 #include "prt_sys_external.h"
16 
OsTickBh(void)17 OS_SEC_ALW_INLINE INLINE void OsTickBh(void)
18 {
19     uintptr_t intSave;
20 
21     while (TICK_NO_RESPOND_CNT > 0) {
22         TICK_NO_RESPOND_CNT--;
23         UNI_FLAG |= OS_FLG_TICK_ACTIVE;
24 
25         /* 整个调度过程中就是关中断的 */
26         intSave = PRT_HwiUnLock();
27 
28         /* 如果tick未初始化,TICK_NO_RESPOND_CNT=0,故不会进入此处,调用tick后处理 */
29         g_tickDispatcher();
30 
31         PRT_HwiRestore(intSave);
32         UNI_FLAG &= ~OS_FLG_TICK_ACTIVE;
33     }
34 }
35 
OsViDispatch(void)36 OS_SEC_TEXT void OsViDispatch(void)
37 {
38     /* tick 后处理的调度 */
39     if ((UNI_FLAG & OS_FLG_TICK_ACTIVE) != 0) {
40         return;
41     }
42 
43     OsTickBh();
44 }
45