MyFirstPeiLib.c
/** @file
C:\udk2\OvmfPkg\TestByMy\PeiTest\MyFirstPeiLib\MyFirstPeiLib.c
my first pei lib
**/
#include <Ppi/MyFirstPeiLib.h>
#include <Library/DebugLib.h>
/**
This funtion return num1+num2
@param[in] firstnum first number
@param[in] secendnum second number
@return reaslut
**/
UINTN
EFIAPI
add_function (
IN UINTN num1,
IN UINTN num2
)
{
return num1+num2;
}
/**
This funtion return num1-num2
@param[in] firstnum first number
@param[in] secendnum second number
@return reaslut
**/
UINTN
EFIAPI
sub_function (
IN UINTN num1,
IN UINTN num2
)
{
return num1-num2;
}
/**
This funtion is printf str in debug
@param[in] Mesg string
@return status
**/
EFI_STATUS
EFIAPI
PrintHelloMesg (
IN CHAR16 *Mesg
)
{
DEBUG ((EFI_D_ERROR, "MyHelloWorldPPI PrintHelloMsg : %s \n",Mesg));
return EFI_SUCCESS;
}
MyFirstPeiLib.inf
## @file
# PEI Test Library.
#
#
# Copyright (c) --
#
#
##
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = myfirstpeilib
FILE_GUID = 7488FC06-370A-1C41-AAAA-7395559A535A
MODULE_TYPE = PEIM
VERSION_STRING = 1.0
LIBRARY_CLASS = MyFirstPeiLib|PEIM PEI_CORE
[Sources]
MyFirstPeiLib.c
[Packages]
MdePkg/MdePkg.dec
OvmfPkg/OvmfPkg.dec
[LibraryClasses]
DebugLib
OvmfPkgX64.dsc
//C:\udk2\OvmfPkg\OvmfPkgX64.dsc
#my write
MyFirstPeiLib|OvmfPkg/TestByMy/PeiTest/MyFirstPeiLib/MyFirstPeiLib.inf
[LibraryClasses.common]