Re: [PATCH v4 7/8] virtio: add 1.0 support
From: Xie, Huawei <hidden>
Date: 2016-01-19 01:51:34
From: Xie, Huawei <hidden>
Date: 2016-01-19 01:51:34
On 1/19/2016 9:34 AM, Yuanhan Liu wrote:
On Mon, Jan 18, 2016 at 05:07:51PM +0000, Xie, Huawei wrote:quoted
.On 1/15/2016 12:34 PM, Yuanhan Liu wrote:quoted
Modern (v1.0) virtio pci device defines several pci capabilities. Each cap has a configure structure corresponding to it, and the cap.bar and cap.offset fields tell us where to find it.[snip]quoted
+ +static inline void +io_write64_twopart(uint64_t val, uint32_t *lo, uint32_t *hi) +{ + io_write32((uint32_t)val, lo); + io_write32(val >> 32, hi);Firstly your second iowrite32 doesn't do the conversion.Because it's not necessary. The first one is for retrieving the low 32 bits.
I don't mean the shift operation, but the conversion from 64bit to 32bit. Same applied to below.
quoted
The conversion is duplicated.What do you mean by "duplicated". --yliu