public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Leif Lindholm <leif.lindholm@linaro.org>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: edk2-devel@lists.01.org, jbrasen@codeaurora.org,
	feng.tian@intel.com, star.zeng@intel.com, daniil.egranov@arm.com
Subject: Re: [PATCH v3 1/4] MdeModulePkg/EbcDxe AARCH64: clean up comment style in ASM file
Date: Fri, 26 Aug 2016 12:06:10 +0100	[thread overview]
Message-ID: <20160826110610.GD4715@bivouac.eciton.net> (raw)
In-Reply-To: <1471445945-19239-2-git-send-email-ard.biesheuvel@linaro.org>

On Wed, Aug 17, 2016 at 04:59:02PM +0200, Ard Biesheuvel wrote:
> Change to consistent // style comments. Also, remove bogus global
> definitions for external functions, and move the real exports to
> the top of the file.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  MdeModulePkg/Universal/EbcDxe/AArch64/EbcLowLevel.S | 111 +++++++++-----------
>  1 file changed, 52 insertions(+), 59 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/EbcDxe/AArch64/EbcLowLevel.S b/MdeModulePkg/Universal/EbcDxe/AArch64/EbcLowLevel.S
> index e858227586a8..a9678432d549 100644
> --- a/MdeModulePkg/Universal/EbcDxe/AArch64/EbcLowLevel.S
> +++ b/MdeModulePkg/Universal/EbcDxe/AArch64/EbcLowLevel.S
> @@ -1,40 +1,35 @@
> -#/** @file
> -#
> -#    This code provides low level routines that support the Virtual Machine
> -#   for option ROMs.
> -#
> -#  Copyright (c) 2015, The Linux Foundation. All rights reserved.
> -#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
> -#  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.
> -#
> -#**/
> -
> -#---------------------------------------------------------------------------
> -# Equate files needed.
> -#---------------------------------------------------------------------------
> -
> -ASM_GLOBAL ASM_PFX(CopyMem);
> -ASM_GLOBAL ASM_PFX(EbcInterpret);
> -ASM_GLOBAL ASM_PFX(ExecuteEbcImageEntryPoint);
> -
> -#****************************************************************************
> -# EbcLLCALLEX
> -#
> -# This function is called to execute an EBC CALLEX instruction.
> -# This instruction requires that we thunk out to external native
> -# code. For AArch64, we copy the VM stack into the main stack and then pop
> -# the first 8 arguments off according to the AArch64 Procedure Call Standard
> -# On return, we restore the stack pointer to its original location.
> -#
> -#****************************************************************************
> -# UINTN EbcLLCALLEXNative(UINTN FuncAddr, UINTN NewStackPointer, VOID *FramePtr)
> -ASM_GLOBAL ASM_PFX(EbcLLCALLEXNative);
> +///** @file
> +//
> +//  This code provides low level routines that support the Virtual Machine
> +//  for option ROMs.
> +//
> +//  Copyright (c) 2015, The Linux Foundation. All rights reserved.
> +//  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
> +//  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.
> +//
> +//**/
> +
> +ASM_GLOBAL ASM_PFX(EbcLLCALLEXNative)
> +ASM_GLOBAL ASM_PFX(EbcLLEbcInterpret)
> +ASM_GLOBAL ASM_PFX(EbcLLExecuteEbcImageEntryPoint)
> +
> +//****************************************************************************
> +// EbcLLCALLEX
> +//
> +// This function is called to execute an EBC CALLEX instruction.
> +// This instruction requires that we thunk out to external native
> +// code. For AArch64, we copy the VM stack into the main stack and then pop
> +// the first 8 arguments off according to the AArch64 Procedure Call Standard
> +// On return, we restore the stack pointer to its original location.
> +//
> +//****************************************************************************
> +// UINTN EbcLLCALLEXNative(UINTN FuncAddr, UINTN NewStackPointer, VOID *FramePtr)
>  ASM_PFX(EbcLLCALLEXNative):
>        stp  x19, x20, [sp, #-16]!
>        stp  x29, x30, [sp, #-16]!
> @@ -61,16 +56,15 @@ ASM_PFX(EbcLLCALLEXNative):
>  
>        ret
>  
> -#****************************************************************************
> -# EbcLLEbcInterpret
> -#
> -# This function is called by the thunk code to handle an Native to EBC call
> -# This can handle up to 16 arguments (1-8 on in x0-x7, 9-16 are on the stack)
> -# x9 contains the Entry point that will be the first argument when
> -# EBCInterpret is called.
> -#
> -#****************************************************************************
> -ASM_GLOBAL ASM_PFX(EbcLLEbcInterpret);
> +//****************************************************************************
> +// EbcLLEbcInterpret
> +//
> +// This function is called by the thunk code to handle an Native to EBC call
> +// This can handle up to 16 arguments (1-8 on in x0-x7, 9-16 are on the stack)
> +// x9 contains the Entry point that will be the first argument when
> +// EBCInterpret is called.
> +//
> +//****************************************************************************
>  ASM_PFX(EbcLLEbcInterpret):
>      stp  x29, x30, [sp, #-16]!
>  
> @@ -105,7 +99,7 @@ ASM_PFX(EbcLLEbcInterpret):
>      mov x1, x0
>      mov x0, x9
>  
> -    # call C-code
> +    // call C-code
>      bl ASM_PFX(EbcInterpret)
>      add sp, sp, #80
>  
> @@ -113,23 +107,22 @@ ASM_PFX(EbcLLEbcInterpret):
>  
>      ret
>  
> -#****************************************************************************
> -# EbcLLExecuteEbcImageEntryPoint
> -#
> -# This function is called by the thunk code to handle the image entry point
> -# x9 contains the Entry point that will be the first argument when
> -# ExecuteEbcImageEntryPoint is called.
> -#
> -#****************************************************************************
> -ASM_GLOBAL ASM_PFX(EbcLLExecuteEbcImageEntryPoint);
> +//****************************************************************************
> +// EbcLLExecuteEbcImageEntryPoint
> +//
> +// This function is called by the thunk code to handle the image entry point
> +// x9 contains the Entry point that will be the first argument when
> +// ExecuteEbcImageEntryPoint is called.
> +//
> +//****************************************************************************
>  ASM_PFX(EbcLLExecuteEbcImageEntryPoint):
>      stp  x29, x30, [sp, #-16]!
> -    # build new paramater calling convention
> +    // build new paramater calling convention

Fix typo while you're at it (paramater -> parameter)?
With that:
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

>      mov  x2, x1
>      mov  x1, x0
>      mov  x0, x9
>  
> -    # call C-code
> +    // call C-code
>      bl ASM_PFX(ExecuteEbcImageEntryPoint)
>      ldp  x29, x30, [sp], #16
>      ret
> -- 
> 2.7.4
> 


  reply	other threads:[~2016-08-26 11:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-17 14:59 [PATCH v3 0/4] MdeModulePkg/EbcDxe: AARCH64 improvements Ard Biesheuvel
2016-08-17 14:59 ` [PATCH v3 1/4] MdeModulePkg/EbcDxe AARCH64: clean up comment style in ASM file Ard Biesheuvel
2016-08-26 11:06   ` Leif Lindholm [this message]
2016-08-17 14:59 ` [PATCH v3 2/4] MdeModulePkg/EbcDxe AARCH64: use a fixed size thunk structure Ard Biesheuvel
2016-08-26 12:28   ` Leif Lindholm
2016-08-17 14:59 ` [PATCH v3 3/4] MdeModulePkg/EbxDxe AARCH64: use tail call for EBC to native thunk Ard Biesheuvel
2016-08-26 12:54   ` Leif Lindholm
2016-08-26 17:14     ` Ard Biesheuvel
2016-08-26 18:10       ` Leif Lindholm
2016-08-26 18:41         ` Ard Biesheuvel
2016-08-17 14:59 ` [PATCH v3 4/4] MdeModulePkg/EbcDxe AARCH64: simplify interpreter entry point thunks Ard Biesheuvel
2016-08-26 12:56   ` Leif Lindholm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160826110610.GD4715@bivouac.eciton.net \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox