[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/3] s390: implement pci instructions
From: |
Frank Blaschka |
Subject: |
Re: [Qemu-devel] [PATCH 2/3] s390: implement pci instructions |
Date: |
Tue, 11 Nov 2014 13:40:08 +0100 |
User-agent: |
Mutt/1.5.17 (2007-11-01) |
On Tue, Nov 11, 2014 at 12:17:17PM +0000, Peter Maydell wrote:
> On 11 November 2014 12:10, Frank Blaschka <address@hidden> wrote:
> > On Mon, Nov 10, 2014 at 04:56:21PM +0100, Alexander Graf wrote:
> >> > +static uint8_t barsize(uint64_t size)
> >> > +{
> >> > + uint64_t mask = 1;
> >> > + int i;
> >> > +
> >> > + if (!size) {
> >> > + return 0;
> >> > + }
> >> > +
> >> > + for (i = 0; i < 64; i++) {
> >> > + if (size & mask) {
> >> > + break;
> >> > + }
> >> > + mask = (mask << 1);
> >> > + }
> >> > +
> >> > + return i;
> >> > +}
> >>
> >> Isn't there an existing helper for this in the PCI layer?
> >>
> >
> > Did not find one, this function is used to fill a s390 specific len
> > in an instruction intercept (architecture specific encoding of the len).
>
> If you do need to implement this here then you should probably
> be using ctz64(). I think what you have here is equivalent to
>
> return size ? ctz64(size) : 0;
>
> but you should check that.
will do thx!
>
> thanks
> -- PMM
>
- Re: [Qemu-devel] [PATCH 2/3] s390: implement pci instructions, (continued)
- Re: [Qemu-devel] [PATCH 2/3] s390: implement pci instructions, Alexander Graf, 2014/11/11
- Re: [Qemu-devel] [PATCH 2/3] s390: implement pci instructions, Frank Blaschka, 2014/11/12
- Re: [Qemu-devel] [PATCH 2/3] s390: implement pci instructions, Alexander Graf, 2014/11/12
- Re: [Qemu-devel] [PATCH 2/3] s390: implement pci instructions, Paolo Bonzini, 2014/11/12
- Re: [Qemu-devel] [PATCH 2/3] s390: implement pci instructions, Alexander Graf, 2014/11/12
- Re: [Qemu-devel] [PATCH 2/3] s390: implement pci instructions, Frank Blaschka, 2014/11/12
- Re: [Qemu-devel] [PATCH 2/3] s390: implement pci instructions, Alexander Graf, 2014/11/12
- Re: [Qemu-devel] [PATCH 2/3] s390: implement pci instructions, Paolo Bonzini, 2014/11/12
- Re: [Qemu-devel] [PATCH 2/3] s390: implement pci instructions, Frank Blaschka, 2014/11/12
- Re: [Qemu-devel] [PATCH 2/3] s390: implement pci instructions, Peter Maydell, 2014/11/11
- Re: [Qemu-devel] [PATCH 2/3] s390: implement pci instructions,
Frank Blaschka <=