• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef _LINUX_SCHED_H
16 #define _LINUX_SCHED_H
17 
18 #include "linux/kernel.h"
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif /* __cplusplus */
23 
24 #define cond_resched() do {} while (0)
25 #define signal_pending(x) (0)
26 
27 /**
28  * @ingroup sched
29  * @brief Delay a task.
30  *
31  * @par Description:
32  * This API is used to delay the execution of the current task. The task is able to be scheduled
33  * after that it is delayed for a specified number of Ticks.
34  *
35  * @attention
36  * <ul>
37  * <li>The task fails to be delayed if it is being delayed during interrupt processing or it is locked.</li>
38  * </ul>
39  *
40  * @param  timeout [IN] Type #signed long, Number of Ticks for which the task is delayed(unit: Tick).
41  *
42  * @retval #0   The task is successfully delayed.
43  * @retval #>0  The remaining ticks, it means that the task is unsuccessfully delayed.
44  *
45  * @par Dependency:
46  * <ul><li>sched.h: the header file that contains the API declaration.</li></ul>
47  * @see None.
48  */
49 signed long schedule_timeout(signed long timeout);
50 
51 #define schedule_timeout_uninterruptible(t) schedule_timeout(t)
52 
53 #define schedule_timeout_interruptible(t) schedule_timeout(t)
54 
55 #ifdef __cplusplus
56 }
57 #endif /* __cplusplus */
58 
59 #endif /* _LINUX_SCHED_H */
60