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

Re: [PATCH v3] docs/misra: document the expected sizes of integer types


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Thu, 4 Apr 2024 08:29:53 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • 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=2; 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=HiuEi3DA1yEXDcusArxphXutTqifpUZ1MOc/n/PV/Jk=; b=lxKcKyPciIWRwCPk58qJT6MZcpXduh9AZ068HGwK1k/4JKGygMn5cl6kDiRoLrDEm+HQBFpdS+EuuZ0uiV+4rtcbDFGlpZNyPBhLMtvuMM+RcH/bVGMtNOFtG37ceriNqinfUBu9UjBe3saMyLJTjSwN4sRrCTGIU2HlSuQOzE4+gO0FsJuXH6CnV2eh+Oy6cY0MdrJ+Fqc5rz+a1DxyOraFY1WbezIaeBoplf0zfAsDaJX53kLmX2r0oZeubRDBZbWdH4V1dQSr4NrS75aqqcHLLacR8FgUZKJl48V3uYzv30F4kDS7TicHlGGaAUdCB9Tmoif9nDJ29QObsq34hA==
  • 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=HiuEi3DA1yEXDcusArxphXutTqifpUZ1MOc/n/PV/Jk=; b=SgWwOcADxqC7gbFkypDRNwMhBX1F8fgS/8kUsdM6xyeNgJrHP7/hxGlPWcPAZQDHbn7C115HAV+qrONvCEctVhX1siYRPB6l/AEilsU9jwEhugKt+0b8S1bo0iZnIacNStKpyU3Q5zGFsrE/xGmzveuAVOACG06INogHYaS0+9a2vPt2hu9DFc7TsyLcvNLL4lJndisEWlcH5pBG7maD80AO8cVYLLuYrzoL284YB7z+vzjYB8gCvXQFrsD8jX95zJLPS/zN8OaDrzqmfmgJ19CWVrOyvDLr4CQ6LtQc7XH5UZpwj8eLj42h4iK+E7TT86TtE0Rr/cZ2c5CoiRVR7A==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=GjgzeK+hakPvip2ZNUSMMpp3VW80+35unzxyYLRO2zsB2a8iUK+dKTgkJHKagFyuPUq0GB8caF6KPfUyPU90titK0Bv6Xx6e8fJlnI6/9L/Tl+scy+Dqp1egVEnWbF6xxztkSFT8XLSlOR/rplJ2je5UY7rO6rauqzWSSukRkmNPcJllTFCpE1Q9d4bxaFoABr3VZoYrDCId1GPVamRMMgNOWUMg0N4Xvz0QL5McZeW6zOKGb+5cFXNYouqwyl0NevsOibd2Rvo57Mv8hz85HF+CNPxy9SKx52M+2Ypeua4o1qZrmKftpD+HQgcSEvkplSDb3CCbKnf2rw10a4lg9g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fk9CY8kY4tZ56mCdGW4RnmA2EMvsITJ6wnRg0Y83lsK3daMbOcQEDLiOzGt71vafwL2q/PW14xjAbR5tbTLef5yu9OLwMylcyNBWxsd5b/7s3yNSc0qCFGi/1XW9Fr47U3/MNn/8bpVBTeIXBKx1/JDMCYM+Y1+if5kgU+fwOdaa60a4Abr1mEp5LfmihRE/ySQtrlRfOoNxDGfs40nbGJmAq8wDykOwpbRiRq+T3UEPQtw5gsTwbSR4yYQACd3ZJpFf9PV10TaoV1x9qCNsIhmY4lAm3APjYJAzwguDPOmvq6ldOUBOw0Q34yKQx1//KnH9buH8154F0nkWasSbgw==
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "roger.pau@xxxxxxxxxx" <roger.pau@xxxxxxxxxx>
  • Delivery-date: Thu, 04 Apr 2024 08:30:14 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Thread-index: AQHahi02L7CmbuGs70iGCAZey/rjT7FXyCAA
  • Thread-topic: [PATCH v3] docs/misra: document the expected sizes of integer types

Hi Stefano,

> On 4 Apr 2024, at 03:12, Stefano Stabellini <sstabellini@xxxxxxxxxx> wrote:
> 
> Xen makes assumptions about the size of integer types on the various
> architectures. Document these assumptions.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
> ---
> Changes in v3:
> - add links to System V, AAPCS32 and AAPCS64
> 
> ---
> docs/misra/C-language-toolchain.rst | 69 +++++++++++++++++++++++++++++
> 1 file changed, 69 insertions(+)
> 
> diff --git a/docs/misra/C-language-toolchain.rst 
> b/docs/misra/C-language-toolchain.rst
> index b7c2000992..84b21992bc 100644
> --- a/docs/misra/C-language-toolchain.rst
> +++ b/docs/misra/C-language-toolchain.rst
> @@ -480,4 +480,73 @@ The table columns are as follows:
>      - See Section "4.13 Preprocessing Directives" of GCC_MANUAL and Section 
> "11.1 Implementation-defined behavior" of CPP_MANUAL.
> 
> 
> +Sizes of Integer types
> +______________________
> +
> +Xen expects System V ABI on x86_64:
> +  https://gitlab.com/x86-psABIs/x86-64-ABI
> +
> +Xen expects AAPCS32 on ARMv8-A AArch32:
> +  https://github.com/ARM-software/abi-aa/blob/main/aapcs32/aapcs32.rst
> +
> +Xen expects AAPCS64 LP64 on ARMv8-A AArch64:
> +  https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst

We still support armv7 somehow so we should add something for it here.

> +
> +A summary table of data types, sizes and alignment is below:
> +
> +.. list-table::
> +   :widths: 10 10 10 45
> +   :header-rows: 1
> +
> +   * - Type
> +     - Size
> +     - Alignment
> +     - Architectures
> +
> +   * - char 
> +     - 8 bits
> +     - 8 bits
> +     - all architectures
> +
> +   * - short
> +     - 16 bits
> +     - 16 bits
> +     - all architectures
> +
> +   * - int
> +     - 32 bits
> +     - 32 bits
> +     - all architectures
> +
> +   * - long
> +     - 32 bits
> +     - 32 bits 
> +     - 32-bit architectures (x86_32, ARMv8-A AArch32, ARMv8-R AArch32)

Same here armv7 should be mentioned.

> +
> +   * - long
> +     - 64 bits
> +     - 64 bits 
> +     - 64-bit architectures (x86_64, ARMv8-A AArch64, RV64, PPC64)
> +
> +   * - long long
> +     - 64-bit
> +     - 32-bit
> +     - x86_32
> +
> +   * - long long
> +     - 64-bit
> +     - 64-bit
> +     - 64-bit architectures, ARMv8-A AArch32, ARMv8-R AArch32

Should this be all architecture except x86_32 ?

> +
> +   * - pointer
> +     - 32-bit
> +     - 32-bit
> +     - 32-bit architectures (x86_32, ARMv8-A AArch32, ARMv8-R AArch32)

Armv7 missing here.

> +
> +   * - pointer
> +     - 64-bit
> +     - 64-bit
> +     - 64-bit architectures (x86_64, ARMv8-A AArch64, RV64, PPC64)
> +
> +
> END OF DOCUMENT.
> -- 
> 2.25.1
> 

Cheers
Bertrand




 


Rackspace

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