Revision: 14615
          http://sourceforge.net/p/edk2/code/14615
Author:   oliviermartin
Date:     2013-09-02 09:02:16 +0000 (Mon, 02 Sep 2013)
Log Message:
-----------
Add Memory fence for ARM Architecture (32 and 64 bit)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <[email protected]>
Reviewed-by: Liming Gao <[email protected]>

Modified Paths:
--------------
    trunk/edk2/MdePkg/Library/BaseLib/BaseLib.inf

Added Paths:
-----------
    trunk/edk2/MdePkg/Library/BaseLib/AArch64/MemoryFence.S
    trunk/edk2/MdePkg/Library/BaseLib/Arm/MemoryFence.S
    trunk/edk2/MdePkg/Library/BaseLib/Arm/MemoryFence.asm

Added: trunk/edk2/MdePkg/Library/BaseLib/AArch64/MemoryFence.S
===================================================================
--- trunk/edk2/MdePkg/Library/BaseLib/AArch64/MemoryFence.S                     
        (rev 0)
+++ trunk/edk2/MdePkg/Library/BaseLib/AArch64/MemoryFence.S     2013-09-02 
09:02:16 UTC (rev 14615)
@@ -0,0 +1,39 @@
+##------------------------------------------------------------------------------
+#
+# MemoryFence() for AArch64
+#
+# Copyright (c) 2013, ARM Ltd. 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.
+#
+##------------------------------------------------------------------------------
+
+.text
+.p2align 2
+
+GCC_ASM_EXPORT(MemoryFence)
+
+
+#/**
+#  Used to serialize load and store operations.
+#
+#  All loads and stores that proceed calls to this function are guaranteed to 
be
+#  globally visible when this function returns.
+#
+#**/
+#VOID
+#EFIAPI
+#MemoryFence (
+#  VOID
+#  );
+#
+ASM_PFX(MemoryFence):
+    // System wide Data Memory Barrier.
+    dmb sy
+    ret

Added: trunk/edk2/MdePkg/Library/BaseLib/Arm/MemoryFence.S
===================================================================
--- trunk/edk2/MdePkg/Library/BaseLib/Arm/MemoryFence.S                         
(rev 0)
+++ trunk/edk2/MdePkg/Library/BaseLib/Arm/MemoryFence.S 2013-09-02 09:02:16 UTC 
(rev 14615)
@@ -0,0 +1,39 @@
+##------------------------------------------------------------------------------
+#
+# MemoryFence() for AArch64
+#
+# Copyright (c) 2013, ARM Ltd. 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.
+#
+##------------------------------------------------------------------------------
+
+.text
+.p2align 2
+
+GCC_ASM_EXPORT(MemoryFence)
+
+
+#/**
+#  Used to serialize load and store operations.
+#
+#  All loads and stores that proceed calls to this function are guaranteed to 
be
+#  globally visible when this function returns.
+#
+#**/
+#VOID
+#EFIAPI
+#MemoryFence (
+#  VOID
+#  );
+#
+ASM_PFX(MemoryFence):
+    // System wide Data Memory Barrier.
+    dmb
+    bx   lr

Added: trunk/edk2/MdePkg/Library/BaseLib/Arm/MemoryFence.asm
===================================================================
--- trunk/edk2/MdePkg/Library/BaseLib/Arm/MemoryFence.asm                       
        (rev 0)
+++ trunk/edk2/MdePkg/Library/BaseLib/Arm/MemoryFence.asm       2013-09-02 
09:02:16 UTC (rev 14615)
@@ -0,0 +1,39 @@
+;------------------------------------------------------------------------------
+;
+; MemoryFence() for AArch64
+;
+; Copyright (c) 2013, ARM Ltd. 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.
+;
+;------------------------------------------------------------------------------
+
+    EXPORT MemoryFence
+
+    AREA MemoryBarriers, CODE, READONLY
+
+;/**
+;  Used to serialize load and store operations.
+;
+;  All loads and stores that proceed calls to this function are guaranteed to 
be
+;  globally visible when this function returns.
+;
+;**/
+;VOID
+;EFIAPI
+;MemoryFence (
+;  VOID
+;  );
+;
+MemoryFence FUNCTION
+    dmb
+    bx      lr
+    ENDFUNC
+
+    END

Modified: trunk/edk2/MdePkg/Library/BaseLib/BaseLib.inf
===================================================================
--- trunk/edk2/MdePkg/Library/BaseLib/BaseLib.inf       2013-09-02 02:21:40 UTC 
(rev 14614)
+++ trunk/edk2/MdePkg/Library/BaseLib/BaseLib.inf       2013-09-02 09:02:16 UTC 
(rev 14615)
@@ -468,6 +468,7 @@
   Arm/GetInterruptsState.asm | RVCT
   Arm/CpuPause.asm           | RVCT
   Arm/CpuBreakpoint.asm      | RVCT
+  Arm/MemoryFence.asm        | RVCT
  
   Arm/Math64.S                  | GCC
   Arm/SwitchStack.S             | GCC
@@ -476,12 +477,14 @@
   Arm/GetInterruptsState.S      | GCC
   Arm/SetJumpLongJump.S         | GCC
   Arm/CpuBreakpoint.S           | GCC
+  Arm/MemoryFence.S             | GCC
 
 [Sources.AARCH64]
   Arm/InternalSwitchStack.c
   Arm/Unaligned.c
   Math64.c
 
+  AArch64/MemoryFence.S             | GCC
   AArch64/SwitchStack.S             | GCC
   AArch64/EnableInterrupts.S        | GCC
   AArch64/DisableInterrupts.S       | GCC

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to