diff options
-rw-r--r-- | host/lib/crossystem.c | 10 | ||||
-rw-r--r-- | utility/crossystem_main.c | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c index 34c1de17..ef3c6d1c 100644 --- a/host/lib/crossystem.c +++ b/host/lib/crossystem.c @@ -43,9 +43,13 @@ typedef enum VdatIntField { } VdatIntField; -/* Masks for kern_nv usage by kernel */ +/* Masks for kern_nv usage by kernel. */ #define KERN_NV_FWUPDATE_TRIES_MASK 0x0000000F - +/* If you want to use the remaining currently-unused bits in kern_nv + * for something kernel-y, define a new field (the way we did for + * fwupdate_tries). Don't just modify kern_nv directly, because that + * makes it too easy to accidentally corrupt other sub-fields. */ +#define KERN_NV_CURRENTLY_UNUSED 0xFFFFFFF0 /* Return true if the FWID starts with the specified string. */ int FwidStartsWith(const char *start) { @@ -444,8 +448,6 @@ int VbSetSystemPropertyInt(const char* name, int value) { 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); } else if (!strcasecmp(name,"vbtest_errfunc")) { return VbSetNvStorage(VBNV_TEST_ERROR_FUNC, value); } else if (!strcasecmp(name,"vbtest_errno")) { diff --git a/utility/crossystem_main.c b/utility/crossystem_main.c index 0c1d2fd8..b914d62d 100644 --- a/utility/crossystem_main.c +++ b/utility/crossystem_main.c @@ -48,7 +48,7 @@ const Param sys_param_list[] = { {"fwupdate_tries", CAN_WRITE, "Times to try OS firmware update (writable, inside kern_nv)"}, {"hwid", IS_STRING, "Hardware ID"}, - {"kern_nv", CAN_WRITE, "Non-volatile field for kernel use", "0x%08x"}, + {"kern_nv", 0, "Non-volatile field for kernel use", "0x%08x"}, {"kernkey_vfy", IS_STRING, "Type of verification done on kernel key block"}, {"loc_idx", CAN_WRITE, "Localization index for firmware screens (writable)"}, {"mainfw_act", IS_STRING, "Active main firmware"}, |