diff options
Diffstat (limited to 'ArmPkg/Library')
-rw-r--r-- | ArmPkg/Library/ArmLib/Arm11/Arm11Lib.c | 31 | ||||
-rw-r--r-- | ArmPkg/Library/ArmLib/Arm11/Arm11Support.S | 20 | ||||
-rw-r--r-- | ArmPkg/Library/ArmLib/Arm11/Arm11Support.asm | 18 | ||||
-rw-r--r-- | ArmPkg/Library/ArmLib/Arm9/Arm9Lib.c | 27 | ||||
-rw-r--r-- | ArmPkg/Library/ArmLib/ArmV7/ArmV7Support.S | 16 | ||||
-rw-r--r-- | ArmPkg/Library/ArmLib/ArmV7/ArmV7Support.asm | 17 |
6 files changed, 129 insertions, 0 deletions
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 diff --git a/ArmPkg/Library/ArmLib/Arm9/Arm9Lib.c b/ArmPkg/Library/ArmLib/Arm9/Arm9Lib.c index 0ba2237d29..63d6830c1b 100644 --- a/ArmPkg/Library/ArmLib/Arm9/Arm9Lib.c +++ b/ArmPkg/Library/ArmLib/Arm9/Arm9Lib.c @@ -116,3 +116,30 @@ ArmConfigureMmu ( ArmEnableDataCache(); ArmEnableMmu(); } + + +VOID +EFIAPI +ArmDataMemoryBarrier ( + VOID + ) +{ +} + +VOID +EFIAPI +ArmDataSyncronizationBarrier ( + VOID + ) +{ +} + +VOID +EFIAPI +ArmInstructionSynchronizationBarrier ( + VOID + ) +{ +} + + diff --git a/ArmPkg/Library/ArmLib/ArmV7/ArmV7Support.S b/ArmPkg/Library/ArmLib/ArmV7/ArmV7Support.S index 2cde8e2039..b4ec9b5122 100644 --- a/ArmPkg/Library/ArmLib/ArmV7/ArmV7Support.S +++ b/ArmPkg/Library/ArmLib/ArmV7/ArmV7Support.S @@ -34,6 +34,10 @@ .globl ASM_PFX(ArmEnableBranchPrediction) .globl ASM_PFX(ArmDisableBranchPrediction) .globl ASM_PFX(ArmV7AllDataCachesOperation) +.globl ASM_PFX(ArmDataMemoryBarrier) +.globl ASM_PFX(ArmDataSyncronizationBarrier) +.globl ASM_PFX(ArmInstructionSynchronizationBarrier) + .set DC_ON, (0x1<<2) .set IC_ON, (0x1<<12) @@ -222,5 +226,17 @@ L_Finished: ldmfd SP!, {r4-r12, lr} bx LR +ASM_PFX(ArmDataMemoryBarrier): + dmb + bx LR + +ASM_PFX(ArmDataSyncronizationBarrier): + dsb + bx LR + +ASM_PFX(ArmInstructionSynchronizationBarrier): + isb + bx LR + ASM_FUNCTION_REMOVE_IF_UNREFERENCED diff --git a/ArmPkg/Library/ArmLib/ArmV7/ArmV7Support.asm b/ArmPkg/Library/ArmLib/ArmV7/ArmV7Support.asm index d1cf8c1642..e2676d4995 100644 --- a/ArmPkg/Library/ArmLib/ArmV7/ArmV7Support.asm +++ b/ArmPkg/Library/ArmLib/ArmV7/ArmV7Support.asm @@ -30,6 +30,10 @@ EXPORT ArmEnableBranchPrediction EXPORT ArmDisableBranchPrediction EXPORT ArmV7AllDataCachesOperation + EXPORT ArmDataMemoryBarrier + EXPORT ArmDataSyncronizationBarrier + EXPORT ArmInstructionSynchronizationBarrier + DC_ON EQU ( 0x1:SHL:2 ) IC_ON EQU ( 0x1:SHL:12 ) @@ -217,4 +221,17 @@ Finished LDMFD SP!, {r4-r12, lr} BX LR + +ArmDataMemoryBarrier + DMB + BX LR + +ArmDataSyncronizationBarrier + DSB + BX LR + +ArmInstructionSynchronizationBarrier + ISB + BX LR + END |