Add PlatformSecLib class and PlatformSecLibNull instance
that is used by the SecCore.  PlatformSecLibNull should
not be used in a platform build.  Instead, it should be
used as a template for implementing a platform specific
instance of the PlatformSecLib library class.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <[email protected]>
---
 UefiCpuPkg/Include/Library/PlatformSecLib.h        |  70 ++++++++++++++++
 .../PlatformSecLibNull/PlatformSecLibNull.c        |  90 +++++++++++++++++++++
 .../PlatformSecLibNull/PlatformSecLibNull.inf      |  37 +++++++++
 .../PlatformSecLibNull/PlatformSecLibNull.uni      | Bin 0 -> 1646 bytes
 4 files changed, 197 insertions(+)
 create mode 100644 UefiCpuPkg/Include/Library/PlatformSecLib.h
 create mode 100644 UefiCpuPkg/Library/PlatformSecLibNull/PlatformSecLibNull.c
 create mode 100644 UefiCpuPkg/Library/PlatformSecLibNull/PlatformSecLibNull.inf
 create mode 100644 UefiCpuPkg/Library/PlatformSecLibNull/PlatformSecLibNull.uni

diff --git a/UefiCpuPkg/Include/Library/PlatformSecLib.h 
b/UefiCpuPkg/Include/Library/PlatformSecLib.h
new file mode 100644
index 0000000..32700bc
--- /dev/null
+++ b/UefiCpuPkg/Include/Library/PlatformSecLib.h
@@ -0,0 +1,70 @@
+/** @file
+This library class defines interface for platform to perform platform
+specific initialization in SEC phase.
+
+Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD 
License
+which accompanies this distribution.  The full text of the license may be 
found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __PLATFORM_SEC_LIB_H__
+#define __PLATFORM_SEC_LIB_H__
+
+/**
+  A developer supplied function to perform platform specific operations.
+
+  It's a developer supplied function to perform any operations appropriate to a
+  given platform. It's invoked just before passing control to PEI core by SEC
+  core. Platform developer may modify the SecCoreData passed to PEI Core.
+  It returns a platform specific PPI list that platform wishes to pass to PEI 
core.
+  The Generic SEC core module will merge this list to join the final list 
passed to
+  PEI core.
+
+  @param  SecCoreData           The same parameter as passing to PEI core. It
+                                could be overridden by this function.
+
+  @return The platform specific PPI list to be passed to PEI core or
+          NULL if there is no need of such platform specific PPI list.
+
+**/
+EFI_PEI_PPI_DESCRIPTOR *
+EFIAPI
+SecPlatformMain (
+  IN OUT   EFI_SEC_PEI_HAND_OFF        *SecCoreData
+  );
+
+/**
+  This interface conveys state information out of the Security (SEC) phase 
into PEI.
+
+  @param  PeiServices               Pointer to the PEI Services Table.
+  @param  StructureSize             Pointer to the variable describing size of 
the input buffer.
+  @param  PlatformInformationRecord Pointer to the 
EFI_SEC_PLATFORM_INFORMATION_RECORD.
+
+  @retval EFI_SUCCESS           The data was successfully returned.
+  @retval EFI_BUFFER_TOO_SMALL  The buffer was too small.
+
+**/
+EFI_STATUS
+EFIAPI
+SecPlatformInformation (  
+  IN CONST EFI_PEI_SERVICES                     **PeiServices,
+  IN OUT   UINT64                               *StructureSize,
+     OUT   EFI_SEC_PLATFORM_INFORMATION_RECORD  *PlatformInformationRecord
+  );
+
+/**
+  This interface disables temporary memory in SEC Phase.
+**/
+VOID
+EFIAPI
+SecPlatformDisableTemporaryMemory (  
+  VOID
+  );
+
+#endif
diff --git a/UefiCpuPkg/Library/PlatformSecLibNull/PlatformSecLibNull.c 
b/UefiCpuPkg/Library/PlatformSecLibNull/PlatformSecLibNull.c
new file mode 100644
index 0000000..2b8f18a
--- /dev/null
+++ b/UefiCpuPkg/Library/PlatformSecLibNull/PlatformSecLibNull.c
@@ -0,0 +1,90 @@
+/** @file
+Null instance of Platform Sec Lib.
+
+Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials
+are licensed and made available under the terms and conditions of the BSD 
License
+which accompanies this distribution.  The full text of the license may be 
found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <PiPei.h>
+
+#include <Ppi/SecPlatformInformation.h>
+
+/**
+  A developer supplied function to perform platform specific operations.
+
+  It's a developer supplied function to perform any operations appropriate to a
+  given platform. It's invoked just before passing control to PEI core by SEC
+  core. Platform developer may modify the SecCoreData passed to PEI Core.
+  It returns a platform specific PPI list that platform wishes to pass to PEI 
core.
+  The Generic SEC core module will merge this list to join the final list 
passed to
+  PEI core.
+
+  @param  SecCoreData           The same parameter as passing to PEI core. It
+                                could be overridden by this function.
+
+  @return The platform specific PPI list to be passed to PEI core or
+          NULL if there is no need of such platform specific PPI list.
+
+**/
+EFI_PEI_PPI_DESCRIPTOR *
+EFIAPI
+SecPlatformMain (
+  IN OUT   EFI_SEC_PEI_HAND_OFF        *SecCoreData
+  )
+{
+  return NULL;
+}
+
+/**
+  This interface conveys state information out of the Security (SEC) phase 
into PEI.
+
+  @param  PeiServices               Pointer to the PEI Services Table.
+  @param  StructureSize             Pointer to the variable describing size of 
the input buffer.
+  @param  PlatformInformationRecord Pointer to the 
EFI_SEC_PLATFORM_INFORMATION_RECORD.
+
+  @retval EFI_SUCCESS           The data was successfully returned.
+  @retval EFI_BUFFER_TOO_SMALL  The buffer was too small.
+
+**/
+EFI_STATUS
+EFIAPI
+SecPlatformInformation (  
+  IN CONST EFI_PEI_SERVICES                     **PeiServices,
+  IN OUT   UINT64                               *StructureSize,
+     OUT   EFI_SEC_PLATFORM_INFORMATION_RECORD  *PlatformInformationRecord
+  )
+{
+  return EFI_SUCCESS;
+}
+
+/**
+  This interface disables temporary memory in SEC Phase.
+**/
+VOID
+EFIAPI
+SecPlatformDisableTemporaryMemory (  
+  VOID
+  )
+{
+}
+
+/**
+  This function provides dummy function so that SecCore can pass build
+  validation. All real platform library instances need to implement the real 
+  entry point in assembly.
+**/
+VOID
+EFIAPI
+_ModuleEntryPoint (
+  VOID
+  )
+{
+  return;
+}
diff --git a/UefiCpuPkg/Library/PlatformSecLibNull/PlatformSecLibNull.inf 
b/UefiCpuPkg/Library/PlatformSecLibNull/PlatformSecLibNull.inf
new file mode 100644
index 0000000..aae0cc7
--- /dev/null
+++ b/UefiCpuPkg/Library/PlatformSecLibNull/PlatformSecLibNull.inf
@@ -0,0 +1,37 @@
+## @file
+#  Library functions for PlatformSecLib.
+#
+#  Null instance of Platform Sec Lib.
+#
+#  Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.<BR>
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution.  The full text of the license may be 
found at
+#  http://opensource.org/licenses/bsd-license.php
+#
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+#
+##
+
+[Defines]
+  INF_VERSION                    = 0x00010005
+  BASE_NAME                      = PlatformSecLibNull
+  MODULE_UNI_FILE                = PlatformSecLibNull.uni
+  FILE_GUID                      = 6695974D-968C-420b-80B9-7870CD20118F
+  MODULE_TYPE                    = SEC
+  VERSION_STRING                 = 1.0
+  LIBRARY_CLASS                  = PlatformSecLib 
+
+#
+# The following information is for reference only and not required by the 
build tools.
+#
+#  VALID_ARCHITECTURES           = IA32 X64
+#
+
+[Sources]
+  PlatformSecLibNull.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  UefiCpuPkg/UefiCpuPkg.dec
diff --git a/UefiCpuPkg/Library/PlatformSecLibNull/PlatformSecLibNull.uni 
b/UefiCpuPkg/Library/PlatformSecLibNull/PlatformSecLibNull.uni
new file mode 100644
index 
0000000000000000000000000000000000000000..1d77a52e845f95050ce15b058ffb50c8b8fc1a5e
GIT binary patch
literal 1646
zcmb`H-EPxB5QXO&iFa6~H-K6PDsh7lBB2H>Ac+!3g)8JFO=_uWD#x_+<tg9Ub?lG^
zAq29#KeMxE&YT(h?nm3&=6Ij*ID2h#%k9F>?4dots<V$+CRSL+d&_=q-|W(+R$^bV
zT6^1yQ)dJ2W}M79DQsyYkfs$vRAV;SJ+Ll#99Tjsxh?E7EGtm%Bf1K6m)Ab@H(*@B
zxd44(=b$@#1o~s<V|!}P?71DXPKa3&Q#^F1;Fd;Z5^{_<=~PS`G-Y0JZ_QiSHRH@8
zdud%8+N(X;rf|r;URU_9;G`H!P?YtIxx_=cXRw^&v4n}vZoNJWPL}M&RV*?Xt?M|t
zB{mLg?lqL6;?&^l_N<C<&04k2sIDsRd|h>_N^Y2hSWC}(!&1z|H?Q@P5}{t3dtK^u
zf>qt4dIl~{<!`(eQ^xz*=J*RySV1qvQg<lp2|Ty!;w-IHQ)h;566^1H?Xvn+nV_b6
zdV;??dsS&5PUV)e>Yb8Wyzt+Ix+-KO|H9`NakrqN?H%>kSSE0v+0o8P1j;#Yqe-($
z?Y+e?8qi67d&k(ZPwW#^b?B-&#hTD-V^*=(dTc%B7`rqH2u&RldOOBr<dOTV)YBSU
z%)%9Fi@EFf+8u7OJLO!ceIL=;DPBX*tcN`TRTzCAeaKGSWmC))U->9%@Oq1{qJLrj
zz=@daTa2qHA&b~P*EkJ&f))chOEFLQ;x@W%X6OHAZEu(DpzfVZDx^P%wEGH5pZjBw
zVs;(!4ksOyO7Z*Mb3i5aEi9;h#;D#=KOBK2maXcK_wWDA)?enJ>W^Tr&KT5+@5|%Q
LIsDImbI9W-%3uEv

literal 0
HcmV?d00001

-- 
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to