Re: [edk2] [PATCH] ArmPkg/CpuDxe: drop ARMv4 exception handling code

2015-12-15 Thread Leif Lindholm
On Tue, Dec 15, 2015 at 10:47:56AM +0100, Ard Biesheuvel wrote:
> Since we do not support anything below ARMv7, let's promote the ARMv6
> exception handling code in CpuDxe to the only version we provide for
> ARM. This means we can drop the unused ARMv4 version.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel 

Thanks!
Reviewed-by: Leif Lindholm 

> ---
>  ArmPkg/Drivers/CpuDxe/{ArmV6 => Arm}/Exception.c  |   0
>  ArmPkg/Drivers/CpuDxe/{ArmV6 => Arm}/ExceptionSupport.S   |   0
>  ArmPkg/Drivers/CpuDxe/{ArmV6 => Arm}/ExceptionSupport.asm |   0
>  ArmPkg/Drivers/CpuDxe/{ArmV6 => Arm}/Mmu.c|   0
>  ArmPkg/Drivers/CpuDxe/ArmV4/ExceptionSupport.S| 191 
> 
>  ArmPkg/Drivers/CpuDxe/ArmV4/ExceptionSupport.asm  | 152 
> 
>  ArmPkg/Drivers/CpuDxe/CpuDxe.inf  |  18 +-
>  7 files changed, 4 insertions(+), 357 deletions(-)
> 
> diff --git a/ArmPkg/Drivers/CpuDxe/ArmV6/Exception.c 
> b/ArmPkg/Drivers/CpuDxe/Arm/Exception.c
> similarity index 100%
> rename from ArmPkg/Drivers/CpuDxe/ArmV6/Exception.c
> rename to ArmPkg/Drivers/CpuDxe/Arm/Exception.c
> diff --git a/ArmPkg/Drivers/CpuDxe/ArmV6/ExceptionSupport.S 
> b/ArmPkg/Drivers/CpuDxe/Arm/ExceptionSupport.S
> similarity index 100%
> rename from ArmPkg/Drivers/CpuDxe/ArmV6/ExceptionSupport.S
> rename to ArmPkg/Drivers/CpuDxe/Arm/ExceptionSupport.S
> diff --git a/ArmPkg/Drivers/CpuDxe/ArmV6/ExceptionSupport.asm 
> b/ArmPkg/Drivers/CpuDxe/Arm/ExceptionSupport.asm
> similarity index 100%
> rename from ArmPkg/Drivers/CpuDxe/ArmV6/ExceptionSupport.asm
> rename to ArmPkg/Drivers/CpuDxe/Arm/ExceptionSupport.asm
> diff --git a/ArmPkg/Drivers/CpuDxe/ArmV6/Mmu.c 
> b/ArmPkg/Drivers/CpuDxe/Arm/Mmu.c
> similarity index 100%
> rename from ArmPkg/Drivers/CpuDxe/ArmV6/Mmu.c
> rename to ArmPkg/Drivers/CpuDxe/Arm/Mmu.c
> diff --git a/ArmPkg/Drivers/CpuDxe/ArmV4/ExceptionSupport.S 
> b/ArmPkg/Drivers/CpuDxe/ArmV4/ExceptionSupport.S
> deleted file mode 100644
> index c82618aa1bc9..
> --- a/ArmPkg/Drivers/CpuDxe/ArmV4/ExceptionSupport.S
> +++ /dev/null
> @@ -1,191 +0,0 @@
> -#--
> -#
> -# Copyright (c) 2008 - 2010, Apple Inc. 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
> -.align 3
> -
> -GCC_ASM_EXPORT(ExceptionHandlersStart)
> -GCC_ASM_EXPORT(ExceptionHandlersEnd)
> -GCC_ASM_EXPORT(CommonExceptionEntry)
> -GCC_ASM_EXPORT(AsmCommonExceptionEntry)
> -GCC_ASM_EXPORT(CommonCExceptionHandler)
> -
> -ASM_PFX(ExceptionHandlersStart):
> -
> -ASM_PFX(Reset):
> -  b ASM_PFX(ResetEntry)
> -
> -ASM_PFX(UndefinedInstruction):
> -  b ASM_PFX(UndefinedInstructionEntry)
> -
> -ASM_PFX(SoftwareInterrupt):
> -  b ASM_PFX(SoftwareInterruptEntry)
> -
> -ASM_PFX(PrefetchAbort):
> -  b ASM_PFX(PrefetchAbortEntry)
> -
> -ASM_PFX(DataAbort):
> -  b ASM_PFX(DataAbortEntry)
> -
> -ASM_PFX(ReservedException):
> -  b ASM_PFX(ReservedExceptionEntry)
> -
> -ASM_PFX(Irq):
> -  b ASM_PFX(IrqEntry)
> -
> -ASM_PFX(Fiq):
> -  b ASM_PFX(FiqEntry)
> -
> -ASM_PFX(ResetEntry):
> -  srsdb #0x13!@ Store return state on SVC stack
> -  stmfd SP!,{LR}  @ Store the link register for the 
> current mode
> -  sub   SP,SP,#0x20   @ Save space for SP, LR, PC, IFAR - 
> CPSR
> -  stmfd SP!,{R0-R12}  @ Store the register state
> -
> -  mov   R0,#0
> -  ldr   R1,ASM_PFX(CommonExceptionEntry)
> -  bxR1
> -
> -ASM_PFX(UndefinedInstructionEntry):
> -  srsdb #0x13!@ Store return state on SVC stack
> -  cps   #0x13 @ Switch to SVC for common stack
> -  stmfd SP!,{LR}  @ Store the link register for the 
> current mode
> -  sub   SP,SP,#0x20   @ Save space for SP, LR, PC, IFAR - 
> CPSR
> -  stmfd SP!,{R0-R12}  @ Store the register state
> -
> -  mov   r0,#1
> -  ldr   r1,ASM_PFX(CommonExceptionEntry)
> -  bxr1
> -
> -ASM_PFX(SoftwareInterruptEntry):
> -  srsdb #0x13!@ Store return state on SVC stack
> -  stmfd SP!,{LR}  @ Store the link register for the 
> current mode
> -  sub   SP,SP,#0x20   @ Save space for SP, LR, PC, IFAR - 
> CPSR
> -  stmfd SP!,{R0-R12}  

