• 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 interrupt implementation
14  */
15 #include "prt_tick_internal.h"
16 
17 /* 任务检测Tick中断调用钩子 */
18 OS_SEC_BSS TskmonTickHook g_tskMonHook;
19 /* 软件定时器扫描钩子 */
20 OS_SEC_BSS SwitchScanFunc g_swtmrScanHook;
21 OS_SEC_BSS TickHandleFunc g_tickUsrHook;
22 
23 /*
24  * 描述:Tick中断的处理函数。扫描任务超时链表、扫描超时软件定时器、扫描TSKMON等。
25  */
OsTickDispatcher(void)26 OS_SEC_TEXT void OsTickDispatcher(void)
27 {
28     uintptr_t intSave;
29 
30     intSave = OsIntLock();
31 
32     g_uniTicks++;
33 
34     OS_TICK_COUNT_UPDATE();
35 
36     // 任务超时扫描
37     OS_TASK_SCAN();
38 
39     // tick模式下的cpu占用率采样
40     OS_TICK_TASK_ENTRY();
41 
42     OsIntRestore(intSave);
43 
44     TICK_USER_HOOK_RUN();
45 
46     OS_SWTMR_SCAN();
47     TSKMON_TICK_RUN();
48 }
49 
50