]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1) add in EfiCommonLib_Edk2.inf which will allow EfiCommonLib to build understand...
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 23 Aug 2008 06:48:07 +0000 (06:48 +0000)
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 23 Aug 2008 06:48:07 +0000 (06:48 +0000)
2) Add in 3 .asm files for ICC tool-chain.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5714 6f19259b-4bc3-4df7-8a09-765794883524

EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCommonLib_Edk2.inf [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMemRep1.asm [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMemRep4.asm [new file with mode: 0644]
EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMemRep4.asm [new file with mode: 0644]

diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCommonLib_Edk2.inf b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/EfiCommonLib_Edk2.inf
new file mode 100644 (file)
index 0000000..14e9e6b
--- /dev/null
@@ -0,0 +1,116 @@
+#/*++\r
+#\r
+#  Copyright (c) 2004 - 2007, Intel Corporation                                                         \r
+#  All rights reserved. This program and the accompanying materials                          \r
+#  are licensed and made available under the terms and conditions of the BSD License         \r
+#  which accompanies this distribution.  The full text of the license may be found at        \r
+#  http://opensource.org/licenses/bsd-license.php                                            \r
+#                                                                                            \r
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+#  \r
+#   Module Name:\r
+#\r
+#     EfiCommonLib.inf\r
+#\r
+#   Abstract:\r
+#\r
+#     Component description file for the EFI common library.\r
+#\r
+#--*/\r
+\r
+[defines]\r
+BASE_NAME       = EfiCommonLib\r
+COMPONENT_TYPE  = LIBRARY\r
+\r
+[sources.common]\r
+  EfiCompareGuid.c\r
+  EfiCompareMem.c\r
+  ReportStatusCode.c\r
+  PostCode.c\r
+  String.c\r
+  ValueToString.c\r
+  LinkedList.c\r
+\r
+[sources.ia32]\r
+  Ia32/EfiCopyMemRep1.c  | MSFT\r
+  Ia32/EfiSetMemRep4.c   | MSFT\r
+  Ia32/EfiZeroMemRep4.c  | MSFT\r
+#  Ia32/EfiCopyMem.c\r
+#  Ia32/EfiSetMem.c\r
+#  Ia32/EfiZeroMem.c\r
+  Ia32/LShiftU64.c       | MSFT\r
+  Ia32/RShiftU64.c       | MSFT\r
+  Ia32/MultU64x32.c      | MSFT\r
+  Ia32/DivU64x32.c       | MSFT\r
+  Ia32/Power10U64.c      | MSFT\r
+  Ia32/Log2.c            | MSFT\r
+  Ia32/GetPowerOfTwo.c   | MSFT\r
+\r
+  Ia32/EfiCopyMem.S      | GCC\r
+  Ia32/EfiSetMem.S       | GCC\r
+  Ia32/EfiZeroMem.S      | GCC\r
+  Ia32/LShiftU64.S       | GCC\r
+  Ia32/RShiftU64.S       | GCC\r
+  Ia32/MultU64x32.S      | GCC\r
+  Ia32/DivU64x32.S       | GCC\r
+  Ia32/Power10U64.S      | GCC\r
+  Ia32/Log2.S            | GCC\r
+  Ia32/GetPowerOfTwo.S   | GCC\r
+\r
+  Ia32/EfiCopyMemRep1.asm  | INTEL\r
+  Ia32/EfiSetMemRep4.asm   | INTEL\r
+  Ia32/EfiZeroMemRep4.asm  | INTEL\r
+#  Ia32/EfiCopyMem.asm      | INTEL\r
+#  Ia32/EfiSetMem.asm       | INTEL\r
+#  Ia32/EfiZeroMem.asm      | INTEL\r
+  Ia32/LShiftU64.asm       | INTEL\r
+  Ia32/RShiftU64.asm       | INTEL\r
+  Ia32/MultU64x32.asm      | INTEL\r
+  Ia32/DivU64x32.asm       | INTEL\r
+  Ia32/Power10U64.asm      | INTEL\r
+  Ia32/Log2.asm            | INTEL\r
+  Ia32/GetPowerOfTwo.asm   | INTEL\r
+\r
+[sources.ipf]\r
+  EfiCopyMem.c\r
+  EfiSetMem.c\r
+  EfiZeroMem.c\r
+  Math.c\r
+\r
+[sources.ebc]\r
+  EfiCopyMem.c\r
+  EfiSetMem.c\r
+  EfiZeroMem.c\r
+  Math.c\r
+  \r
+[sources.x64]\r
+  x64/EfiCopyMemRep1.asm\r
+  x64/EfiSetMemRep4.asm\r
+  x64/EfiZeroMemRep4.asm\r
+#  x64/EfiCopyMem.asm\r
+#  x64/EfiSetMem.asm\r
+#  x64/EfiZeroMem.asm\r
+  Math.c\r
+\r
+[includes.common]\r
+  $(EDK_SOURCE)/Foundation\r
+  $(EDK_SOURCE)/Foundation/Framework\r
+  $(EDK_SOURCE)/Foundation/Efi\r
+  $(EDK_SOURCE)/Foundation/Include\r
+  $(EDK_SOURCE)/Foundation/Efi/Include\r
+  $(EDK_SOURCE)/Foundation/Framework/Include\r
+  $(EDK_SOURCE)/Foundation/Include/IndustryStandard\r
+  $(EDK_SOURCE)\r
+  $(EDK_SOURCE)/Foundation/Core/Dxe\r
+  $(EDK_SOURCE)/Foundation/Library/Dxe/Include\r
+  $(EDK_SOURCE)/Foundation/Include/Pei\r
+  $(EDK_SOURCE)/Foundation/Library/Pei/Include\r
+  $(EDK_SOURCE)/Foundation/Framework/Ppi/CpuIo\r
+  $(EDK_SOURCE)/Foundation/Framework\r
+  \r
+[libraries.common]\r
+  EdkFrameworkGuidLib\r
+\r
+[nmake.common]\r
+\r
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMemRep1.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiCopyMemRep1.asm
new file mode 100644 (file)
index 0000000..5b21ec1
--- /dev/null
@@ -0,0 +1,86 @@
+;/*++\r
+;\r
+;Copyright (c) 2007, Intel Corporation                                                         \r
+;All rights reserved. This program and the accompanying materials                          \r
+;are licensed and made available under the terms and conditions of the BSD License         \r
+;which accompanies this distribution.  The full text of the license may be found at        \r
+;http://opensource.org/licenses/bsd-license.php                                            \r
+;                                                                                          \r
+;THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+;WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+;\r
+;Module Name:\r
+;\r
+;  EfiCopyMemRep1.asm\r
+;\r
+;Abstract:\r
+;\r
+;  This is the code that uses rep movsb CopyMem service\r
+;\r
+;--*/\r
+;\r
+;---------------------------------------------------------------------------\r
+    .686\r
+    .model  flat,C\r
+    .code\r
+\r
+;---------------------------------------------------------------------------\r
+;#include "Tiano.h"\r
+;\r
+;VOID\r
+;EfiCommonLibCopyMem (\r
+;  IN VOID   *Destination,\r
+;  IN VOID   *Source,\r
+;  IN UINTN  Count\r
+;  )\r
+;/*++\r
+;\r
+;Routine Description:\r
+;\r
+;  Copy Length bytes from Source to Destination.\r
+;\r
+;Arguments:\r
+;\r
+;  Destination - Target of copy\r
+;\r
+;  Source      - Place to copy from\r
+;\r
+;  Length      - Number of bytes to copy\r
+;\r
+;Returns:\r
+;\r
+;  None\r
+;\r
+;--*/\r
+EfiCommonLibCopyMem PROC\r
+    push    ebp\r
+    mov     ebp, esp\r
+    push    esi\r
+    push    edi\r
+    mov     esi, dword ptr[ebp + 0Ch]    ; esi <- Source\r
+    mov     edi, dword ptr[ebp + 8]      ; edi <- Destination\r
+    mov     edx, dword ptr[ebp + 10h]    ; edx <- Count\r
+    cmp     esi, edi\r
+    je      _CopyDone\r
+    cmp     edx, 0\r
+    je      _CopyDone\r
+    lea     eax, [esi + edx - 1]         ; eax <- End of Source\r
+    cmp     esi, edi\r
+    jae     _CopyBytes\r
+    cmp     eax, edi\r
+    jb      _CopyBytes                   ; Copy backward if overlapped\r
+    mov     esi, eax                     ; esi <- End of Source\r
+    lea     edi, [edi + edx - 1]         ; edi <- End of Destination\r
+    std\r
+_CopyBytes:\r
+    mov     ecx, edx\r
+    rep     movsb                        ; Copy bytes backward\r
+    cld\r
+_CopyDone:\r
+    pop     edi\r
+    pop     esi\r
+    pop     ebp\r
+    ret\r
+EfiCommonLibCopyMem ENDP\r
+       END\r
+\r
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMemRep4.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiSetMemRep4.asm
new file mode 100644 (file)
index 0000000..5e64214
--- /dev/null
@@ -0,0 +1,75 @@
+;/*++\r
+;\r
+;Copyright (c) 2007, Intel Corporation                                                         \r
+;All rights reserved. This program and the accompanying materials                          \r
+;are licensed and made available under the terms and conditions of the BSD License         \r
+;which accompanies this distribution.  The full text of the license may be found at        \r
+;http://opensource.org/licenses/bsd-license.php                                            \r
+;                                                                                          \r
+;THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+;WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+;\r
+;Module Name:\r
+;\r
+  ;EfiSetMemRep4.c\r
+;\r
+;Abstract:\r
+;\r
+  ;This is the code that uses rep stosd SetMem service\r
+;\r
+;--*/\r
+;\r
+;---------------------------------------------------------------------------\r
+    .686\r
+    .model  flat,C\r
+    .code\r
+\r
+;---------------------------------------------------------------------------\r
+;#include "Tiano.h"\r
+;\r
+;VOID\r
+;EfiCommonLibSetMem (\r
+  ;IN VOID   *Buffer,\r
+  ;IN UINTN  Count,\r
+  ;IN UINT8  Value\r
+  ;)\r
+;/*++\r
+;\r
+;Input:  VOID   *Buffer - Pointer to buffer to write\r
+        ;UINTN  Count   - Number of bytes to write\r
+        ;UINT8  Value   - Value to write\r
+;\r
+;Output: None.\r
+;\r
+;Saves:\r
+;\r
+;Modifies:\r
+;\r
+;Description:  This function uses rep stosd to set memory.\r
+;\r
+;--*/\r
+EfiCommonLibSetMem PROC\r
+    push        ebp\r
+    mov         ebp,esp\r
+    push        edi\r
+    mov         ecx,dword ptr [ebp+0Ch]\r
+    test        ecx, ecx\r
+    je          Exit\r
+    mov         al,byte ptr [ebp+10h]\r
+    mov         ah,  al\r
+    shrd        edx, eax, 16\r
+    shld        eax, edx, 16\r
+    mov         edx, ecx\r
+    mov         edi,dword ptr [ebp+8]\r
+    shr         ecx, 2\r
+    rep stosd\r
+    mov         ecx, edx\r
+    and         ecx, 3\r
+    rep stosb\r
+Exit:\r
+    pop         edi\r
+    pop         ebp\r
+    ret\r
+\r
+EfiCommonLibSetMem ENDP\r
+       END\r
diff --git a/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMemRep4.asm b/EdkCompatibilityPkg/Foundation/Library/EfiCommonLib/Ia32/EfiZeroMemRep4.asm
new file mode 100644 (file)
index 0000000..4817c10
--- /dev/null
@@ -0,0 +1,70 @@
+;/*++\r
+;\r
+;Copyright (c) 2007, Intel Corporation                                                         \r
+;All rights reserved. This program and the accompanying materials                          \r
+;are licensed and made available under the terms and conditions of the BSD License         \r
+;which accompanies this distribution.  The full text of the license may be found at        \r
+;http://opensource.org/licenses/bsd-license.php                                            \r
+;                                                                                          \r
+;THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+;WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+;\r
+;Module Name:\r
+;\r
+  ;EfiZeroMemRep4.asm\r
+;\r
+;Abstract:\r
+;\r
+  ;This is the code that uses rep stosd ZeroMem service\r
+;\r
+;--*/\r
+;\r
+;---------------------------------------------------------------------------\r
+    .686\r
+    .model  flat,C\r
+    .code\r
+\r
+;---------------------------------------------------------------------------\r
+;#include "Tiano.h"\r
+;\r
+;VOID\r
+;EfiCommonLibZeroMem (\r
+  ;IN VOID   *Buffer,\r
+  ;IN UINTN  Count\r
+  ;)\r
+;/*++\r
+;\r
+;Input:  VOID   *Buffer - Pointer to buffer to clear\r
+        ;UINTN  Count  - Number of bytes to clear\r
+;\r
+;Output: None.\r
+;\r
+;Saves:\r
+;\r
+;Modifies:\r
+;\r
+;Description:  This function uses rep stosd to zero memory.\r
+;\r
+;--*/\r
+EfiCommonLibZeroMem PROC\r
+    push        ebp\r
+    mov         ebp,esp\r
+    push        edi\r
+    mov         ecx,dword ptr [ebp+0Ch]\r
+    test        ecx, ecx\r
+    je          Exit\r
+    xor         eax, eax\r
+    mov         edi,dword ptr [ebp+8]\r
+    mov         edx, ecx\r
+    shr         ecx, 2\r
+    and         edx, 3\r
+    rep         stosd\r
+    mov         ecx, edx\r
+    rep         stosb\r
+Exit:\r
+    pop         edi\r
+    pop         ebp\r
+    ret\r
+\r
+EfiCommonLibZeroMem ENDP       \r
+       END\r