]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SecurityPkg: Add Tpm2 prefix to lib to avoid conflict.
authorJiewen Yao <jiewen.yao@intel.com>
Wed, 9 Mar 2016 04:47:15 +0000 (20:47 -0800)
committerHao Wu <hao.a.wu@intel.com>
Fri, 11 Mar 2016 04:51:32 +0000 (12:51 +0800)
Tpm2Ptp.c is library, but it miss Tpm2 prefix for
IsPtpPresence() and GetPtpInterface(). There might
be risk as name symbol conflict. This patch adds Tpm2
prefix for them.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <Jiewen.Yao@intel.com>
Reviewed-by: "Zhang, Chao B" <chao.b.zhang@intel.com>
Tested-by: "Wu, Hao A" <hao.a.wu@intel.com>
SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2Ptp.c

index a627bbdedf7a220221b1512f379c87dc42c8339d..ddd4bd00b474515f32ef2dd2bd3d04afc9547ebe 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   PTP (Platform TPM Profile) CRB (Command Response Buffer) interface used by dTPM2.0 library.\r
 \r
 /** @file\r
   PTP (Platform TPM Profile) CRB (Command Response Buffer) interface used by dTPM2.0 library.\r
 \r
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -52,7 +52,7 @@ typedef enum {
   @retval    FALSE   TPM PTP is not found.\r
 **/\r
 BOOLEAN\r
   @retval    FALSE   TPM PTP is not found.\r
 **/\r
 BOOLEAN\r
-IsPtpPresence (\r
+Tpm2IsPtpPresence (\r
   IN VOID *Reg\r
   )\r
 {\r
   IN VOID *Reg\r
   )\r
 {\r
@@ -117,7 +117,7 @@ PtpCrbRequestUseTpm (
 {\r
   EFI_STATUS                        Status;\r
 \r
 {\r
   EFI_STATUS                        Status;\r
 \r
-  if (!IsPtpPresence (CrbReg)) {\r
+  if (!Tpm2IsPtpPresence (CrbReg)) {\r
     return EFI_NOT_FOUND;\r
   }\r
 \r
     return EFI_NOT_FOUND;\r
   }\r
 \r
@@ -353,14 +353,14 @@ TisPcRequestUseTpm (
   @return PTP interface type.\r
 **/\r
 PTP_INTERFACE_TYPE\r
   @return PTP interface type.\r
 **/\r
 PTP_INTERFACE_TYPE\r
-GetPtpInterface (\r
+Tpm2GetPtpInterface (\r
   IN VOID *Register\r
   )\r
 {\r
   PTP_CRB_INTERFACE_IDENTIFIER  InterfaceId;\r
   PTP_FIFO_INTERFACE_CAPABILITY InterfaceCapability;\r
 \r
   IN VOID *Register\r
   )\r
 {\r
   PTP_CRB_INTERFACE_IDENTIFIER  InterfaceId;\r
   PTP_FIFO_INTERFACE_CAPABILITY InterfaceCapability;\r
 \r
-  if (!IsPtpPresence (Register)) {\r
+  if (!Tpm2IsPtpPresence (Register)) {\r
     return PtpInterfaceMax;\r
   }\r
   //\r
     return PtpInterfaceMax;\r
   }\r
   //\r
@@ -401,7 +401,7 @@ DumpPtpInfo (
   UINT8                         Rid;\r
   PTP_INTERFACE_TYPE            PtpInterface;\r
 \r
   UINT8                         Rid;\r
   PTP_INTERFACE_TYPE            PtpInterface;\r
 \r
-  if (!IsPtpPresence (Register)) {\r
+  if (!Tpm2IsPtpPresence (Register)) {\r
     return ;\r
   }\r
 \r
     return ;\r
   }\r
 \r
@@ -440,7 +440,7 @@ DumpPtpInfo (
   Vid = 0xFFFF;\r
   Did = 0xFFFF;\r
   Rid = 0xFF;\r
   Vid = 0xFFFF;\r
   Did = 0xFFFF;\r
   Rid = 0xFF;\r
-  PtpInterface = GetPtpInterface (Register);\r
+  PtpInterface = Tpm2GetPtpInterface (Register);\r
   DEBUG ((EFI_D_INFO, "PtpInterface - %x\n", PtpInterface));\r
   switch (PtpInterface) {\r
   case PtpInterfaceCrb:\r
   DEBUG ((EFI_D_INFO, "PtpInterface - %x\n", PtpInterface));\r
   switch (PtpInterface) {\r
   case PtpInterfaceCrb:\r
@@ -485,7 +485,7 @@ DTpm2SubmitCommand (
 {\r
   PTP_INTERFACE_TYPE  PtpInterface;\r
 \r
 {\r
   PTP_INTERFACE_TYPE  PtpInterface;\r
 \r
-  PtpInterface = GetPtpInterface ((VOID *) (UINTN) PcdGet64 (PcdTpmBaseAddress));\r
+  PtpInterface = Tpm2GetPtpInterface ((VOID *) (UINTN) PcdGet64 (PcdTpmBaseAddress));\r
   switch (PtpInterface) {\r
   case PtpInterfaceCrb:\r
     return PtpCrbTpmCommand (\r
   switch (PtpInterface) {\r
   case PtpInterfaceCrb:\r
     return PtpCrbTpmCommand (\r
@@ -524,7 +524,7 @@ DTpm2RequestUseTpm (
 {\r
   PTP_INTERFACE_TYPE  PtpInterface;\r
 \r
 {\r
   PTP_INTERFACE_TYPE  PtpInterface;\r
 \r
-  PtpInterface = GetPtpInterface ((VOID *) (UINTN) PcdGet64 (PcdTpmBaseAddress));\r
+  PtpInterface = Tpm2GetPtpInterface ((VOID *) (UINTN) PcdGet64 (PcdTpmBaseAddress));\r
   switch (PtpInterface) {\r
   case PtpInterfaceCrb:\r
     return PtpCrbRequestUseTpm ((PTP_CRB_REGISTERS_PTR) (UINTN) PcdGet64 (PcdTpmBaseAddress));\r
   switch (PtpInterface) {\r
   case PtpInterfaceCrb:\r
     return PtpCrbRequestUseTpm ((PTP_CRB_REGISTERS_PTR) (UINTN) PcdGet64 (PcdTpmBaseAddress));\r