[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH v6 6/7] arch/arm64: Implement bitops for arm64


  • To: Santiago Pagani <Santiago.Pagani@xxxxxxxxx>, "minios-devel@xxxxxxxxxxxxxxxxxxxx" <minios-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Justin He (Arm Technology China)" <Justin.He@xxxxxxx>
  • Date: Tue, 22 Oct 2019 09:04:32 +0000
  • Accept-language: en-US, zh-CN
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fpyFL7EQmlRiZNmJi/WBcDyEY6s/1GmYXSqKykWoDks=; b=kSaRvX2SUlofRVUk+dqCakt4AKQiZ/L1B227jKzgUwL5EMBmk14muFArYQxz9VDHo3Wy1DihLlpYRDl/8VUKPR/Fygvo7EG7Oua3+myiE0lgHrSIyQIPwPJK0MbbXVnIjzvHBwvnasfsTB3aouM2pLA7k33Qpp+ntnOMUyzg7LkU9psUTMNDe1o85vma5iuJ8XSxGWnaGAisq8ntmo0TuMO5tsIbsiKAWa0nkqj3JqJK+FjHuHyxDDbcBMuCT803mMie9v2iqUCtjHCWKqoJ/6VrAEMR6pFSm+uxj8QO1BhSiW+v0npzfdxj/ZqgXX5BcKcG2B/XsOI7HYev9jSl6g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AcRLYcbNcMlHl6+gXcPmRHHLRFRePMynfbIDra2jJX3bAavEy9YT7IWKr7h5a51QyQOdKmmFwz0nNpunxOl6ysc9uQux9U8qlZ11+wQ3yvXBz+XpP8lDNkrfhMhPxAuaw+Yihnzu2Xg2w17U8qInx1nYnGDoUZP8ZCR2P/gqHHWpKYv3y9jT+0GBu9+4oDhnOxFzR1sLEEqWdKZW0R4XaxDOEpEMxBUKOmJmy/W2kRH97HRKFzs1vaORUDCIBQD+9pxoBPBPsQX0QMq4mymENuYwxcAt2SOsVqqDU6QLVfRGX0iA/hvSEazxW88Bl2t5uAp+rUsEoxXLCH2j8Ir6gQ==
  • Authentication-results: spf=temperror (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=none action=none header.from=arm.com;
  • Authentication-results-original: spf=none (sender IP is ) smtp.mailfrom=Justin.He@xxxxxxx;
  • Cc: nd <nd@xxxxxxx>
  • Delivery-date: Tue, 22 Oct 2019 09:04:50 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Nodisclaimer: True
  • Original-authentication-results: spf=none (sender IP is ) smtp.mailfrom=Justin.He@xxxxxxx;
  • Thread-index: AQHViKxf49NPbznt806+8GH6ZMciR6dmV0oAgAAGl/A=
  • Thread-topic: [UNIKRAFT PATCH v6 6/7] arch/arm64: Implement bitops for arm64

Hi Santiago
Thanks for your review 

--
Cheers,
Justin (Jia He)



> -----Original Message-----
> From: Santiago Pagani <Santiago.Pagani@xxxxxxxxx>
> Sent: Tuesday, October 22, 2019 4:40 PM
> To: Justin He (Arm Technology China) <Justin.He@xxxxxxx>; minios-
> devel@xxxxxxxxxxxxxxxxxxxx
> Cc: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>; Sharan Santhanam
> <Sharan.Santhanam@xxxxxxxxx>; Felipe Huici <Felipe.Huici@xxxxxxxxx>;
> Julien Grall <Julien.Grall@xxxxxxx>; Kaly Xin (Arm Technology China)
> <Kaly.Xin@xxxxxxx>
> Subject: Re: [UNIKRAFT PATCH v6 6/7] arch/arm64: Implement bitops for
> arm64
> 
> Reviewed-by: Santiago Pagani <santiago.pagani@xxxxxxxxx>
> 
> On 22.10.19, 09:43, "Jia He" <justin.he@xxxxxxx> wrote:
> 
>     Without this patch, compiler will report warning as follows:
>       In file included from plat/common/arm/time.c:41:0:
>     include/uk/bitops.h: In function 'uk_get_count_order':
>     include/uk/bitops.h:89:10: warning: implicit declaration of function
>     'ukarch_fls'; did you mean 'ukarch_ffsl'? 
> [-Wimplicit-function-declaration]
>       order = ukarch_fls(count);
>               ^~~~~~~~~~
>               ukarch_ffsl
>     include/uk/bitops.h: In function 'uk_find_last_bit':
>     include/uk/bitops.h:154:18: warning: implicit declaration of function
>     'ukarch_flsl'; did you mean 'ukarch_ffsl'? 
> [-Wimplicit-function-declaration]
>         return (bit + ukarch_flsl(mask));
>                       ^~~~~~~~~~~
>                       ukarch_ffsl
> 
>     Signed-off-by: Jia He <justin.he@xxxxxxx>
>     ---
>     V6: change the returned bit postion from [1...32] to [0...31]
> 
>      arch/arm/arm64/include/uk/asm/atomic.h | 36
> ++++++++++++++++++++++++++
>      1 file changed, 36 insertions(+)
> 
>     diff --git a/arch/arm/arm64/include/uk/asm/atomic.h
> b/arch/arm/arm64/include/uk/asm/atomic.h
>     index 7ee6667..431ac84 100644
>     --- a/arch/arm/arm64/include/uk/asm/atomic.h
>     +++ b/arch/arm/arm64/include/uk/asm/atomic.h
>     @@ -37,6 +37,31 @@
>      #error Do not include this header directly
>      #endif
> 
>     +/**
>     + * ukarch_ffs - find first (lowest) set bit in word.
>     + * @word: The word to search
>     + *
>     + * Returns one plus the index of the least significant 1-bit of x, or
>     + * if x is zero, returns zero.
>     + * ffs(1)=0, ffs(0x8000000)=31
>     + */
>     +static inline unsigned int ukarch_ffs(unsigned int x)
>     +{
>     + return __builtin_ffs(x) - 1;
>     +}
>     +
>     +/**
>     + * ukarch_fls - find last (highest) set bit in word.
>     + * @word: The word to search
>     + *
>     + * Undefined if no bit exists, so code should check against 0 first.
>     + * fls(1)=0, fls(0x8000000)=31
>     + */
>     +static inline unsigned int ukarch_fls(unsigned int x)
>     +{
>     + return sizeof(x) * 8 - __builtin_clz(x) - 1;
>     +}
>     +
>      /**
>       * ukarch_ffsl - find first (lowest) set bit in word.
>       * @word: The word to search
>     @@ -68,3 +93,14 @@ static inline unsigned long ukarch_ffsl(unsigned
> long word)
> 
>       return 63 - clz;
>      }
>     +
>     +/**
>     + * ukarch_flsl - find last (highest) set bit in word.
>     + * @word: The word to search
>     + *
>     + * Undefined if no bit exists, so code should check against 0 first.
>     + */
>     +static inline unsigned long ukarch_flsl(unsigned long x)
>     +{
>     + return sizeof(x) * 8 - __builtin_clzl(x) - 1;
>     +}
>     --
>     2.17.1
> 
> 

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.