[PATCH v3 1/3] include: types: Add __aligned(x) to define the minimum alignement

Anup Patel Anup.Patel at wdc.com
Tue Apr 6 06:05:48 BST 2021



> -----Original Message-----
> From: Christoph Muellner <cmuellner at linux.com>
> Sent: 06 April 2021 07:24
> To: opensbi at lists.infradead.org; Anup Patel <Anup.Patel at wdc.com>; Guo
> Ren <guoren at kernel.org>; Xiang W <wxjstz at 126.com>; Jessica Clarke
> <jrtc27 at jrtc27.com>
> Cc: Christoph Muellner <cmuellner at linux.com>
> Subject: [PATCH v3 1/3] include: types: Add __aligned(x) to define the
> minimum alignement
> 
> The __aligned(x) macro is a common wrapper around compiler's aligned
> attribute, which allow to define the minimum alignement of a data type. Let's
> add this macro.
> 
> Signed-off-by: Christoph Muellner <cmuellner at linux.com>

Looks good to me.

Reviewed-by: Anup Patel <anup.patel at wdc.com>

Thanks,
Anup

> ---
>  include/sbi/sbi_types.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/sbi/sbi_types.h b/include/sbi/sbi_types.h index
> 0952d5c..38e3565 100644
> --- a/include/sbi/sbi_types.h
> +++ b/include/sbi/sbi_types.h
> @@ -63,6 +63,7 @@ typedef unsigned long		physical_size_t;
> 
>  #define __packed		__attribute__((packed))
>  #define __noreturn		__attribute__((noreturn))
> +#define __aligned(x)		__attribute__((aligned(x)))
> 
>  #define likely(x) __builtin_expect((x), 1)  #define unlikely(x)
> __builtin_expect((x), 0)
> --
> 2.30.2




More information about the opensbi mailing list