]> xenbits.xensource.com Git - seabios.git/commitdiff
tcg: Use seabios setup()/prepboot() calling convention for tcg
authorKevin O'Connor <kevin@koconnor.net>
Wed, 10 Jun 2015 15:00:17 +0000 (11:00 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Thu, 11 Jun 2015 22:36:45 +0000 (18:36 -0400)
Rename tcg externally called functions to more closely match other
subsystems.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Tested-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
src/post.c
src/tcgbios.c
src/tcgbios.h

index ff2cb6ce185b1e7e698984febb594aa3fcb520f9..6157b5070528adf80b3a0021b372dae06c0089f1 100644 (file)
@@ -174,11 +174,17 @@ platform_hardware_setup(void)
     // Platform specific setup
     qemu_platform_setup();
     coreboot_platform_setup();
+
+    // Initialize TPM
+    tpm_setup();
 }
 
 void
 prepareboot(void)
 {
+    // Change TPM phys. presence state befor leaving BIOS
+    tpm_prepboot();
+
     // Run BCVs
     bcv_prepboot();
 
@@ -222,9 +228,6 @@ maininit(void)
     if (threads_during_optionroms())
         device_hardware_setup();
 
-    // Initialize TPM
-    tpm_start();
-
     // Run vga option rom
     vgarom_setup();
 
@@ -241,9 +244,6 @@ maininit(void)
     interactive_bootmenu();
     wait_threads();
 
-    // Change TPM phys. presence state befor leaving BIOS
-    tpm_leave_bios();
-
     // Prepare for boot.
     prepareboot();
 
index bab18f2dd360c4dd75b7a02d8761a1ef41ea7740..09954825c4c943181b3b5ae0c84f568c84ae38c8 100644 (file)
@@ -502,31 +502,31 @@ err_exit:
 }
 
 
-u32
-tpm_start(void)
+void
+tpm_setup(void)
 {
     if (!CONFIG_TCGBIOS)
-        return 0;
+        return;
 
     tpm_acpi_init();
     if (runningOnXen())
-        return 0;
+        return;
 
-    return tpm_startup();
+    tpm_startup();
 }
 
 
-u32
-tpm_leave_bios(void)
+void
+tpm_prepboot(void)
 {
     u32 rc;
     u32 returnCode;
 
     if (!CONFIG_TCGBIOS)
-        return 0;
+        return;
 
     if (!has_working_tpm())
-        return TCG_GENERAL_ERROR;
+        return;
 
     rc = build_and_send_cmd(0, TPM_ORD_PhysicalPresence,
                             PhysicalPresence_CMD_ENABLE,
@@ -550,15 +550,12 @@ tpm_leave_bios(void)
     if (rc)
         goto err_exit;
 
-    return 0;
+    return;
 
 err_exit:
     dprintf(DEBUG_tcg, "TCGBIOS: TPM malfunctioning (line %d).\n", __LINE__);
 
     tpm_state.tpm_working = 0;
-    if (rc)
-        return rc;
-    return TCG_TCG_COMMAND_ERROR;
 }
 
 static int
@@ -1450,17 +1447,17 @@ tpm_add_cdrom_catalog(const u8 *addr, u32 length)
     return tpm_ipl(IPL_EL_TORITO_2, addr, length);
 }
 
-u32
+void
 tpm_s3_resume(void)
 {
     u32 rc;
     u32 returnCode;
 
     if (!CONFIG_TCGBIOS)
-        return 0;
+        return;
 
     if (!has_working_tpm())
-        return TCG_GENERAL_ERROR;
+        return;
 
     dprintf(DEBUG_tcg, "TCGBIOS: Resuming with TPM_Startup(ST_STATE)\n");
 
@@ -1474,13 +1471,10 @@ tpm_s3_resume(void)
     if (rc || returnCode)
         goto err_exit;
 
-    return 0;
+    return;
 
 err_exit:
     dprintf(DEBUG_tcg, "TCGBIOS: TPM malfunctioning (line %d).\n", __LINE__);
 
     tpm_state.tpm_working = 0;
-    if (rc)
-        return rc;
-    return TCG_TCG_COMMAND_ERROR;
 }
index a3aa8704317b170560b0f1fcffb6a1b10ba64126..4b7eaabef87fae4383dcd3a3d3e94f6fc76cb8fa 100644 (file)
@@ -364,9 +364,9 @@ enum ipltype {
 struct bregs;
 void tpm_interrupt_handler32(struct bregs *regs);
 
-u32 tpm_start(void);
-u32 tpm_leave_bios(void);
-u32 tpm_s3_resume(void);
+void tpm_setup(void);
+void tpm_prepboot(void);
+void tpm_s3_resume(void);
 u32 tpm_add_bcv(u32 bootdrv, const u8 *addr, u32 length);
 u32 tpm_add_cdrom(u32 bootdrv, const u8 *addr, u32 length);
 u32 tpm_add_cdrom_catalog(const u8 *addr, u32 length);