[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/4] add byteordered types to qemu.
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH 1/4] add byteordered types to qemu. |
Date: |
Thu, 02 Oct 2008 14:46:41 +0200 |
User-agent: |
Thunderbird 2.0.0.16 (X11/20080723) |
Christoph Hellwig wrote:
>> +typedef uint16_t le16;
>> +typedef uint32_t le32;
>> +typedef uint64_t le64;
>> +typedef uint16_t be16;
>> +typedef uint32_t be32;
>> +typedef uint64_t be64;
>
> Any chance you could add sparse __bitwise__ declarations so one could
> use spare to check for using these types correctly?
Is there any good documentation on that?
Looking at the linux kernel sources I find the bitwise stuff depend on
the __CHECKER__ and __CHECK_ENDIAN__ defines. I can't find references
to these in the sparse man page and sparse FAQ (sparse 0.4.1 as shipped
by fedora 9).
I can somehow guess what these two defines do. __CHECKER__ probably is
set by sparse, and __CHECK_ENDIAN__ by the -Wbitwise switch. But I
can't see any obvious reason why include/linux/types.h defines both
__bitwise__ and __bitwise. I'd simply use something along the lines ...
#if defined(__CHECKER__) && defined(__CHECK_ENDIAN__)
# define __bitwise__ __attribute__((bitwise))
#else
# define __bitwise__
#endif
typedef uint16_t __bitwise__ le16;
[ ... ]
cheers,
Gerd
- [Qemu-devel] [PATCH 4/4] pci: use pci_config_header in pci.c, (continued)
- [Qemu-devel] [PATCH 4/4] pci: use pci_config_header in pci.c, Gerd Hoffmann, 2008/10/01
- Re: [Qemu-devel] [PATCH 4/4] pci: use pci_config_header in pci.c, Anthony Liguori, 2008/10/01
- Re: [Qemu-devel] [PATCH 4/4] pci: use pci_config_header in pci.c, Gerd Hoffmann, 2008/10/01
- Re: [Qemu-devel] [PATCH 4/4] pci: use pci_config_header in pci.c, Anthony Liguori, 2008/10/01
- Re: [Qemu-devel] [PATCH 4/4] pci: use pci_config_header in pci.c, Gerd Hoffmann, 2008/10/02
- Re: [Qemu-devel] [PATCH 4/4] pci: use pci_config_header in pci.c, Anthony Liguori, 2008/10/02
- Re: [Qemu-devel] [PATCH 4/4] pci: use pci_config_header in pci.c, Gerd Hoffmann, 2008/10/06
[Qemu-devel] [PATCH 2/4] pci: add config space struct (from qemu-xen)., Gerd Hoffmann, 2008/10/01
[Qemu-devel] [PATCH 3/4] pci: add default pci subsystem id for all devices., Gerd Hoffmann, 2008/10/01
Re: [Qemu-devel] [PATCH 1/4] add byteordered types to qemu., Christoph Hellwig, 2008/10/02
- Re: [Qemu-devel] [PATCH 1/4] add byteordered types to qemu.,
Gerd Hoffmann <=
- Re: [Qemu-devel] [PATCH 1/4] add byteordered types to qemu., Christoph Hellwig, 2008/10/02
- Re: [Qemu-devel] [PATCH 1/4] add byteordered types to qemu., Gerd Hoffmann, 2008/10/02
- Re: [Qemu-devel] [PATCH 1/4] add byteordered types to qemu., Christoph Hellwig, 2008/10/02
- Re: [Qemu-devel] [PATCH 1/4] add byteordered types to qemu., Gerd Hoffmann, 2008/10/02
- Re: [Qemu-devel] [PATCH 1/4] add byteordered types to qemu., Anthony Liguori, 2008/10/02
- Re: [Qemu-devel] [PATCH 1/4] add byteordered types to qemu., Gerd Hoffmann, 2008/10/06