Initial import.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
30
EdkModulePkg/Library/EdkDxePrintLib/EdkDxePrintLib.mbd
Normal file
30
EdkModulePkg/Library/EdkDxePrintLib/EdkDxePrintLib.mbd
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. 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.
|
||||
-->
|
||||
<LibraryModuleBuildDescription xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0 http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">
|
||||
<MbdLibHeader>
|
||||
<BaseName>EdkDxePrintLib</BaseName>
|
||||
<Guid>50bcb105-6634-441d-b403-659110a03ad2</Guid>
|
||||
<Version>0</Version>
|
||||
<Description>FIX ME!</Description>
|
||||
<Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>
|
||||
<License>
|
||||
All rights reserved. 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.
|
||||
</License>
|
||||
<Created>2006-03-12 17:09</Created>
|
||||
<Modified>2006-03-19 15:19</Modified>
|
||||
</MbdLibHeader>
|
||||
</LibraryModuleBuildDescription>
|
49
EdkModulePkg/Library/EdkDxePrintLib/EdkDxePrintLib.msa
Normal file
49
EdkModulePkg/Library/EdkDxePrintLib/EdkDxePrintLib.msa
Normal file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. 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.
|
||||
-->
|
||||
<LibraryModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0 http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">
|
||||
<MsaLibHeader>
|
||||
<BaseName>EdkDxePrintLib</BaseName>
|
||||
<ModuleType>DXE_DRIVER</ModuleType>
|
||||
<ComponentType>LIBRARY</ComponentType>
|
||||
<Guid>50bcb105-6634-441d-b403-659110a03ad2</Guid>
|
||||
<Version>0</Version>
|
||||
<Abstract>Component description file for the entry point to a EFIDXE Drivers</Abstract>
|
||||
<Description>FIX ME!</Description>
|
||||
<Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>
|
||||
<License>
|
||||
All rights reserved. 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.
|
||||
</License>
|
||||
<Specification>0</Specification>
|
||||
<Created>2006-03-12 17:09</Created>
|
||||
<Updated>2006-03-19 15:19</Updated>
|
||||
</MsaLibHeader>
|
||||
<LibraryClassDefinitions>
|
||||
<LibraryClass Usage="ALWAYS_PRODUCED">PrintLib</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">MemoryAllocationLib</LibraryClass>
|
||||
<LibraryClass Usage="ALWAYS_CONSUMED">UefiBootServicesTableLib</LibraryClass>
|
||||
</LibraryClassDefinitions>
|
||||
<SourceFiles>
|
||||
<Filename>PrintLib.c</Filename>
|
||||
</SourceFiles>
|
||||
<Includes>
|
||||
<PackageName>MdePkg</PackageName>
|
||||
<PackageName>EdkModulePkg</PackageName>
|
||||
</Includes>
|
||||
<Protocols>
|
||||
<Protocol Usage="ALWAYS_CONSUMED">Print</Protocol>
|
||||
</Protocols>
|
||||
</LibraryModuleSurfaceArea>
|
145
EdkModulePkg/Library/EdkDxePrintLib/PrintLib.c
Normal file
145
EdkModulePkg/Library/EdkDxePrintLib/PrintLib.c
Normal file
@@ -0,0 +1,145 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. 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.
|
||||
|
||||
Module Name:
|
||||
|
||||
PrintLib.c
|
||||
|
||||
Abstract:
|
||||
|
||||
Print Library
|
||||
|
||||
--*/
|
||||
|
||||
|
||||
|
||||
static EFI_PRINT_PROTOCOL *gPrintProtocol = NULL;
|
||||
|
||||
UINTN
|
||||
UnicodeVSPrint (
|
||||
OUT CHAR16 *StartOfBuffer,
|
||||
IN UINTN BufferSize,
|
||||
IN const CHAR16 *FormatString,
|
||||
IN VA_LIST Marker
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
VSPrint function to process format and place the results in Buffer. Since a
|
||||
VA_LIST is used this rountine allows the nesting of Vararg routines. Thus
|
||||
this is the main print working routine
|
||||
|
||||
Arguments:
|
||||
|
||||
StartOfBuffer - Unicode buffer to print the results of the parsing of Format into.
|
||||
|
||||
BufferSize - Maximum number of characters to put into buffer. Zero means
|
||||
no limit.
|
||||
|
||||
FormatString - Unicode format string see file header for more details.
|
||||
|
||||
Marker - Vararg list consumed by processing Format.
|
||||
|
||||
Returns:
|
||||
|
||||
Number of characters printed.
|
||||
|
||||
--*/
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
if (gPrintProtocol == NULL) {
|
||||
Status = gBS->LocateProtocol (
|
||||
&gEfiPrintProtocolGuid,
|
||||
NULL,
|
||||
(VOID **)&gPrintProtocol
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
gPrintProtocol = NULL;
|
||||
}
|
||||
if (gPrintProtocol == NULL) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return gPrintProtocol->VSPrint (StartOfBuffer, BufferSize, FormatString, Marker);
|
||||
}
|
||||
|
||||
UINTN
|
||||
UnicodeSPrint (
|
||||
OUT CHAR16 *StartOfBuffer,
|
||||
IN UINTN BufferSize,
|
||||
IN const CHAR16 *FormatString,
|
||||
...
|
||||
)
|
||||
|
||||
{
|
||||
UINTN Return;
|
||||
VA_LIST Marker;
|
||||
|
||||
VA_START (Marker, FormatString);
|
||||
Return = UnicodeVSPrint (StartOfBuffer, BufferSize, FormatString, Marker);
|
||||
VA_END (Marker);
|
||||
return Return;
|
||||
}
|
||||
|
||||
UINTN
|
||||
AsciiVSPrint (
|
||||
OUT CHAR8 *StartOfBuffer,
|
||||
IN UINTN BufferSize,
|
||||
IN const CHAR8 *FormatString,
|
||||
IN VA_LIST Marker
|
||||
)
|
||||
/*++
|
||||
|
||||
Routine Description:
|
||||
|
||||
VSPrint function to process format and place the results in Buffer. Since a
|
||||
VA_LIST is used this rountine allows the nesting of Vararg routines. Thus
|
||||
this is the main print working routine
|
||||
|
||||
Arguments:
|
||||
|
||||
StartOfBuffer - Unicode buffer to print the results of the parsing of Format into.
|
||||
|
||||
BufferSize - Maximum number of characters to put into buffer. Zero means
|
||||
no limit.
|
||||
|
||||
FormatString - Unicode format string see file header for more details.
|
||||
|
||||
Marker - Vararg list consumed by processing Format.
|
||||
|
||||
Returns:
|
||||
|
||||
Number of characters printed.
|
||||
|
||||
--*/
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
UINTN
|
||||
AsciiSPrint (
|
||||
OUT CHAR8 *StartOfBuffer,
|
||||
IN UINTN BufferSize,
|
||||
IN const CHAR8 *FormatString,
|
||||
...
|
||||
)
|
||||
|
||||
{
|
||||
UINTN Return;
|
||||
VA_LIST Marker;
|
||||
|
||||
VA_START (Marker, FormatString);
|
||||
Return = AsciiVSPrint (StartOfBuffer, BufferSize, FormatString, Marker);
|
||||
VA_END (Marker);
|
||||
return Return;
|
||||
}
|
47
EdkModulePkg/Library/EdkDxePrintLib/build.xml
Normal file
47
EdkModulePkg/Library/EdkDxePrintLib/build.xml
Normal file
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!-- Copyright (c) 2006, Intel Corporation
|
||||
All rights reserved. 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.-->
|
||||
<project basedir="." default="EdkDxePrintLib"><!--Apply external ANT tasks-->
|
||||
<taskdef resource="GenBuild.tasks"/>
|
||||
<taskdef resource="net/sf/antcontrib/antlib.xml"/>
|
||||
<property environment="env"/>
|
||||
<property name="WORKSPACE_DIR" value="${env.WORKSPACE}"/>
|
||||
<import file="${WORKSPACE_DIR}\Tools\Conf\BuildMacro.xml"/><!--MODULE_RELATIVE PATH is relative to PACKAGE_DIR-->
|
||||
<property name="MODULE_RELATIVE_PATH" value="Library\EdkDxePrintLib"/>
|
||||
<property name="MODULE_DIR" value="${PACKAGE_DIR}\${MODULE_RELATIVE_PATH}"/>
|
||||
<property name="COMMON_FILE" value="${WORKSPACE_DIR}\Tools\Conf\Common.xml"/>
|
||||
<target name="EdkDxePrintLib">
|
||||
<GenBuild baseName="EdkDxePrintLib" mbdFilename="${MODULE_DIR}\EdkDxePrintLib.mbd" msaFilename="${MODULE_DIR}\EdkDxePrintLib.msa"/>
|
||||
</target>
|
||||
<target depends="EdkDxePrintLib_clean" name="clean"/>
|
||||
<target depends="EdkDxePrintLib_cleanall" name="cleanall"/>
|
||||
<target name="EdkDxePrintLib_clean">
|
||||
<OutputDirSetup baseName="EdkDxePrintLib" mbdFilename="${MODULE_DIR}\EdkDxePrintLib.mbd" msaFilename="${MODULE_DIR}\EdkDxePrintLib.msa"/>
|
||||
<if>
|
||||
<available file="${DEST_DIR_OUTPUT}\EdkDxePrintLib_build.xml"/>
|
||||
<then>
|
||||
<ant antfile="${DEST_DIR_OUTPUT}\EdkDxePrintLib_build.xml" target="clean"/>
|
||||
</then>
|
||||
</if>
|
||||
<delete dir="${DEST_DIR_OUTPUT}" excludes="*.xml"/>
|
||||
</target>
|
||||
<target name="EdkDxePrintLib_cleanall">
|
||||
<OutputDirSetup baseName="EdkDxePrintLib" mbdFilename="${MODULE_DIR}\EdkDxePrintLib.mbd" msaFilename="${MODULE_DIR}\EdkDxePrintLib.msa"/>
|
||||
<if>
|
||||
<available file="${DEST_DIR_OUTPUT}\EdkDxePrintLib_build.xml"/>
|
||||
<then>
|
||||
<ant antfile="${DEST_DIR_OUTPUT}\EdkDxePrintLib_build.xml" target="cleanall"/>
|
||||
</then>
|
||||
</if>
|
||||
<delete dir="${DEST_DIR_OUTPUT}"/>
|
||||
<delete dir="${DEST_DIR_DEBUG}"/>
|
||||
<delete>
|
||||
<fileset dir="${BIN_DIR}" includes="**EdkDxePrintLib*"/>
|
||||
</delete>
|
||||
</target>
|
||||
</project>
|
Reference in New Issue
Block a user