[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 01/14] memory: Define API for MemoryRegionOps to
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 01/14] memory: Define API for MemoryRegionOps to take attrs and return status |
Date: |
Thu, 09 Apr 2015 11:21:26 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
On 09/04/2015 11:04, Peter Maydell wrote:
> We discussed this last time round, I think. Whether structs get
> passed in registers depends on the host CPU ABI/calling convention.
Because of C++, structs up to pointer size are in practice always passed
in registers. 64-bit structs may or may not.
The main advantage of structs is that it's impossible to mismatch the
parameter order. That even trumps readability in my opinion.
I'm ambivalent, but I wouldn't mind at all using structs.
Paolo
>> > I find it more readable, you ca go:
>> >
>> > attrs.secure = 1;
>> > attrs.master_id = 0x77;
>> > if (!attrs.secure)
>> >
>> > instead of:
>> >
>> > attrs |= MEMTXATTRS_SECURE
>> > if (!(attrs & MEMTXATTRS_SECURE))
>> >
>> > etc...
>> >
>> > Or do you see any disadvantages with this?
> I prefer the traditional integer-and-bitops approach, then you
> know what you're getting everywhere...
- Re: [Qemu-devel] [PATCH 07/14] exec.c: Add new address_space_ld*/st* functions, (continued)
Re: [Qemu-devel] [PATCH 07/14] exec.c: Add new address_space_ld*/st* functions, Edgar E. Iglesias, 2015/04/09
[Qemu-devel] [PATCH 14/14] target-arm: Check watchpoints against CPU security state, Peter Maydell, 2015/04/07
[Qemu-devel] [PATCH 01/14] memory: Define API for MemoryRegionOps to take attrs and return status, Peter Maydell, 2015/04/07
Re: [Qemu-devel] [PATCH 01/14] memory: Define API for MemoryRegionOps to take attrs and return status, Edgar E. Iglesias, 2015/04/09
[Qemu-devel] [PATCH 05/14] exec.c: Convert subpage memory ops to _with_attrs, Peter Maydell, 2015/04/07
[Qemu-devel] [PATCH 08/14] Switch non-CPU callers from ld/st*_phys to address_space_ld/st*, Peter Maydell, 2015/04/07
[Qemu-devel] [PATCH 03/14] Make CPU iotlb a structure rather than a plain hwaddr, Peter Maydell, 2015/04/07