The SetPrimaryStack and InitializePrimaryStack macros are no longer
used now that we removed support for ArmPlatformGlobalVariableLib.
So remove the various versions of them.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheu...@linaro.org>
---
 ArmPkg/Include/AsmMacroIoLib.h   | 36 -------------------
 ArmPkg/Include/AsmMacroIoLib.inc | 38 --------------------
 ArmPkg/Include/AsmMacroIoLibV8.h | 35 ------------------
 3 files changed, 109 deletions(-)

diff --git a/ArmPkg/Include/AsmMacroIoLib.h b/ArmPkg/Include/AsmMacroIoLib.h
index 6904bdc9b001..f94dcc619f7a 100644
--- a/ArmPkg/Include/AsmMacroIoLib.h
+++ b/ArmPkg/Include/AsmMacroIoLib.h
@@ -201,37 +201,6 @@ _InitializePrimaryStackEnd:
 #define LoadConstantToReg(Data, Reg) \
   ldr  Reg, =Data
 
-#define SetPrimaryStack(StackTop, GlobalSize, Tmp)  \
-  and     Tmp, GlobalSize, #7         ;             \
-  rsbne   Tmp, Tmp, #8                ;             \
-  add     GlobalSize, GlobalSize, Tmp ;             \
-  sub     sp, StackTop, GlobalSize    ;             \
-                                      ;             \
-  mov     Tmp, sp                     ;             \
-  mov     GlobalSize, #0x0            ;             \
-_SetPrimaryStackInitGlobals:          ;             \
-  cmp     Tmp, StackTop               ;             \
-  beq     _SetPrimaryStackEnd         ;             \
-  str     GlobalSize, [Tmp], #4       ;             \
-  b       _SetPrimaryStackInitGlobals ;             \
-_SetPrimaryStackEnd:
-
-// Initialize the Global Variable with '0'
-#define InitializePrimaryStack(GlobalSize, Tmp1)    \
-  and     Tmp1, GlobalSize, #7        ;             \
-  rsbne   Tmp1, Tmp1, #8              ;             \
-  add     GlobalSize, GlobalSize, Tmp1 ;            \
-                                      ;             \
-  mov     Tmp1, sp                    ;             \
-  sub     sp, GlobalSize              ;             \
-  mov     GlobalSize, #0x0            ;             \
-_InitializePrimaryStackLoop:          ;             \
-  cmp     Tmp1, sp                    ;             \
-  bls     _InitializePrimaryStackEnd  ;             \
-  str     GlobalSize, [Tmp1, #-4]!    ;             \
-  b       _InitializePrimaryStackLoop ;             \
-_InitializePrimaryStackEnd:
-
 #else
 
 //
@@ -293,11 +262,6 @@ _InitializePrimaryStackEnd:
 // conditional load testing eq flag
 #define LoadConstantToRegIfEq(Data, Reg)  LoadConstantToRegIfEqMacro Data, Reg
 
-#define SetPrimaryStack(StackTop,GlobalSize,Tmp) SetPrimaryStack StackTop, 
GlobalSize, Tmp
-
-// Initialize the Global Variable with '0'
-#define InitializePrimaryStack(GlobalSize, Tmp1) InitializePrimaryStack 
GlobalSize, Tmp1
-
 #endif
 
 #endif
diff --git a/ArmPkg/Include/AsmMacroIoLib.inc b/ArmPkg/Include/AsmMacroIoLib.inc
index 301bd890ac4d..95dc640d6fc3 100644
--- a/ArmPkg/Include/AsmMacroIoLib.inc
+++ b/ArmPkg/Include/AsmMacroIoLib.inc
@@ -80,42 +80,4 @@
   ldr  $Reg, =($Data)
   MEND
 
-  ; The reserved place must be 8-bytes aligned for pushing 64-bit variable on 
the stack
-  ; Note: Global Size will be modified
-  MACRO
-  SetPrimaryStack $StackTop, $GlobalSize, $Tmp
-  and     $Tmp, $GlobalSize, #7
-  rsbne   $Tmp, $Tmp, #8
-  add     $GlobalSize, $GlobalSize, $Tmp
-  sub     sp, $StackTop, $GlobalSize
-
-  ; Set all the global variables to 0
-  mov     $Tmp, sp
-  mov     $GlobalSize, #0x0
-_SetPrimaryStackInitGlobals
-  cmp     $Tmp, $StackTop
-  beq     _SetPrimaryStackEnd
-  str     $GlobalSize, [$Tmp], #4
-  b       _SetPrimaryStackInitGlobals
-_SetPrimaryStackEnd
-  MEND
-
-  MACRO
-  InitializePrimaryStack $GlobalSize, $Tmp1
-  and     $Tmp1, $GlobalSize, #7
-  rsbne   $Tmp1, $Tmp1, #8
-  add     $GlobalSize, $GlobalSize, $Tmp1
-
-  mov     $Tmp1, sp
-  sub     sp, $GlobalSize
-  ; Set all the global variables to 0
-  mov     $GlobalSize, #0x0
-_InitializePrimaryStackLoop
-  cmp     $Tmp1, sp
-  bls     _InitializePrimaryStackEnd
-  str     $GlobalSize, [$Tmp1, #-4]!
-  b       _InitializePrimaryStackLoop
-_InitializePrimaryStackEnd
-  MEND
-
   END
diff --git a/ArmPkg/Include/AsmMacroIoLibV8.h b/ArmPkg/Include/AsmMacroIoLibV8.h
index 2ee1081632ba..a9f8491bc922 100644
--- a/ArmPkg/Include/AsmMacroIoLibV8.h
+++ b/ArmPkg/Include/AsmMacroIoLibV8.h
@@ -18,41 +18,6 @@
 #ifndef __MACRO_IO_LIBV8_H__
 #define __MACRO_IO_LIBV8_H__
 
-#define SetPrimaryStack(StackTop, GlobalSize, Tmp, Tmp1)  \
-  ands    Tmp, GlobalSize, #15        ;                   \
-  mov     Tmp1, #16                   ;                   \
-  sub     Tmp1, Tmp1, Tmp             ;                   \
-  csel    Tmp, Tmp1, Tmp, ne          ;                   \
-  add     GlobalSize, GlobalSize, Tmp ;                   \
-  sub     sp, StackTop, GlobalSize    ;                   \
-                                      ;                   \
-  mov     Tmp, sp                     ;                   \
-  mov     GlobalSize, #0x0            ;                   \
-_SetPrimaryStackInitGlobals:          ;                   \
-  cmp     Tmp, StackTop               ;                   \
-  b.eq    _SetPrimaryStackEnd         ;                   \
-  str     GlobalSize, [Tmp], #8       ;                   \
-  b       _SetPrimaryStackInitGlobals ;                   \
-_SetPrimaryStackEnd:
-
-// Initialize the Global Variable with '0'
-#define InitializePrimaryStack(GlobalSize, Tmp1, Tmp2) \
-  and     Tmp1, GlobalSize, #15       ;             \
-  mov     Tmp2, #16                   ;             \
-  sub     Tmp2, Tmp2, Tmp1            ;             \
-  add     GlobalSize, GlobalSize, Tmp2 ;            \
-                                      ;             \
-  mov     Tmp1, sp                    ;             \
-  sub     sp, sp, GlobalSize          ;             \
-  mov     GlobalSize, #0x0            ;             \
-_InitializePrimaryStackLoop:          ;             \
-  mov     Tmp2, sp                    ;             \
-  cmp     Tmp1, Tmp2                  ;             \
-  bls     _InitializePrimaryStackEnd  ;             \
-  str     GlobalSize, [Tmp1, #-8]!    ;             \
-  b       _InitializePrimaryStackLoop ;             \
-_InitializePrimaryStackEnd:
-
 // CurrentEL : 0xC = EL3; 8 = EL2; 4 = EL1
 // This only selects between EL1 and EL2, else we die.
 // Provide the Macro with a safe temp xreg to use.
-- 
1.9.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to