Re: [edk2] [PATCH] ArmPkg/CpuDxe: drop ARMv4 exception handling code

2015-12-15 Thread Ard Biesheuvel
On 15 December 2015 at 10:51, Leif Lindholm  wrote:
> On Tue, Dec 15, 2015 at 10:47:56AM +0100, Ard Biesheuvel wrote:
>> Since we do not support anything below ARMv7, let's promote the ARMv6
>> exception handling code in CpuDxe to the only version we provide for
>> ARM. This means we can drop the unused ARMv4 version.
>>
>> Contributed-under: TianoCore Contribution Agreement 1.0
>> Signed-off-by: Ard Biesheuvel 
>
> Thanks!
> Reviewed-by: Leif Lindholm 
>

Committed as SVN r19273

>> ---
>>  ArmPkg/Drivers/CpuDxe/{ArmV6 => Arm}/Exception.c  |   0
>>  ArmPkg/Drivers/CpuDxe/{ArmV6 => Arm}/ExceptionSupport.S   |   0
>>  ArmPkg/Drivers/CpuDxe/{ArmV6 => Arm}/ExceptionSupport.asm |   0
>>  ArmPkg/Drivers/CpuDxe/{ArmV6 => Arm}/Mmu.c|   0
>>  ArmPkg/Drivers/CpuDxe/ArmV4/ExceptionSupport.S| 191 
>> 
>>  ArmPkg/Drivers/CpuDxe/ArmV4/ExceptionSupport.asm  | 152 
>> 
>>  ArmPkg/Drivers/CpuDxe/CpuDxe.inf  |  18 +-
>>  7 files changed, 4 insertions(+), 357 deletions(-)
>>
>> diff --git a/ArmPkg/Drivers/CpuDxe/ArmV6/Exception.c 
>> b/ArmPkg/Drivers/CpuDxe/Arm/Exception.c
>> similarity index 100%
>> rename from ArmPkg/Drivers/CpuDxe/ArmV6/Exception.c
>> rename to ArmPkg/Drivers/CpuDxe/Arm/Exception.c
>> diff --git a/ArmPkg/Drivers/CpuDxe/ArmV6/ExceptionSupport.S 
>> b/ArmPkg/Drivers/CpuDxe/Arm/ExceptionSupport.S
>> similarity index 100%
>> rename from ArmPkg/Drivers/CpuDxe/ArmV6/ExceptionSupport.S
>> rename to ArmPkg/Drivers/CpuDxe/Arm/ExceptionSupport.S
>> diff --git a/ArmPkg/Drivers/CpuDxe/ArmV6/ExceptionSupport.asm 
>> b/ArmPkg/Drivers/CpuDxe/Arm/ExceptionSupport.asm
>> similarity index 100%
>> rename from ArmPkg/Drivers/CpuDxe/ArmV6/ExceptionSupport.asm
>> rename to ArmPkg/Drivers/CpuDxe/Arm/ExceptionSupport.asm
>> diff --git a/ArmPkg/Drivers/CpuDxe/ArmV6/Mmu.c 
>> b/ArmPkg/Drivers/CpuDxe/Arm/Mmu.c
>> similarity index 100%
>> rename from ArmPkg/Drivers/CpuDxe/ArmV6/Mmu.c
>> rename to ArmPkg/Drivers/CpuDxe/Arm/Mmu.c
>> diff --git a/ArmPkg/Drivers/CpuDxe/ArmV4/ExceptionSupport.S 
>> b/ArmPkg/Drivers/CpuDxe/ArmV4/ExceptionSupport.S
>> deleted file mode 100644
>> index c82618aa1bc9..
>> --- a/ArmPkg/Drivers/CpuDxe/ArmV4/ExceptionSupport.S
>> +++ /dev/null
>> @@ -1,191 +0,0 @@
>> -#--
>> -#
>> -# Copyright (c) 2008 - 2010, Apple Inc. 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
>> -.align 3
>> -
>> -GCC_ASM_EXPORT(ExceptionHandlersStart)
>> -GCC_ASM_EXPORT(ExceptionHandlersEnd)
>> -GCC_ASM_EXPORT(CommonExceptionEntry)
>> -GCC_ASM_EXPORT(AsmCommonExceptionEntry)
>> -GCC_ASM_EXPORT(CommonCExceptionHandler)
>> -
>> -ASM_PFX(ExceptionHandlersStart):
>> -
>> -ASM_PFX(Reset):
>> -  b ASM_PFX(ResetEntry)
>> -
>> -ASM_PFX(UndefinedInstruction):
>> -  b ASM_PFX(UndefinedInstructionEntry)
>> -
>> -ASM_PFX(SoftwareInterrupt):
>> -  b ASM_PFX(SoftwareInterruptEntry)
>> -
>> -ASM_PFX(PrefetchAbort):
>> -  b ASM_PFX(PrefetchAbortEntry)
>> -
>> -ASM_PFX(DataAbort):
>> -  b ASM_PFX(DataAbortEntry)
>> -
>> -ASM_PFX(ReservedException):
>> -  b ASM_PFX(ReservedExceptionEntry)
>> -
>> -ASM_PFX(Irq):
>> -  b ASM_PFX(IrqEntry)
>> -
>> -ASM_PFX(Fiq):
>> -  b ASM_PFX(FiqEntry)
>> -
>> -ASM_PFX(ResetEntry):
>> -  srsdb #0x13!@ Store return state on SVC stack
>> -  stmfd SP!,{LR}  @ Store the link register for the 
>> current mode
>> -  sub   SP,SP,#0x20   @ Save space for SP, LR, PC, IFAR - 
>> CPSR
>> -  stmfd SP!,{R0-R12}  @ Store the register state
>> -
>> -  mov   R0,#0
>> -  ldr   R1,ASM_PFX(CommonExceptionEntry)
>> -  bxR1
>> -
>> -ASM_PFX(UndefinedInstructionEntry):
>> -  srsdb #0x13!@ Store return state on SVC stack
>> -  cps   #0x13 @ Switch to SVC for common stack
>> -  stmfd SP!,{LR}  @ Store the link register for the 
>> current mode
>> -  sub   SP,SP,#0x20   @ Save space for SP, LR, PC, IFAR - 
>> CPSR
>> -  stmfd SP!,{R0-R12}  @ Store the register state
>> -
>> -  mov   r0,#1
>> -  ldr   r1,ASM_PFX(CommonExceptionEntry)
>> -  bxr1
>> -
>> -ASM_PFX(SoftwareInterruptEntry):
>> -  srsdb #0x13!@ Store return 

