From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.85.221.66; helo=mail-wr1-f66.google.com; envelope-from=philmd@redhat.com; receiver=edk2-devel@lists.01.org Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D073E21AE30DB for ; Mon, 1 Oct 2018 03:17:44 -0700 (PDT) Received: by mail-wr1-f66.google.com with SMTP id s14-v6so13259508wrw.6 for ; Mon, 01 Oct 2018 03:17:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=3htedJ2/Yt3NEyhokuKDYEn+G5oYWLV0PKtez8XCKtA=; b=f5++niHWeWL+KA6Qc/j1j7qBzGrAP0ZIcQSMBdZfcvXDw7bDnXW+7Lfw5z9b11cX8y 1SiggBzPZNDw6wzfUChzsMO0FgHqxii5JLYWVbseX1VLqs1YTGh9Ng/sOV/9KuCEgPWu 7MC6sIIgKp+NXk5zDHFA6tcszDDh7MHqlr/RBhQhoIoCzA06dyr6QZ97KAnjWV7zkPcJ hx8h4mL/v86vOBs7nw3Xii/B8ZUcdIE+s4x7bPRSIg3L99Y819bC7RkpcIEZLMO2SCy8 W1lX7kPt+eeg/h2rC4JY+1fNp4mCci9irD/WZml/V+lEPe0YlOgLq9p5EPOIsgBXg1SZ bfNg== X-Gm-Message-State: ABuFfogicRsc0OAUKAk7gAIo7iujZHiGfBR/v4jGthqp8DaXy/OR5M01 1w7xe0fAo6j/vJJUS1X+SWq4dQ== X-Google-Smtp-Source: ACcGV614E4V5Feft32tXoo8fASLG+FqYRFAt7RrdpsheU08s0wd4qcRLolUmgbbp82mfRW/yRu1hgQ== X-Received: by 2002:adf:f111:: with SMTP id r17-v6mr6773138wro.303.1538389062479; Mon, 01 Oct 2018 03:17:42 -0700 (PDT) Received: from [192.168.2.71] ([80.31.72.241]) by smtp.gmail.com with ESMTPSA id 16-v6sm5409377wrb.95.2018.10.01.03.17.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Oct 2018 03:17:41 -0700 (PDT) To: Laszlo Ersek , edk2-devel-01 Cc: Michael D Kinney , Liming Gao References: <20180929222312.32150-1-lersek@redhat.com> <20180929222312.32150-2-lersek@redhat.com> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: <7fb47836-f8dc-b9dc-923d-8e4d2ec1f7fb@redhat.com> Date: Mon, 1 Oct 2018 12:17:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20180929222312.32150-2-lersek@redhat.com> Subject: Re: [PATCH 1/5] MdePkg/BaseSynchronizationLib GCC: fix whitespace and comments X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Oct 2018 10:17:45 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit On 30/09/2018 00:23, Laszlo Ersek wrote: > The "GccInline.c" files have some inconsistent whitespace, and missing (or > incorrect) operand comments. Fix and unify them. > > This patch doesn't change behavior. > > Cc: Liming Gao > Cc: Michael D Kinney > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1208 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Laszlo Ersek Reviewed-by: Philippe Mathieu-Daudé > --- > MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c | 35 ++++++------- > MdePkg/Library/BaseSynchronizationLib/X64/GccInline.c | 53 +++++++++----------- > 2 files changed, 39 insertions(+), 49 deletions(-) > > diff --git a/MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c b/MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c > index fa2be7f4b35c..1976720ac636 100644 > --- a/MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c > +++ b/MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c > @@ -39,7 +39,7 @@ InternalSyncIncrement ( > "movl $1, %%eax \n\t" > "lock \n\t" > "xadd %%eax, %1 \n\t" > - "inc %%eax " > + "inc %%eax \n\t" > : "=a" (Result), // %0 > "+m" (*Value) // %1 > : // no inputs that aren't also outputs > @@ -48,7 +48,6 @@ InternalSyncIncrement ( > ); > > return Result; > - > } > > > @@ -76,10 +75,10 @@ InternalSyncDecrement ( > "movl $-1, %%eax \n\t" > "lock \n\t" > "xadd %%eax, %1 \n\t" > - "dec %%eax " > - : "=a" (Result), // %0 > - "+m" (*Value) // %1 > - : // no inputs that aren't also outputs > + "dec %%eax \n\t" > + : "=a" (Result), // %0 > + "+m" (*Value) // %1 > + : // no inputs that aren't also outputs > : "memory", > "cc" > ); > @@ -87,6 +86,7 @@ InternalSyncDecrement ( > return Result; > } > > + > /** > Performs an atomic compare exchange operation on a 16-bit unsigned integer. > > @@ -113,15 +113,13 @@ InternalSyncCompareExchange16 ( > IN UINT16 ExchangeValue > ) > { > - > __asm__ __volatile__ ( > - " \n\t" > "lock \n\t" > "cmpxchgw %1, %2 \n\t" > - : "=a" (CompareValue) > - : "q" (ExchangeValue), > - "m" (*Value), > - "0" (CompareValue) > + : "=a" (CompareValue) // %0 > + : "q" (ExchangeValue), // %1 > + "m" (*Value), // %2 > + "0" (CompareValue) // %3 > : "memory", > "cc" > ); > @@ -129,6 +127,7 @@ InternalSyncCompareExchange16 ( > return CompareValue; > } > > + > /** > Performs an atomic compare exchange operation on a 32-bit unsigned integer. > > @@ -155,15 +154,13 @@ InternalSyncCompareExchange32 ( > IN UINT32 ExchangeValue > ) > { > - > __asm__ __volatile__ ( > - " \n\t" > "lock \n\t" > "cmpxchgl %1, %2 \n\t" > - : "=a" (CompareValue) // %0 > - : "q" (ExchangeValue), // %1 > - "m" (*Value), // %2 > - "0" (CompareValue) // %4 > + : "=a" (CompareValue) // %0 > + : "q" (ExchangeValue), // %1 > + "m" (*Value), // %2 > + "0" (CompareValue) // %3 > : "memory", > "cc" > ); > @@ -171,6 +168,7 @@ InternalSyncCompareExchange32 ( > return CompareValue; > } > > + > /** > Performs an atomic compare exchange operation on a 64-bit unsigned integer. > > @@ -197,7 +195,6 @@ InternalSyncCompareExchange64 ( > ) > { > __asm__ __volatile__ ( > - " \n\t" > "push %%ebx \n\t" > "movl %2,%%ebx \n\t" > "lock \n\t" > diff --git a/MdePkg/Library/BaseSynchronizationLib/X64/GccInline.c b/MdePkg/Library/BaseSynchronizationLib/X64/GccInline.c > index ab7efe23c4db..0212798d7a27 100644 > --- a/MdePkg/Library/BaseSynchronizationLib/X64/GccInline.c > +++ b/MdePkg/Library/BaseSynchronizationLib/X64/GccInline.c > @@ -39,7 +39,7 @@ InternalSyncIncrement ( > "movl $1, %%eax \n\t" > "lock \n\t" > "xadd %%eax, %1 \n\t" > - "inc %%eax " > + "inc %%eax \n\t" > : "=a" (Result), // %0 > "+m" (*Value) // %1 > : // no inputs that aren't also outputs > @@ -75,10 +75,10 @@ InternalSyncDecrement ( > "movl $-1, %%eax \n\t" > "lock \n\t" > "xadd %%eax, %1 \n\t" > - "dec %%eax " > - : "=a" (Result), // %0 > - "+m" (*Value) // %1 > - : // no inputs that aren't also outputs > + "dec %%eax \n\t" > + : "=a" (Result), // %0 > + "+m" (*Value) // %1 > + : // no inputs that aren't also outputs > : "memory", > "cc" > ); > @@ -113,16 +113,14 @@ InternalSyncCompareExchange16 ( > IN UINT16 ExchangeValue > ) > { > - > - > __asm__ __volatile__ ( > "lock \n\t" > - "cmpxchgw %3, %1 " > - : "=a" (CompareValue), > - "=m" (*Value) > - : "a" (CompareValue), > - "r" (ExchangeValue), > - "m" (*Value) > + "cmpxchgw %3, %1 \n\t" > + : "=a" (CompareValue), // %0 > + "=m" (*Value) // %1 > + : "a" (CompareValue), // %2 > + "r" (ExchangeValue), // %3 > + "m" (*Value) // %4 > : "memory", > "cc" > ); > @@ -157,16 +155,14 @@ InternalSyncCompareExchange32 ( > IN UINT32 ExchangeValue > ) > { > - > - > __asm__ __volatile__ ( > "lock \n\t" > - "cmpxchgl %3, %1 " > - : "=a" (CompareValue), // %0 > - "=m" (*Value) // %1 > - : "a" (CompareValue), // %2 > - "r" (ExchangeValue), // %3 > - "m" (*Value) > + "cmpxchgl %3, %1 \n\t" > + : "=a" (CompareValue), // %0 > + "=m" (*Value) // %1 > + : "a" (CompareValue), // %2 > + "r" (ExchangeValue), // %3 > + "m" (*Value) // %4 > : "memory", > "cc" > ); > @@ -200,20 +196,17 @@ InternalSyncCompareExchange64 ( > IN UINT64 ExchangeValue > ) > { > - > __asm__ __volatile__ ( > "lock \n\t" > - "cmpxchgq %3, %1 " > - : "=a" (CompareValue), // %0 > - "=m" (*Value) // %1 > - : "a" (CompareValue), // %2 > - "r" (ExchangeValue), // %3 > - "m" (*Value) > + "cmpxchgq %3, %1 \n\t" > + : "=a" (CompareValue), // %0 > + "=m" (*Value) // %1 > + : "a" (CompareValue), // %2 > + "r" (ExchangeValue), // %3 > + "m" (*Value) // %4 > : "memory", > "cc" > ); > > return CompareValue; > } > - > - >