• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
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 
16 /**
17  * @addtogroup InitSync
18  * @{
19  *
20  * @brief Provides APIs for notifying the Init process of events.
21  *
22  * @since 10
23  */
24 
25 /**
26  * @file init_sync.h
27  * @brief Declares APIs for notifying events to the Init process.
28  * @kit BasicServicesKit
29  * @library NA
30  * @syscap SystemCapability.Startup.SystemInfo
31  * @since 10
32  */
33 
34 #ifndef BASE_STARTUP_INITLITE_NOTIFY_H
35 #define BASE_STARTUP_INITLITE_NOTIFY_H
36 
37 #ifdef __cplusplus
38 #if __cplusplus
39 extern "C" {
40 #endif
41 #endif
42 
43 #define EVENT1             0xf
44 #define EVENT1_WAITTIME    10000 // 10s = 10*1000 * 1 tick(1ms)
45 
46 #define EVENT2             0xf0
47 /* Define EVENT2_WAITTIME 0 means QS_STAGE2 is no used */
48 #define EVENT2_WAITTIME    0
49 
50 #define EVENT3             0xf00
51 /* Define EVENT3_WAITTIME 0 means QS_STAGE3 is no used */
52 #define EVENT3_WAITTIME    0
53 
54 /*
55  * Notify the event to Init process.
56  * All processes can call. Usually called by the listened process.
57  * event: There needs to be a consensus between the listener(init process) and the notifier.
58  */
59 extern int NotifyInit(unsigned long event);
60 
61 #ifdef __cplusplus
62 #if __cplusplus
63 }
64 #endif // #if __cplusplus
65 #endif // #ifdef __cplusplus
66 
67 #endif // BASE_STARTUP_INITLITE_NOTIFY_H
68 /** @} */
69