Add boot flags to LoadFirmware(), for TPM init

Review URL: http://codereview.chromium.org/2865015
This commit is contained in:
Randall Spangler
2010-06-23 21:51:13 -07:00
parent e2ec98412e
commit d0d48b58a1
2 changed files with 7 additions and 2 deletions

View File

@@ -20,6 +20,9 @@
#define LOAD_FIRMWARE_SUCCESS 0 /* Success */ #define LOAD_FIRMWARE_SUCCESS 0 /* Success */
#define LOAD_FIRMWARE_RECOVERY 1 /* Reboot to recovery mode */ #define LOAD_FIRMWARE_RECOVERY 1 /* Reboot to recovery mode */
/* Boot flags for LoadFirmware().boot_flags */
#define BOOT_FLAG_DEVELOPER UINT64_C(0x01) /* Developer switch is on */
typedef struct LoadFirmwareParams { typedef struct LoadFirmwareParams {
/* Inputs to LoadFirmware() */ /* Inputs to LoadFirmware() */
void *firmware_root_key_blob; /* Key used to sign firmware header */ void *firmware_root_key_blob; /* Key used to sign firmware header */
@@ -35,6 +38,7 @@ typedef struct LoadFirmwareParams {
* buffer, in bytes. On output, this * buffer, in bytes. On output, this
* will contain the actual key blob * will contain the actual key blob
* size placed into the buffer. */ * size placed into the buffer. */
uint64_t boot_flags; /* Boot flags */
/* Outputs from LoadFirmware(); valid only if LoadFirmware() returns /* Outputs from LoadFirmware(); valid only if LoadFirmware() returns
* LOAD_FIRMWARE_SUCCESS. */ * LOAD_FIRMWARE_SUCCESS. */

View File

@@ -60,8 +60,9 @@ int LoadFirmware(LoadFirmwareParams* params) {
} }
/* Initialize the TPM and read rollback indices. */ /* Initialize the TPM and read rollback indices. */
/* TODO: fix SetupTPM parameter for developer mode */ if (0 != RollbackFirmwareSetup(
if (0 != RollbackFirmwareSetup(0, &tpm_key_version, &tpm_fw_version)) { (params->boot_flags & BOOT_FLAG_DEVELOPER ? 1 : 0),
&tpm_key_version, &tpm_fw_version)) {
VBDEBUG(("Unable to get stored versions.\n")); VBDEBUG(("Unable to get stored versions.\n"));
return LOAD_FIRMWARE_RECOVERY; return LOAD_FIRMWARE_RECOVERY;
} }