From: Keir Fraser Subject: Re: [RFC] Re: [PATCH] fix xenctl_cpumap translation to handle bitops accessed like arrays Date: Sun, 21 Jan 2007 16:20:31 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jimi Xenidis , Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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" 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; > } > }