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

Re: [PATCH v4 1/4] xen/riscv: introduce asm/types.h header file


  • To: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 16 Jan 2023 15:59:49 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iPSNmUR2QtSx1xiyEeUZ7bqFeFb/qlAPR2o2cqkNqPA=; b=nKgn6ZPQprZ/EB/m1H/rdz8jJx25ZE+fWHA2MEhG4hoz+dMN+xbVkSpY50ZW+1kwNEDoiV/qvi6L1nOsMrh06drrZIOoU58uJ/16orZK/25OJTRr7+oaWk3fUiBhqFp9lV0QwntUGrdWKMcL83AT6TVb+2/vjbatRVzUUcNK/fu6xg9FtYIotO1raescR44aM31cIVaH18v+FFemeysLDBkB9r/s2z5eKvy1B1QL3oyPQz77xtKb/Yi1GGjjXytfs7DKFCyS/EHHPStn/+Yr3CueqYczJ9lJ4+oCr7Ac/QP6VsX2d8rNwqcGFtTiZfXa+YbLAnkCxqmdXe73XfIXWA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XeS2MEVUoQsBjna3EtC1wSviOwzm9rNdZGcjglhpWCq/dIfNSiYZ1DqdcAkc0JD/s4Gs09EpH+V/0DK1kP0fVvF68gEsIRINpK/JMRWyqtaiCgSF6xpTa3Ki6ba2YTPPLgRKGOP10IZ/Hpfh0mzSvjVEvg86WphRRdXroJlavV7RhEO5kGf6xT54LGQE0MHDmwiOX5xvdChoU7ncJJmSezxzzTjGyzamSChNZPG+OhTL8U2bKtRCm03C5Pufl+DWlbCK3YRa+6NSinZ8fiy6n1eyvVRjwLQfQisJPEZOp4rzVtyyL/rOY717ydQ0dl8BMoCvLSDiF6e34xP8LoCgiA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Julien Grall <julien@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Gianluca Guida <gianluca@xxxxxxxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 16 Jan 2023 14:59:57 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 16.01.2023 15:39, Oleksii Kurochko wrote:
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
> ---
> Changes in V4:
>     - Clean up types in <asm/types.h> and remain only necessary.
>       The following types was removed as they are defined in <xen/types.h>:
>       {__|}{u|s}{8|16|32|64}

For one you still typedef u32 and u64. And imo correctly so, until we
get around to move the definition basic types into xen/types.h. Plus
I can't see how things build for you: xen/types.h expects __{u,s}<N>
to be defined in order to then derive {u,}int<N>_t from them.

> --- /dev/null
> +++ b/xen/arch/riscv/include/asm/types.h
> @@ -0,0 +1,43 @@
> +#ifndef __RISCV_TYPES_H__
> +#define __RISCV_TYPES_H__
> +
> +#ifndef __ASSEMBLY__
> +
> +#if defined(CONFIG_RISCV_32)
> +typedef unsigned long long u64;
> +typedef unsigned int u32;
> +typedef u32 vaddr_t;
> +#define PRIvaddr PRIx32
> +typedef u64 paddr_t;
> +#define INVALID_PADDR (~0ULL)
> +#define PRIpaddr "016llx"
> +typedef u32 register_t;
> +#define PRIregister "x"
> +#elif defined (CONFIG_RISCV_64)
> +typedef unsigned long u64;
> +typedef u64 vaddr_t;
> +#define PRIvaddr PRIx64
> +typedef u64 paddr_t;
> +#define INVALID_PADDR (~0UL)
> +#define PRIpaddr "016lx"
> +typedef u64 register_t;
> +#define PRIregister "lx"
> +#endif

Any chance you could insert blank lines after #if, around #elif, and
before #endif?

> +#if defined(__SIZE_TYPE__)
> +typedef __SIZE_TYPE__ size_t;
> +#else
> +typedef unsigned long size_t;
> +#endif

I'd appreciate if this part was dropped by re-basing on top of my
"include/types: move stddef.h-kind types to common header" [1], to
avoid that (re-based) patch then needing to drop this from here
again. I would have committed this already, if osstest wasn't
completely broken right now.

Jan

[1] https://lists.xen.org/archives/html/xen-devel/2023-01/msg00720.html
(since you would not be able to find a patch of the quoted title,
as in the submission I mistakenly referenced stdlib.h)



 


Rackspace

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