Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Unified Diff: host/lib/crossystem.c

Issue 6596081: Add crossystem support for nvram_cleared and kern_nv (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: Fix try B count mask Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « firmware/lib/vboot_nvstorage.c ('k') | utility/crossystem_main.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: host/lib/crossystem.c
diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c
index 8e482d360d8bcadfd64c314bb4c1b0b7469d76c2..5951e10b7bd839c24e6e8f3b65a8d54dd6b672bb 100644
--- a/host/lib/crossystem.c
+++ b/host/lib/crossystem.c
@@ -489,6 +489,8 @@ int VbGetSystemPropertyInt(const char* name) {
value = VbGetNvStorage(VBNV_TRIED_FIRMWARE_B);
} else if (!strcasecmp(name,"kern_nv")) {
value = VbGetNvStorage(VBNV_KERNEL_FIELD);
+ } else if (!strcasecmp(name,"nvram_cleared")) {
+ value = VbGetNvStorage(VBNV_KERNEL_SETTINGS_RESET);
}
/* NV storage values. If unable to get from NV storage, fall back to the
* CMOS reboot field used by older BIOS. */
@@ -512,10 +514,6 @@ int VbGetSystemPropertyInt(const char* name) {
value = ReadFileInt(ACPI_FMAP_PATH);
}
- /* TODO: implement the following properties:
- * nvram_cleared
- */
-
return value;
}
@@ -574,7 +572,10 @@ const char* VbGetSystemPropertyString(const char* name, char* dest, int size) {
int VbSetSystemPropertyInt(const char* name, int value) {
/* NV storage values with no defaults for older BIOS. */
- if (!strcasecmp(name,"kern_nv")) {
+ if (!strcasecmp(name,"nvram_cleared")) {
+ /* Can only clear this flag; it's set inside the NV storage library. */
+ return VbSetNvStorage(VBNV_KERNEL_SETTINGS_RESET, 0);
+ } else if (!strcasecmp(name,"kern_nv")) {
return VbSetNvStorage(VBNV_KERNEL_FIELD, value);
}
/* NV storage values. If unable to get from NV storage, fall back to the
@@ -593,10 +594,6 @@ int VbSetSystemPropertyInt(const char* name, int value) {
return VbSetCmosRebootField(CMOSRF_TRY_B, value);
}
- /* TODO: implement the following:
- * nvram_cleared
- */
-
return -1;
}
« no previous file with comments | « firmware/lib/vboot_nvstorage.c ('k') | utility/crossystem_main.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698