From 026c3d34ee83b4df623cc80761450a53e9f7622b Mon Sep 17 00:00:00 2001 From: andrewfish Date: Wed, 24 Feb 2010 22:38:46 +0000 Subject: Updated Hardware Interrupt protocol to add an EOI member. Added ARM Data/Instruction syncronization barrier support to the ARM lib. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10063 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPkg/Library/ArmLib/Arm11/Arm11Lib.c | 31 ++++++++++++++++++++++++++++ ArmPkg/Library/ArmLib/Arm11/Arm11Support.S | 20 ++++++++++++++++++ ArmPkg/Library/ArmLib/Arm11/Arm11Support.asm | 18 ++++++++++++++++ 3 files changed, 69 insertions(+) (limited to 'ArmPkg/Library/ArmLib/Arm11') diff --git a/ArmPkg/Library/ArmLib/Arm11/Arm11Lib.c b/ArmPkg/Library/ArmLib/Arm11/Arm11Lib.c index 3736904954..6f0f599d93 100644 --- a/ArmPkg/Library/ArmLib/Arm11/Arm11Lib.c +++ b/ArmPkg/Library/ArmLib/Arm11/Arm11Lib.c @@ -116,3 +116,34 @@ ArmConfigureMmu ( ArmEnableDataCache(); ArmEnableMmu(); } + + +VOID +EFIAPI +ArmDataMemoryBarrier ( + VOID + ) +{ + // Should move to assembly with the +} + +VOID +EFIAPI +ArmDataSyncronizationBarrier ( + VOID + ) +{ +// MOV R0, #0 +// MCR P15, #0, R0, C7, C10, #4} +} + + +VOID +EFIAPI +ArmInstructionSynchronizationBarrier ( + VOID + ) +{ +} + + diff --git a/ArmPkg/Library/ArmLib/Arm11/Arm11Support.S b/ArmPkg/Library/ArmLib/Arm11/Arm11Support.S index e3b7746317..6d178b107f 100644 --- a/ArmPkg/Library/ArmLib/Arm11/Arm11Support.S +++ b/ArmPkg/Library/ArmLib/Arm11/Arm11Support.S @@ -30,6 +30,10 @@ .globl ASM_PFX(ArmDisableInstructionCache) .globl ASM_PFX(ArmEnableBranchPrediction) .globl ASM_PFX(ArmDisableBranchPrediction) +.globl ASM_PFX(ArmDataMemoryBarrier) +.globl ASM_PFX(ArmDataSyncronizationBarrier) +.globl ASM_PFX(ArmInstructionSynchronizationBarrier) + .set DC_ON, (0x1<<2) .set IC_ON, (0x1<<12) @@ -132,4 +136,20 @@ ASM_PFX(ArmDisableBranchPrediction): mcr p15, 0, r0, c1, c0, 0 bx LR +ASM_PFX(ArmDataMemoryBarrier): + mov R0, #0 + mcr P15, #0, R0, C7, C10, #5 + bx LR + +ASM_PFX(ArmDataSyncronizationBarrier): + mov R0, #0 + mcr P15, #0, R0, C7, C10, #4 + bx LR + +ASM_PFX(ArmInstructionSynchronizationBarrier): + mov R0, #0 + mcr P15, #0, R0, C7, C5, #4 + bx LR + + ASM_FUNCTION_REMOVE_IF_UNREFERENCED diff --git a/ArmPkg/Library/ArmLib/Arm11/Arm11Support.asm b/ArmPkg/Library/ArmLib/Arm11/Arm11Support.asm index a2ed2e6f2a..546503b75c 100644 --- a/ArmPkg/Library/ArmLib/Arm11/Arm11Support.asm +++ b/ArmPkg/Library/ArmLib/Arm11/Arm11Support.asm @@ -28,6 +28,9 @@ EXPORT ArmDisableInstructionCache EXPORT ArmEnableBranchPrediction EXPORT ArmDisableBranchPrediction + EXPORT ArmDataMemoryBarrier + EXPORT ArmDataSyncronizationBarrier + EXPORT ArmInstructionSynchronizationBarrier DC_ON EQU ( 0x1:SHL:2 ) @@ -136,4 +139,19 @@ ArmDisableBranchPrediction mcr p15, 0, r0, c1, c0, 0 bx LR +ASM_PFX(ArmDataMemoryBarrier): + mov R0, #0 + mcr P15, #0, R0, C7, C10, #5 + bx LR + +ASM_PFX(ArmDataSyncronizationBarrier): + mov R0, #0 + mcr P15, #0, R0, C7, C10, #4 + bx LR + +ASM_PFX(ArmInstructionSynchronizationBarrier): + MOV R0, #0 + MCR P15, #0, R0, C7, C5, #4 + bx LR + END -- cgit v1.2.3