[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: |
Edgar E. Iglesias |
Subject: |
Re: [Qemu-devel] [PATCH 01/14] memory: Define API for MemoryRegionOps to take attrs and return status |
Date: |
Thu, 9 Apr 2015 19:32:13 +1000 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Thu, Apr 09, 2015 at 10:04:39AM +0100, Peter Maydell wrote:
> On 9 April 2015 at 09:55, Edgar E. Iglesias <address@hidden> wrote:
> > Did you consider using a struct here?
> > e.g:
> >
> > typedef struct MemTxAttrs {
> > unsigned int secure : 1;
> > unsigned int master_id : 10;
> > unsigned int etc : 1;
> > } MemTxAttrs;
> >
> > I think you could still pass it by value and my understanding is
> > that the compiler will generate similar code.
>
> We discussed this last time round, I think. Whether structs get
> passed in registers depends on the host CPU ABI/calling convention.
Ah sorry, I must have missed that response...
>
> > 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...
OK :-)
Cheers,
Edgar
- [Qemu-devel] [PATCH 14/14] target-arm: Check watchpoints against CPU security state, (continued)
- [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, Paolo Bonzini, 2015/04/08
- Re: [Qemu-devel] [PATCH 01/14] memory: Define API for MemoryRegionOps to take attrs and return status, Edgar E. Iglesias, 2015/04/09
- Re: [Qemu-devel] [PATCH 01/14] memory: Define API for MemoryRegionOps to take attrs and return status, Peter Maydell, 2015/04/09
- Re: [Qemu-devel] [PATCH 01/14] memory: Define API for MemoryRegionOps to take attrs and return status, Paolo Bonzini, 2015/04/09
- Re: [Qemu-devel] [PATCH 01/14] memory: Define API for MemoryRegionOps to take attrs and return status, Edgar E. Iglesias, 2015/04/09
- Re: [Qemu-devel] [PATCH 01/14] memory: Define API for MemoryRegionOps to take attrs and return status, Peter Maydell, 2015/04/10
- Re: [Qemu-devel] [PATCH 01/14] memory: Define API for MemoryRegionOps to take attrs and return status, Edgar E. Iglesias, 2015/04/11
- Re: [Qemu-devel] [PATCH 01/14] memory: Define API for MemoryRegionOps to take attrs and return status,
Edgar E. Iglesias <=
[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
Re: [Qemu-devel] [PATCH 00/14] Add memory attributes and use them in ARM, Edgar E. Iglesias, 2015/04/09