diff options
author | Randall Spangler <rspangler@chromium.org> | 2011-03-01 10:33:11 -0800 |
---|---|---|
committer | Randall Spangler <rspangler@chromium.org> | 2011-03-01 10:33:11 -0800 |
commit | 618d17d48ceb095e06f7c4395217c304567f316e (patch) | |
tree | 483094c4d3b42d29b5ce9c90a6141d4a82efb737 | |
parent | c4d21025bb57d78c512c014b694ea148cea18d7e (diff) | |
download | vboot-618d17d48ceb095e06f7c4395217c304567f316e.tar.gz |
Add kern_nv field to crossystem
Change-Id: Ifa5cc3bd8367a258fb720162572f450a1be99c03
BUG=none
TEST=manual
crossystem kern_nv=0x12345678
crossystem kern_nv
Review URL: http://codereview.chromium.org/6602040
-rw-r--r-- | host/lib/crossystem.c | 8 | ||||
-rw-r--r-- | utility/crossystem_main.c | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c index 9fe1febb..8e482d36 100644 --- a/host/lib/crossystem.c +++ b/host/lib/crossystem.c @@ -487,6 +487,8 @@ int VbGetSystemPropertyInt(const char* name) { /* NV storage values with no defaults for older BIOS. */ else if (!strcasecmp(name,"tried_fwb")) { value = VbGetNvStorage(VBNV_TRIED_FIRMWARE_B); + } else if (!strcasecmp(name,"kern_nv")) { + value = VbGetNvStorage(VBNV_KERNEL_FIELD); } /* NV storage values. If unable to get from NV storage, fall back to the * CMOS reboot field used by older BIOS. */ @@ -571,9 +573,13 @@ const char* VbGetSystemPropertyString(const char* name, char* dest, int size) { * Returns 0 if success, -1 if error. */ int VbSetSystemPropertyInt(const char* name, int value) { + /* NV storage values with no defaults for older BIOS. */ + 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 * CMOS reboot field used by older BIOS. */ - if (!strcasecmp(name,"recovery_request")) { + else if (!strcasecmp(name,"recovery_request")) { if (0 == VbSetNvStorage(VBNV_RECOVERY_REQUEST, value)) return 0; return VbSetCmosRebootField(CMOSRF_RECOVERY, value); diff --git a/utility/crossystem_main.c b/utility/crossystem_main.c index 5352b4d7..ebd6ed55 100644 --- a/utility/crossystem_main.c +++ b/utility/crossystem_main.c @@ -46,6 +46,7 @@ const Param sys_param_list[] = { {"recovery_request", 0, 1, "Recovery mode request (writable)"}, {"dbg_reset", 0, 1, "Debug reset mode request (writable)"}, {"fwb_tries", 0, 1, "Try firmware B count (writable)"}, + {"kern_nv", 0, 1, "Non-volatile field for kernel use", "0x%08x"}, /* TODO: implement the following: * nvram_cleared |