summaryrefslogtreecommitdiff
path: root/EDK/Foundation/Library/CompilerStub
diff options
context:
space:
mode:
Diffstat (limited to 'EDK/Foundation/Library/CompilerStub')
-rw-r--r--EDK/Foundation/Library/CompilerStub/CompilerStub.cif12
-rw-r--r--EDK/Foundation/Library/CompilerStub/CompilerStub.mak79
-rw-r--r--EDK/Foundation/Library/CompilerStub/CompilerStub.sdl26
-rw-r--r--EDK/Foundation/Library/CompilerStub/CompilerStubLib.inf54
-rw-r--r--EDK/Foundation/Library/CompilerStub/memcpy.c46
-rw-r--r--EDK/Foundation/Library/CompilerStub/memset.c45
6 files changed, 262 insertions, 0 deletions
diff --git a/EDK/Foundation/Library/CompilerStub/CompilerStub.cif b/EDK/Foundation/Library/CompilerStub/CompilerStub.cif
new file mode 100644
index 0000000..bfd60e4
--- /dev/null
+++ b/EDK/Foundation/Library/CompilerStub/CompilerStub.cif
@@ -0,0 +1,12 @@
+<component>
+ name = "CompilerStub"
+ category = ModulePart
+ LocalRoot = "EDK\Foundation\Library\CompilerStub\"
+ RefName = "CompilerStub"
+[files]
+"CompilerStub.sdl"
+"CompilerStub.mak"
+"memcpy.c"
+"memset.c"
+"CompilerStubLib.inf"
+<endComponent>
diff --git a/EDK/Foundation/Library/CompilerStub/CompilerStub.mak b/EDK/Foundation/Library/CompilerStub/CompilerStub.mak
new file mode 100644
index 0000000..b738375
--- /dev/null
+++ b/EDK/Foundation/Library/CompilerStub/CompilerStub.mak
@@ -0,0 +1,79 @@
+#**********************************************************************
+#**********************************************************************
+#** **
+#** (C)Copyright 1985-2009, American Megatrends, Inc. **
+#** **
+#** All Rights Reserved. **
+#** **
+#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+#** **
+#** Phone: (770)-246-8600 **
+#** **
+#**********************************************************************
+#**********************************************************************
+
+#**********************************************************************
+# $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/IntelEDK/CompilerStub/CompilerStub.mak 1 1/20/12 3:59a Jeffch $
+#
+# $Revision: 1 $
+#
+# $Date: 1/20/12 3:59a $
+#**********************************************************************
+# Revision History
+# ----------------
+# $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/IntelEDK/CompilerStub/CompilerStub.mak $
+#
+# 1 1/20/12 3:59a Jeffch
+#
+# 1 9/27/11 6:22a Wesleychen
+# Intel EDK initially releases.
+#
+# 3 11/06/09 4:27a Iminglin
+# Edk-Dev-Snapshot-20090928
+#
+# 2 9/02/09 3:24a Iminglin
+# EIP24919
+#
+#**********************************************************************
+#<AMI_FHDR_START>
+#
+# Name: CompilerStub.mak
+#
+# Description:
+#
+#<AMI_FHDR_END>
+#**********************************************************************
+
+$(COMPILERSTUB) : CompilerStub
+
+CompilerStub : $(BUILD_DIR)\CompilerStub.mak CompilerStubBin
+
+$(BUILD_DIR)\CompilerStub.mak : $(CompilerStub_DIR)\$(@B).cif $(CompilerStub_DIR)\$(@B).mak $(BUILD_RULES)
+ $(CIF2MAK) $(CompilerStub_DIR)\$(@B).cif $(CIF2MAK_DEFAULTS)
+
+CompilerStubBin :
+!IF "$(PROCESSOR)"=="x64"
+ $(MAKE) /$(MAKEFLAGS) $(EDK_DEFAULTS)\
+ /f $(BUILD_DIR)\CompilerStub.mak all\
+ TYPE=LIBRARY
+ $(MAKE) /$(MAKEFLAGS) $(EDK_DEFAULTS) BUILD_DIR=$(BUILD_DIR)\IA32\
+ /f $(BUILD_DIR)\CompilerStub.mak all\
+ TYPE=PEI_LIBRARY
+!ELSE
+ $(MAKE) /$(MAKEFLAGS) $(EDK_DEFAULTS)\
+ /f $(BUILD_DIR)\CompilerStub.mak all\
+ TYPE=LIBRARY
+!ENDIF
+#**********************************************************************
+#**********************************************************************
+#** **
+#** (C)Copyright 1985-2009, American Megatrends, Inc. **
+#** **
+#** All Rights Reserved. **
+#** **
+#** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 **
+#** **
+#** Phone: (770)-246-8600 **
+#** **
+#**********************************************************************
+#********************************************************************** \ No newline at end of file
diff --git a/EDK/Foundation/Library/CompilerStub/CompilerStub.sdl b/EDK/Foundation/Library/CompilerStub/CompilerStub.sdl
new file mode 100644
index 0000000..5cf7e65
--- /dev/null
+++ b/EDK/Foundation/Library/CompilerStub/CompilerStub.sdl
@@ -0,0 +1,26 @@
+TOKEN
+ Name = "CompilerStub_SUPPORT"
+ Value = "1"
+ Help = "Main switch to enable CompilerStub support in Project"
+ TokenType = Boolean
+ TargetEQU = Yes
+ TargetMAK = Yes
+ Master = Yes
+End
+
+TOKEN
+ Name = "COMPILERSTUB"
+ Value = "$$(LIB_BUILD_DIR)\CompilerStub.lib"
+ TokenType = Expression
+ TargetMAK = Yes
+End
+
+PATH
+ Name = "CompilerStub_DIR"
+End
+
+MODULE
+ Help = "Includes CompilerStub.mak to Project"
+ File = "CompilerStub.mak"
+End
+
diff --git a/EDK/Foundation/Library/CompilerStub/CompilerStubLib.inf b/EDK/Foundation/Library/CompilerStub/CompilerStubLib.inf
new file mode 100644
index 0000000..e6e6531
--- /dev/null
+++ b/EDK/Foundation/Library/CompilerStub/CompilerStubLib.inf
@@ -0,0 +1,54 @@
+#/*++
+#
+# 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:
+#
+# CompilerStubLib.inf
+#
+# Abstract:
+#
+# Component description file for the CompilerStub.
+#
+#--*/
+
+[defines]
+BASE_NAME = CompilerStub
+COMPONENT_TYPE = LIBRARY
+
+[sources.common]
+ memcpy.c
+ memset.c
+
+[includes.common]
+ $(EDK_SOURCE)\Foundation
+ $(EDK_SOURCE)\Foundation\Framework
+ $(EDK_SOURCE)\Foundation\Efi
+ $(EDK_SOURCE)\Foundation\Include
+ $(EDK_SOURCE)\Foundation\Efi\Include
+ $(EDK_SOURCE)\Foundation\Framework\Include
+ $(EDK_SOURCE)\Foundation\Include\IndustryStandard
+ $(EDK_SOURCE)
+ $(EDK_SOURCE)\Foundation\Core\Dxe
+ $(EDK_SOURCE)\Foundation\Library\Dxe\Include
+ $(EDK_SOURCE)\Foundation\Include\Pei
+ $(EDK_SOURCE)\Foundation\Library\Pei\Include
+ $(EDK_SOURCE)\Foundation\Core\Pei\Include
+ $(EDK_SOURCE)\Foundation\Framework\Ppi\CpuIo
+ $(EDK_SOURCE)\Foundation\Framework
+
+[libraries.common]
+
+[nmake.common]
+ C_FLAGS = $(C_FLAGS) /Oi- /GL-
+ C_STD_INCLUDE=
+
+[nmake.ia32,nmake.x64]
+ C_STD_INCLUDE= $(C_STD_INCLUDE) /GL-
diff --git a/EDK/Foundation/Library/CompilerStub/memcpy.c b/EDK/Foundation/Library/CompilerStub/memcpy.c
new file mode 100644
index 0000000..91616c9
--- /dev/null
+++ b/EDK/Foundation/Library/CompilerStub/memcpy.c
@@ -0,0 +1,46 @@
+/*++
+
+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:
+ memcpy.c
+
+Abstract:
+
+ The Microsoft compiler inlines memcpy and we can not stop it.
+ These routines allow the code to link!
+
+ There is no *.h definition of these modules as they are well known by the
+ compiler. See Microsoft documentation for more details!
+
+ volatile is used to prevent the compiler from trying to implement these
+ C functions as inline functions.
+
+--*/
+
+#include "Tiano.h"
+
+VOID *
+memcpy (
+ OUT VOID *Dest,
+ IN const VOID *Src,
+ IN UINTN Count
+ )
+{
+ volatile UINT8 *Ptr;
+ const UINT8 *Source;
+
+ for (Ptr = Dest, Source = Src; Count > 0; Count--, Source++, Ptr++) {
+ *Ptr = *Source;
+ }
+
+ return Dest;
+}
+
diff --git a/EDK/Foundation/Library/CompilerStub/memset.c b/EDK/Foundation/Library/CompilerStub/memset.c
new file mode 100644
index 0000000..0661335
--- /dev/null
+++ b/EDK/Foundation/Library/CompilerStub/memset.c
@@ -0,0 +1,45 @@
+/*++
+
+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:
+ memset.c
+
+Abstract:
+
+ The Microsoft compiler inlines memset and we can not stop it.
+ These routines allow the code to link!
+
+ There is no *.h definition of these modules as they are well known by the
+ compiler. See Microsoft documentation for more details!
+
+ volatile is used to prevent the compiler from trying to implement these
+ C functions as inline functions.
+
+--*/
+
+#include "Tiano.h"
+
+VOID *
+memset (
+ OUT VOID *Dest,
+ IN UINTN Char,
+ IN UINTN Count
+ )
+{
+ volatile UINT8 *Ptr;
+
+ for (Ptr = Dest; Count > 0; Count--, Ptr++) {
+ *Ptr = (UINT8) Char;
+ }
+
+ return Dest;
+}
+