summaryrefslogtreecommitdiff
path: root/Nt32Pkg/Library/DxeWinNtLib
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2007-06-26 09:35:19 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2007-06-26 09:35:19 +0000
commit869f8e34d23c1e197d1da3407aab966634d4f7ae (patch)
treed93c55a122d1728dbf6409b41dc5424254fab8fc /Nt32Pkg/Library/DxeWinNtLib
parent8693ca5d75564ee4869a3044b1c9b0982f425498 (diff)
downloadedk2-platforms-869f8e34d23c1e197d1da3407aab966634d4f7ae.tar.xz
Success to build first Nt32 module.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2753 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Nt32Pkg/Library/DxeWinNtLib')
-rw-r--r--Nt32Pkg/Library/DxeWinNtLib/CommonHeader.h34
-rw-r--r--Nt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.inf85
-rw-r--r--Nt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.msa54
-rw-r--r--Nt32Pkg/Library/DxeWinNtLib/WinNtLib.c53
4 files changed, 226 insertions, 0 deletions
diff --git a/Nt32Pkg/Library/DxeWinNtLib/CommonHeader.h b/Nt32Pkg/Library/DxeWinNtLib/CommonHeader.h
new file mode 100644
index 0000000000..c6f575f742
--- /dev/null
+++ b/Nt32Pkg/Library/DxeWinNtLib/CommonHeader.h
@@ -0,0 +1,34 @@
+/**@file
+ Common header file shared by all source files.
+
+ This file includes package header files, library classes and protocol, PPI & GUID definitions.
+
+ Copyright (c) 2006 - 2007, 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.
+**/
+
+#ifndef __COMMON_HEADER_H_
+#define __COMMON_HEADER_H_
+
+
+//
+// The package level header files this module uses
+//
+#include <PiDxe.h>
+#include <WinNtDxe.h>
+//
+// The protocols, PPI and GUID defintions for this module
+//
+//
+// The Library classes this module consumes
+//
+#include <Library/WinNtLib.h>
+#include <Library/DebugLib.h>
+#include <Library/HobLib.h>
+
+#endif
diff --git a/Nt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.inf b/Nt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.inf
new file mode 100644
index 0000000000..9a165a3b87
--- /dev/null
+++ b/Nt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.inf
@@ -0,0 +1,85 @@
+#/** @file
+# A library to produce the global variable 'gWinNt'
+#
+# This library contains a single global variable 'gWinNt' along with a constructor to initialize that global.
+# Copyright (c) 2006 - 2007, 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 Section - statements that will be processed to create a Makefile.
+#
+################################################################################
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = DxeWinNtLib
+ FILE_GUID = f6b5871d-5226-41b3-a569-3ff893fdc7bc
+ MODULE_TYPE = DXE_DRIVER
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = WinNtLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER
+ EDK_RELEASE_VERSION = 0x00020000
+ EFI_SPECIFICATION_VERSION = 0x00020000
+
+ CONSTRUCTOR = WinNtLibConstructor
+
+#
+# The following information is for reference only and not required by the build tools.
+#
+# VALID_ARCHITECTURES = IA32
+#
+# HOB Guid C Name: gEfiWinNtThunkProtocolGuid Hob Type: GUID_EXTENSION
+#
+
+################################################################################
+#
+# Sources Section - list of files that are required for the build to succeed.
+#
+################################################################################
+
+[Sources.common]
+ WinNtLib.c
+ CommonHeader.h
+
+
+################################################################################
+#
+# Includes Section - list of Include locations that are required for
+# this module.
+#
+################################################################################
+
+[Includes]
+ $(WORKSPACE)/MdePkg/Include/Library
+
+################################################################################
+#
+# Package Dependency Section - list of Package files that are required for
+# this module.
+#
+################################################################################
+
+[Packages]
+ Nt32Pkg/Nt32Pkg.dec
+ MdePkg/MdePkg.dec
+
+
+################################################################################
+#
+# Library Class Section - list of Library Classes that are required for
+# this module.
+#
+################################################################################
+
+[LibraryClasses]
+ HobLib
+ DebugLib
+
diff --git a/Nt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.msa b/Nt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.msa
new file mode 100644
index 0000000000..562616c1d1
--- /dev/null
+++ b/Nt32Pkg/Library/DxeWinNtLib/DxeWinNtLib.msa
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <MsaHeader>
+ <ModuleName>DxeWinNtLib</ModuleName>
+ <ModuleType>DXE_DRIVER</ModuleType>
+ <GuidValue>f6b5871d-5226-41b3-a569-3ff893fdc7bc</GuidValue>
+ <Version>1.0</Version>
+ <Abstract>A library to produce the global variable 'gWinNt'</Abstract>
+ <Description>This library contains a single global variable 'gWinNt' along with a constructor to initialize that global.</Description>
+ <Copyright>Copyright (c) 2006 - 2007, 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>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
+ </MsaHeader>
+ <ModuleDefinitions>
+ <SupportedArchitectures>IA32</SupportedArchitectures>
+ <BinaryModule>false</BinaryModule>
+ <OutputFileBasename>DxeWinNtLib</OutputFileBasename>
+ </ModuleDefinitions>
+ <LibraryClassDefinitions>
+ <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER">
+ <Keyword>WinNtLib</Keyword>
+ </LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">
+ <Keyword>DebugLib</Keyword>
+ </LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">
+ <Keyword>HobLib</Keyword>
+ </LibraryClass>
+ </LibraryClassDefinitions>
+ <SourceFiles>
+ <Filename>WinNtLib.c</Filename>
+ </SourceFiles>
+ <PackageDependencies>
+ <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ <Package PackageGuid="0fb2aa2d-10d5-40a5-a9dc-060c12a4a3f3"/>
+ </PackageDependencies>
+ <Hobs>
+ <HobTypes HobGuidCName="gEfiWinNtThunkProtocolGuid" Usage="ALWAYS_CONSUMED">
+ <HobType>GUID_EXTENSION</HobType>
+ </HobTypes>
+ </Hobs>
+ <Externs>
+ <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
+ <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>
+ <Extern>
+ <Constructor>WinNtLibConstructor</Constructor>
+ </Extern>
+ </Externs>
+</ModuleSurfaceArea> \ No newline at end of file
diff --git a/Nt32Pkg/Library/DxeWinNtLib/WinNtLib.c b/Nt32Pkg/Library/DxeWinNtLib/WinNtLib.c
new file mode 100644
index 0000000000..ef04eca44b
--- /dev/null
+++ b/Nt32Pkg/Library/DxeWinNtLib/WinNtLib.c
@@ -0,0 +1,53 @@
+/*++
+
+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:
+
+ WinNtLib.c
+
+Abstract:
+
+ WinNt Library
+
+--*/
+
+
+
+//
+// Include common header file for this module.
+//
+#include "CommonHeader.h"
+
+EFI_WIN_NT_THUNK_PROTOCOL *gWinNt;
+
+EFI_STATUS
+WinNtLibConstructor (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+/*++
+
+Routine Description:
+
+Arguments:
+
+Returns:
+
+--*/
+{
+ EFI_HOB_GUID_TYPE *GuidHob;
+
+ GuidHob = GetFirstGuidHob (&gEfiWinNtThunkProtocolGuid);
+ ASSERT (GuidHob != NULL);
+ gWinNt = (EFI_WIN_NT_THUNK_PROTOCOL *)(*(UINTN *)(GET_GUID_HOB_DATA (GuidHob)));
+ ASSERT (gWinNt != NULL);
+ return EFI_SUCCESS;
+}