• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 TeeTrusted
18  * @{
19  *
20  * @brief TEE(Trusted Excution Environment) API.
21  * Provides security capability APIs such as trusted storage, encryption and decryption,
22  * and trusted time for trusted application development.
23  *
24  * @since 20
25  */
26 
27 /**
28  * @file tee_get_recoverymode.h
29  *
30  * @brief Provides APIs for getting boot mode.
31  *
32  * @library NA
33  * @kit TEEKit
34  * @syscap SystemCapability.Tee.TeeClient
35  * @since 20
36  */
37 
38 #ifndef TEE_GET_RECOVERYMODE_H
39 #define TEE_GET_RECOVERYMODE_H
40 
41 #include <stdint.h>
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 /**
48  * @brief  Enumerates the supported boot modes of the system.
49  *
50  * @since 20
51  */
52 typedef enum {
53     /** System is powered off or shutting down. */
54     BOOT_MODE_SHUTDOWN = 0,
55     /** Normal boot mode */
56     BOOT_MODE_NORMAL,
57     /** Fastboot boot mode. */
58     BOOT_MODE_FASTBOOT,
59     /** Recovery boot mode. */
60     BOOT_MODE_RECOVERY,
61     /** eRecovery mode. */
62     BOOT_MODE_RECOVERY2,
63     /** Maximum number of supported boot modes. */
64     BOOT_MODE_CNT_MAX
65 } boot_modes;
66 
67 /**
68  * @brief Get current boot mode.
69  *
70  * @param recoverymode [OUT] Indicates current boot mode.
71  *
72  * @return Returns {@code TEE_SUCCESS} if the operation is successful.
73  *         Returns {@code TEE_ERROR_BAD_PARAMETERS} if input parameter is incorrect.
74  *
75  * @since 20
76  */
77 int32_t tee_ext_get_recoverymode(enum boot_modes *recoverymode);
78 
79 #ifdef __cplusplus
80 }
81 #endif
82 
83 #endif
84 /** @} */