From 804405e7d10525e41720216137b2551f62a0663f Mon Sep 17 00:00:00 2001 From: eric_tian Date: Mon, 30 Jun 2008 05:08:49 +0000 Subject: Port EdkUnixPkg to UnixPkg. The changes are listed as follows: 1. change *.msa to *.inf, and create platform configuration files .dec&.dsc&.fdf to comply with Edk2 build process 2. using PCD mechanism to replace macro. 3. change Sec code to cowork with PI1.0 Pei Core and produce temparory memory ppi. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5380 6f19259b-4bc3-4df7-8a09-765794883524 --- UnixPkg/Library/DxeUnixLib/DxeUnixLib.inf | 50 ++++++++++++++++++++++++++++ UnixPkg/Library/DxeUnixLib/DxeUnixLib.msa | 55 +++++++++++++++++++++++++++++++ UnixPkg/Library/DxeUnixLib/UnixLib.c | 51 ++++++++++++++++++++++++++++ 3 files changed, 156 insertions(+) create mode 100644 UnixPkg/Library/DxeUnixLib/DxeUnixLib.inf create mode 100644 UnixPkg/Library/DxeUnixLib/DxeUnixLib.msa create mode 100644 UnixPkg/Library/DxeUnixLib/UnixLib.c (limited to 'UnixPkg/Library/DxeUnixLib') diff --git a/UnixPkg/Library/DxeUnixLib/DxeUnixLib.inf b/UnixPkg/Library/DxeUnixLib/DxeUnixLib.inf new file mode 100644 index 0000000000..01c9f1a722 --- /dev/null +++ b/UnixPkg/Library/DxeUnixLib/DxeUnixLib.inf @@ -0,0 +1,50 @@ +#/** @file +# A library to produce the global variable 'gUnix' +# +# This library contains a single global variable 'gUnix' along with a constructor to initialize that global. +# Copyright (c) 2006 - 2008, 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. +# +# +#**/ + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = DxeUnixLib + FILE_GUID = f39efc84-8985-11db-ad67-0040d02b1835 + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + LIBRARY_CLASS = UnixLib + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + + CONSTRUCTOR = UnixLibConstructor + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = IA32 X64 IPF EBC +# + +[Sources.common] + UnixLib.c + + +[Packages] + MdePkg/MdePkg.dec + UnixPkg/UnixPkg.dec + +[LibraryClasses] + HobLib + DebugLib + + +[Protocols] + gEfiUnixThunkProtocolGuid # PROTOCOL ALWAYS_CONSUMED + diff --git a/UnixPkg/Library/DxeUnixLib/DxeUnixLib.msa b/UnixPkg/Library/DxeUnixLib/DxeUnixLib.msa new file mode 100644 index 0000000000..d77a86eb95 --- /dev/null +++ b/UnixPkg/Library/DxeUnixLib/DxeUnixLib.msa @@ -0,0 +1,55 @@ + + + + DxeUnixLib + DXE_DRIVER + f39efc84-8985-11db-ad67-0040d02b1835 + 1.0 + A library to produce the global variable 'gUnix' + This library contains a single global variable 'gUnix' along with a constructor to initialize that global. + 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. + FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052 + + + IA32 X64 IPF EBC + false + DxeUnixLib + + + + UnixLib + + + DebugLib + + + HobLib + + + + UnixLib.c + + + + + + + + + gEfiUnixThunkProtocolGuid + + + + EFI_SPECIFICATION_VERSION 0x00020000 + EDK_RELEASE_VERSION 0x00020000 + + UnixLibConstructor + + + diff --git a/UnixPkg/Library/DxeUnixLib/UnixLib.c b/UnixPkg/Library/DxeUnixLib/UnixLib.c new file mode 100644 index 0000000000..98bf0442ce --- /dev/null +++ b/UnixPkg/Library/DxeUnixLib/UnixLib.c @@ -0,0 +1,51 @@ +/*++ + +Copyright (c) 2006 - 2008, 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: + + UnixLib.c + +Abstract: + + Unix Library + +--*/ +#include "PiDxe.h" +#include "UnixDxe.h" +#include +#include +#include + +EFI_UNIX_THUNK_PROTOCOL *gUnix; + +EFI_STATUS +UnixLibConstructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +/*++ + +Routine Description: + +Arguments: + +Returns: + +--*/ +{ + EFI_HOB_GUID_TYPE *GuidHob; + + GuidHob = GetFirstGuidHob (&gEfiUnixThunkProtocolGuid); + ASSERT (GuidHob != NULL); + gUnix = (EFI_UNIX_THUNK_PROTOCOL *)(*(UINTN *)(GET_GUID_HOB_DATA (GuidHob))); + ASSERT (gUnix != NULL); + return EFI_SUCCESS; +} -- cgit v1.2.3