[edk2] [PATCH] ArmPkg/CpuDxe: drop ARMv4 exception handling code

2015-12-15 Thread Ard Biesheuvel
Since we do not support anything below ARMv7, let's promote the ARMv6
exception handling code in CpuDxe to the only version we provide for
ARM. This means we can drop the unused ARMv4 version.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel 
---
 ArmPkg/Drivers/CpuDxe/{ArmV6 => Arm}/Exception.c  |   0
 ArmPkg/Drivers/CpuDxe/{ArmV6 => Arm}/ExceptionSupport.S   |   0
 ArmPkg/Drivers/CpuDxe/{ArmV6 => Arm}/ExceptionSupport.asm |   0
 ArmPkg/Drivers/CpuDxe/{ArmV6 => Arm}/Mmu.c|   0
 ArmPkg/Drivers/CpuDxe/ArmV4/ExceptionSupport.S| 191 

 ArmPkg/Drivers/CpuDxe/ArmV4/ExceptionSupport.asm  | 152 

 ArmPkg/Drivers/CpuDxe/CpuDxe.inf  |  18 +-
 7 files changed, 4 insertions(+), 357 deletions(-)

diff --git a/ArmPkg/Drivers/CpuDxe/ArmV6/Exception.c 
b/ArmPkg/Drivers/CpuDxe/Arm/Exception.c
similarity index 100%
rename from ArmPkg/Drivers/CpuDxe/ArmV6/Exception.c
rename to ArmPkg/Drivers/CpuDxe/Arm/Exception.c
diff --git a/ArmPkg/Drivers/CpuDxe/ArmV6/ExceptionSupport.S 
b/ArmPkg/Drivers/CpuDxe/Arm/ExceptionSupport.S
similarity index 100%
rename from ArmPkg/Drivers/CpuDxe/ArmV6/ExceptionSupport.S
rename to ArmPkg/Drivers/CpuDxe/Arm/ExceptionSupport.S
diff --git a/ArmPkg/Drivers/CpuDxe/ArmV6/ExceptionSupport.asm 
b/ArmPkg/Drivers/CpuDxe/Arm/ExceptionSupport.asm
similarity index 100%
rename from ArmPkg/Drivers/CpuDxe/ArmV6/ExceptionSupport.asm
rename to ArmPkg/Drivers/CpuDxe/Arm/ExceptionSupport.asm
diff --git a/ArmPkg/Drivers/CpuDxe/ArmV6/Mmu.c b/ArmPkg/Drivers/CpuDxe/Arm/Mmu.c
similarity index 100%
rename from ArmPkg/Drivers/CpuDxe/ArmV6/Mmu.c
rename to ArmPkg/Drivers/CpuDxe/Arm/Mmu.c
diff --git a/ArmPkg/Drivers/CpuDxe/ArmV4/ExceptionSupport.S 
b/ArmPkg/Drivers/CpuDxe/ArmV4/ExceptionSupport.S
deleted file mode 100644
index c82618aa1bc9..
--- a/ArmPkg/Drivers/CpuDxe/ArmV4/ExceptionSupport.S
+++ /dev/null
@@ -1,191 +0,0 @@
-#--
-#
-# Copyright (c) 2008 - 2010, Apple Inc. 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
-.align 3
-
-GCC_ASM_EXPORT(ExceptionHandlersStart)
-GCC_ASM_EXPORT(ExceptionHandlersEnd)
-GCC_ASM_EXPORT(CommonExceptionEntry)
-GCC_ASM_EXPORT(AsmCommonExceptionEntry)
-GCC_ASM_EXPORT(CommonCExceptionHandler)
-
-ASM_PFX(ExceptionHandlersStart):
-
-ASM_PFX(Reset):
-  b ASM_PFX(ResetEntry)
-
-ASM_PFX(UndefinedInstruction):
-  b ASM_PFX(UndefinedInstructionEntry)
-
-ASM_PFX(SoftwareInterrupt):
-  b ASM_PFX(SoftwareInterruptEntry)
-
-ASM_PFX(PrefetchAbort):
-  b ASM_PFX(PrefetchAbortEntry)
-
-ASM_PFX(DataAbort):
-  b ASM_PFX(DataAbortEntry)
-
-ASM_PFX(ReservedException):
-  b ASM_PFX(ReservedExceptionEntry)
-
-ASM_PFX(Irq):
-  b ASM_PFX(IrqEntry)
-
-ASM_PFX(Fiq):
-  b ASM_PFX(FiqEntry)
-
-ASM_PFX(ResetEntry):
-  srsdb #0x13!@ Store return state on SVC stack
-  stmfd SP!,{LR}  @ Store the link register for the 
current mode
-  sub   SP,SP,#0x20   @ Save space for SP, LR, PC, IFAR - CPSR
-  stmfd SP!,{R0-R12}  @ Store the register state
-
-  mov   R0,#0
-  ldr   R1,ASM_PFX(CommonExceptionEntry)
-  bxR1
-
-ASM_PFX(UndefinedInstructionEntry):
-  srsdb #0x13!@ Store return state on SVC stack
-  cps   #0x13 @ Switch to SVC for common stack
-  stmfd SP!,{LR}  @ Store the link register for the 
current mode
-  sub   SP,SP,#0x20   @ Save space for SP, LR, PC, IFAR - CPSR
-  stmfd SP!,{R0-R12}  @ Store the register state
-
-  mov   r0,#1
-  ldr   r1,ASM_PFX(CommonExceptionEntry)
-  bxr1
-
-ASM_PFX(SoftwareInterruptEntry):
-  srsdb #0x13!@ Store return state on SVC stack
-  stmfd SP!,{LR}  @ Store the link register for the 
current mode
-  sub   SP,SP,#0x20   @ Save space for SP, LR, PC, IFAR - CPSR
-  stmfd SP!,{R0-R12}  @ Store the register state
-
-  mov   r0,#2
-  ldr   r1,ASM_PFX(CommonExceptionEntry)
-  bxr1
-
-ASM_PFX(PrefetchAbortEntry):
-  sub   LR,LR,#4
-  srsdb #0x13!@ Store return state on SVC stack
-  cps   #0x13 @ Switch to SVC for common stack
-  stmfd SP!,{LR}  @ Store the link register for the 
current