WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [RFC] Re: [Xen-devel] [PATCH] fix xenctl_cpumap translation to handl

To: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>, Keir Fraser <keir@xxxxxxxxxxxxx>
Subject: Re: [RFC] Re: [Xen-devel] [PATCH] fix xenctl_cpumap translation to handle bitops accessed like arrays
From: Keir Fraser <keir@xxxxxxxxxxxxx>
Date: Sun, 21 Jan 2007 16:20:31 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Sun, 21 Jan 2007 08:20:25 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <BE075B8D-ECE5-4241-90CB-22E033B4777F@xxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acc9eBH1UIFnY6lrEduY2gANk04WTA==
Thread-topic: [RFC] Re: [Xen-devel] [PATCH] fix xenctl_cpumap translation to handle bitops accessed like arrays
User-agent: Microsoft-Entourage/11.3.2.061213
Yes looks like I screwed up the source endianness. Perhaps the first two
lines of the inner loop should be replaced by:
 l |= (unsigned long)bp[b+j] << (j*8);

(and a similar change to the similar function) in libxc?

 -- Keir

On 21/1/07 4:10 pm, "Jimi Xenidis" <jimix@xxxxxxxxxxxxxx> wrote:

>  From the patch that you committed, AFAICT this function does not do
> anything:
> 
> void bitmap_byte_to_long(unsigned long *lp, const uint8_t *bp, int
> nbits)
> {
> unsigned long l;
> int i, j, b;
> 
> for (i = 0, b = 0; nbits > 0; i++, b += sizeof(l)) {
> l = 0;
> for (j = 0; (j < sizeof(l)) && (nbits > 0); j++) {
> l <<= 8;
> l |= bp[b+j];
> nbits -= 8;
> }
> lp[i] = l;
> }
> }


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel