summaryrefslogtreecommitdiff
path: root/MdePkg/Library/PeiServicesTablePointerLibIdt
diff options
context:
space:
mode:
authoryshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524>2007-06-22 16:22:26 +0000
committeryshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524>2007-06-22 16:22:26 +0000
commitc7d265a94a3ee2517430e4f19f5b24482e5e7132 (patch)
tree6f74331af15f965bc99f56652cfa75db9794e743 /MdePkg/Library/PeiServicesTablePointerLibIdt
parent1a5589a183b11fcfa54a0c4b5496d80f233b1ceb (diff)
downloadedk2-platforms-c7d265a94a3ee2517430e4f19f5b24482e5e7132.tar.xz
Checked in part of MDE library instances following PI and UEFI. It includes:
1) UefiLib adds features of RFC 3066/Iso639 language string and driver model protocols installation. 2) PeiCoreEntryPoint following PI. 3) UefiDriverEntryPoint following UEFI/EFI. 4) PeiServicesTablePointerLib following PI for IPF and x86. 5) Remove many CommonHeader.h. If there is only one C file in module, we should add the common headers in C file instead of creating a new CommonHeader.h. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2723 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/PeiServicesTablePointerLibIdt')
-rw-r--r--MdePkg/Library/PeiServicesTablePointerLibIdt/Ia32/AsmPeiSevicesTablePointer.S36
-rw-r--r--MdePkg/Library/PeiServicesTablePointerLibIdt/Ia32/AsmPeiSevicesTablePointer.asm41
-rw-r--r--MdePkg/Library/PeiServicesTablePointerLibIdt/Ia32/AsmPeiSevicesTablePointer.c25
-rw-r--r--MdePkg/Library/PeiServicesTablePointerLibIdt/InternalPeiServicesTablePointer.h31
-rw-r--r--MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointer.c50
-rw-r--r--MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.msa50
-rw-r--r--MdePkg/Library/PeiServicesTablePointerLibIdt/x64/AsmPeiSevicesTablePointer.S36
-rw-r--r--MdePkg/Library/PeiServicesTablePointerLibIdt/x64/AsmPeiSevicesTablePointer.asm38
8 files changed, 307 insertions, 0 deletions
diff --git a/MdePkg/Library/PeiServicesTablePointerLibIdt/Ia32/AsmPeiSevicesTablePointer.S b/MdePkg/Library/PeiServicesTablePointerLibIdt/Ia32/AsmPeiSevicesTablePointer.S
new file mode 100644
index 0000000000..22d32acb1a
--- /dev/null
+++ b/MdePkg/Library/PeiServicesTablePointerLibIdt/Ia32/AsmPeiSevicesTablePointer.S
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# 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:
+#
+# ReadIdtr.Asm
+#
+# Abstract:
+#
+# AsmPeiSevicesTablePointer function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+.globl ASM_PFX(AsmPeiSevicesTablePointer)
+
+#------------------------------------------------------------------------------
+# EFI_PEI_SERVICES **
+# EFIAPI
+# AsmPeiSevicesTablePointer (
+# );
+#------------------------------------------------------------------------------
+ASM_PFX(AsmPeiSevicesTablePointer):
+ movl 4(%esp), %eax
+ sidt (%eax)
+ movl -4(%eax), %eax
+ ret
diff --git a/MdePkg/Library/PeiServicesTablePointerLibIdt/Ia32/AsmPeiSevicesTablePointer.asm b/MdePkg/Library/PeiServicesTablePointerLibIdt/Ia32/AsmPeiSevicesTablePointer.asm
new file mode 100644
index 0000000000..74f19afa67
--- /dev/null
+++ b/MdePkg/Library/PeiServicesTablePointerLibIdt/Ia32/AsmPeiSevicesTablePointer.asm
@@ -0,0 +1,41 @@
+;------------------------------------------------------------------------------
+;
+; 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:
+;
+; AsmPeiSevicesTablePointer.Asm
+;
+; Abstract:
+;
+; AsmPeiSevicesTablePointer function
+;
+; Notes:
+;
+;------------------------------------------------------------------------------
+
+ .386
+ .model flat,C
+ .code
+
+;------------------------------------------------------------------------------
+; EFI_PEI_SERVICES **
+; EFIAPI
+; AsmPeiSevicesTablePointer (
+; );
+;------------------------------------------------------------------------------
+PeiServicesTablePointer PROC
+ mov eax, [esp + 4]
+ sidt fword ptr [eax]
+ mov eax, [eax - 4]
+ ret
+PeiServicesTablePointer ENDP
+
+ END
diff --git a/MdePkg/Library/PeiServicesTablePointerLibIdt/Ia32/AsmPeiSevicesTablePointer.c b/MdePkg/Library/PeiServicesTablePointerLibIdt/Ia32/AsmPeiSevicesTablePointer.c
new file mode 100644
index 0000000000..aa578ee130
--- /dev/null
+++ b/MdePkg/Library/PeiServicesTablePointerLibIdt/Ia32/AsmPeiSevicesTablePointer.c
@@ -0,0 +1,25 @@
+/** @file
+ AsmReadIdtr function
+
+ Copyright (c) 2006 - 2007, Intel Corporation<BR>
+ 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.
+
+**/
+
+EFI_PEI_SERVICES **
+EFIAPI
+AsmPeiSevicesTablePointer (
+ VOID
+ )
+{
+ _asm {
+ sidt fword ptr [eax]
+ mov eax, [eax - 4]
+ }
+}
diff --git a/MdePkg/Library/PeiServicesTablePointerLibIdt/InternalPeiServicesTablePointer.h b/MdePkg/Library/PeiServicesTablePointerLibIdt/InternalPeiServicesTablePointer.h
new file mode 100644
index 0000000000..44bc71b534
--- /dev/null
+++ b/MdePkg/Library/PeiServicesTablePointerLibIdt/InternalPeiServicesTablePointer.h
@@ -0,0 +1,31 @@
+/*++
+
+Copyright (c) 2006 - 2007 Intel Corporation. All rights reserved
+This software and associated documentation (if any) is furnished
+under a license and may only be used or copied in accordance
+with the terms of the license. Except as permitted by such
+license, no part of this software or documentation may be
+reproduced, stored in a retrieval system, or transmitted in any
+form or by any means without the express written consent of
+Intel Corporation.
+
+
+Module Name:
+
+ InternalPeiServicesTablePointer.h
+
+
+--*/
+
+#ifndef __INTERNAL_PEI_SERVICES_TABLE_POINTER_H__
+#define __INTERNAL_PEI_SERVICES_TABLE_POINTER_H__
+
+extern
+EFI_PEI_SERVICES **
+EFIAPI
+AsmPeiSevicesTablePointer (
+ VOID
+ );
+
+
+#endif \ No newline at end of file
diff --git a/MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointer.c b/MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointer.c
new file mode 100644
index 0000000000..4c9b3d3541
--- /dev/null
+++ b/MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointer.c
@@ -0,0 +1,50 @@
+/*++
+
+Copyright (c) 2006 Intel Corporation. All rights reserved
+This software and associated documentation (if any) is furnished
+under a license and may only be used or copied in accordance
+with the terms of the license. Except as permitted by such
+license, no part of this software or documentation may be
+reproduced, stored in a retrieval system, or transmitted in any
+form or by any means without the express written consent of
+Intel Corporation.
+
+
+Module Name:
+
+ PeiServicesTablePointer.c
+
+Abstract:
+
+ PEI Services Table Pointer Library.
+
+--*/
+
+#include "InternalPeiServicesTablePointer.h"
+
+/**
+
+ The function returns the pointer to PeiServicee following
+ PI1.0.
+
+ For IA32, the four-bytes field immediately prior to new IDT
+ base addres is used to save the EFI_PEI_SERVICES**.
+ For x64, the eight-bytes field immediately prior to new IDT
+ base addres is used to save the EFI_PEI_SERVICES**.
+
+ @retval The pointer to PeiServices.
+
+**/
+EFI_PEI_SERVICES **
+EFIAPI
+GetPeiServicesTablePointer (
+ VOID
+ )
+{
+ EFI_PEI_SERVICES **PeiServices;
+
+ PeiServices = (EFI_PEI_SERVICES **) AsmPeiSevicesTablePointer ();
+ ASSERT (PeiServices != NULL);
+ return PeiServices;
+}
+
diff --git a/MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.msa b/MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.msa
new file mode 100644
index 0000000000..99c482eb6c
--- /dev/null
+++ b/MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.msa
@@ -0,0 +1,50 @@
+<?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>PeiServicesTablePointerLibIdt</ModuleName>
+ <ModuleType>PEIM</ModuleType>
+ <GuidValue>DED3F743-CE2C-4ba6-92A2-FFCE2A6D72D9</GuidValue>
+ <Version>1.0</Version>
+ <Abstract>Component description file for IPF KR1 Pei Services Table Pointer Library</Abstract>
+ <Description>PEI Services Table Library implementation that retrieves a pointer to the PEI
+ Services Table from the KR1 register on IPF.</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 X64</SupportedArchitectures>
+ <BinaryModule>false</BinaryModule>
+ <OutputFileBasename>PeiServicesTablePointerLibIdt</OutputFileBasename>
+ </ModuleDefinitions>
+ <LibraryClassDefinitions>
+ <LibraryClass Usage="ALWAYS_PRODUCED" SupModuleList="PEIM PEI_CORE">
+ <Keyword>PeiServicesTablePointerLib</Keyword>
+ </LibraryClass>
+ <LibraryClass Usage="ALWAYS_CONSUMED">
+ <Keyword>DebugLib</Keyword>
+ </LibraryClass>
+ </LibraryClassDefinitions>
+ <SourceFiles>
+ <Filename SupArchList="IA32 X64">PeiServicesTablePointer.c</Filename>
+ <Filename SupArchList="IA32" ToolChainFamily="GCC">Ia32/AsmPeiSevicesTablePointer.S</Filename>
+ <Filename SupArchList="IA32" ToolChainFamily="MSFT">Ia32/AsmPeiSevicesTablePointer.c</Filename>
+ <Filename SupArchList="X64" ToolChainFamily="GCC">x64/AsmPeiSevicesTablePointer.S</Filename>
+ <Filename SupArchList="X64" ToolChainFamily="MSFT">x64/AsmPeiSevicesTablePointer.asm</Filename>
+ </SourceFiles>
+ <NonProcessedFiles>
+ <Filename>Ia32/AsmPeiSevicesTablePointer.Asm</Filename>
+ </NonProcessedFiles>
+ <PackageDependencies>
+ <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>
+ </PackageDependencies>
+ <Externs>
+ <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>
+ <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>
+ </Externs>
+</ModuleSurfaceArea> \ No newline at end of file
diff --git a/MdePkg/Library/PeiServicesTablePointerLibIdt/x64/AsmPeiSevicesTablePointer.S b/MdePkg/Library/PeiServicesTablePointerLibIdt/x64/AsmPeiSevicesTablePointer.S
new file mode 100644
index 0000000000..30eccdd0b4
--- /dev/null
+++ b/MdePkg/Library/PeiServicesTablePointerLibIdt/x64/AsmPeiSevicesTablePointer.S
@@ -0,0 +1,36 @@
+#------------------------------------------------------------------------------
+#
+# 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:
+#
+# AsmPeiSevicesTablePointer.S
+#
+# Abstract:
+#
+# AsmPeiSevicesTablePointer function
+#
+# Notes:
+#
+#------------------------------------------------------------------------------
+
+
+#------------------------------------------------------------------------------
+# EFI_PEI_SERVICES **
+# EFIAPI
+# AsmPeiSevicesTablePointer (
+# );
+#------------------------------------------------------------------------------
+.global AsmPeiSevicesTablePointer;
+.align 16;
+AsmPeiSevicesTablePointer:
+ sidt (%rcx)
+ movq -8(%rcx), %rcx
+ ret
diff --git a/MdePkg/Library/PeiServicesTablePointerLibIdt/x64/AsmPeiSevicesTablePointer.asm b/MdePkg/Library/PeiServicesTablePointerLibIdt/x64/AsmPeiSevicesTablePointer.asm
new file mode 100644
index 0000000000..290e929d06
--- /dev/null
+++ b/MdePkg/Library/PeiServicesTablePointerLibIdt/x64/AsmPeiSevicesTablePointer.asm
@@ -0,0 +1,38 @@
+;------------------------------------------------------------------------------
+;
+; 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:
+;
+; ReadIdtr.Asm
+;
+; Abstract:
+;
+; AsmPeiSevicesTablePointer function
+;
+; Notes:
+;
+;------------------------------------------------------------------------------
+
+ .code
+
+;------------------------------------------------------------------------------
+; EFI_PEI_SERVICES **
+; EFIAPI
+; AsmPeiSevicesTablePointer (
+; );
+;------------------------------------------------------------------------------
+AsmPeiSevicesTablePointer PROC
+ sidt fword ptr [rcx]
+ mov rcx, [rcx - 8]
+ ret
+AsmPeiSevicesTablePointer ENDP
+
+ END