| OLD | NEW | 
|---|
| 1 /* Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 1 /* Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 
| 2  * Use of this source code is governed by a BSD-style license that can be | 2  * Use of this source code is governed by a BSD-style license that can be | 
| 3  * found in the LICENSE file. | 3  * found in the LICENSE file. | 
| 4  */ | 4  */ | 
| 5 | 5 | 
| 6 /* Non-volatile storage routines for verified boot. | 6 /* Non-volatile storage routines for verified boot. | 
| 7  */ | 7  */ | 
| 8 | 8 | 
| 9 #ifndef VBOOT_REFERENCE_NVSTORAGE_H_ | 9 #ifndef VBOOT_REFERENCE_NVSTORAGE_H_ | 
| 10 #define VBOOT_REFERENCE_NVSTORAGE_H_ | 10 #define VBOOT_REFERENCE_NVSTORAGE_H_ | 
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 109 /* DM-verity error */ | 109 /* DM-verity error */ | 
| 110 #define VBNV_RECOVERY_KE_DM_VERITY    0x81 | 110 #define VBNV_RECOVERY_KE_DM_VERITY    0x81 | 
| 111 /* Unspecified/unknown error in kernel */ | 111 /* Unspecified/unknown error in kernel */ | 
| 112 #define VBNV_RECOVERY_KE_UNSPECIFIED  0xBF | 112 #define VBNV_RECOVERY_KE_UNSPECIFIED  0xBF | 
| 113 /* Recovery mode test from user-mode */ | 113 /* Recovery mode test from user-mode */ | 
| 114 #define VBNV_RECOVERY_US_TEST         0xC1 | 114 #define VBNV_RECOVERY_US_TEST         0xC1 | 
| 115 /* Unspecified/unknown error in user-mode */ | 115 /* Unspecified/unknown error in user-mode */ | 
| 116 #define VBNV_RECOVERY_US_UNSPECIFIED  0xFF | 116 #define VBNV_RECOVERY_US_UNSPECIFIED  0xFF | 
| 117 | 117 | 
| 118 | 118 | 
|  | 119 /* Function codes for VBNV_TEST_ERROR_FUNC */ | 
|  | 120 #define VBNV_TEST_ERROR_LOAD_FIRMWARE_SETUP  1 | 
|  | 121 #define VBNV_TEST_ERROR_LOAD_FIRMWARE        2 | 
|  | 122 #define VBNV_TEST_ERROR_LOAD_KERNEL          3 | 
|  | 123 #define VBNV_TEST_ERROR_S3_RESUME            4 | 
|  | 124 | 
|  | 125 | 
| 119 /* Initialize the NV storage library.  This must be called before any | 126 /* Initialize the NV storage library.  This must be called before any | 
| 120  * other functions in this library.  Returns 0 if success, non-zero if | 127  * other functions in this library.  Returns 0 if success, non-zero if | 
| 121  * error. | 128  * error. | 
| 122  * | 129  * | 
| 123  * Proper calling procedure: | 130  * Proper calling procedure: | 
| 124  *    1) Allocate a context struct. | 131  *    1) Allocate a context struct. | 
| 125  *    2) If multi-threaded/multi-process, acquire a lock to prevent | 132  *    2) If multi-threaded/multi-process, acquire a lock to prevent | 
| 126  *       other processes from modifying the underlying storage. | 133  *       other processes from modifying the underlying storage. | 
| 127  *    3) Read underlying storage and fill in context->raw. | 134  *    3) Read underlying storage and fill in context->raw. | 
| 128  *    4) Call VbNvSetup(). | 135  *    4) Call VbNvSetup(). | 
| (...skipping 25 matching lines...) Expand all  Loading... | 
| 154 int VbNvGet(VbNvContext* context, VbNvParam param, uint32_t* dest); | 161 int VbNvGet(VbNvContext* context, VbNvParam param, uint32_t* dest); | 
| 155 | 162 | 
| 156 /* Set a NV storage param to a new value.  Returns 0 if success, | 163 /* Set a NV storage param to a new value.  Returns 0 if success, | 
| 157  * non-zero if error. | 164  * non-zero if error. | 
| 158  * | 165  * | 
| 159  * This may only be called between VbNvSetup() and VbNvTeardown(). */ | 166  * This may only be called between VbNvSetup() and VbNvTeardown(). */ | 
| 160 int VbNvSet(VbNvContext* context, VbNvParam param, uint32_t value); | 167 int VbNvSet(VbNvContext* context, VbNvParam param, uint32_t value); | 
| 161 | 168 | 
| 162 | 169 | 
| 163 #endif  /* VBOOT_REFERENCE_NVSTORAGE_H_ */ | 170 #endif  /* VBOOT_REFERENCE_NVSTORAGE_H_ */ | 
| OLD | NEW | 
|---|