From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH v5 8/9] virtio: add 1.0 support Date: Wed, 27 Jan 2016 11:49:29 +0800 Message-ID: <20160127034929.GF4257@yliu-dev.sh.intel.com> References: <1452832571-6156-1-git-send-email-yuanhan.liu@linux.intel.com> <1453191125-26335-1-git-send-email-yuanhan.liu@linux.intel.com> <1453191125-26335-9-git-send-email-yuanhan.liu@linux.intel.com> <5347304.e6a00tL54Q@xps13> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org To: Thomas Monjalon Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id AB7F98E59 for ; Wed, 27 Jan 2016 04:49:06 +0100 (CET) Content-Disposition: inline In-Reply-To: <5347304.e6a00tL54Q@xps13> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, Jan 21, 2016 at 12:37:42PM +0100, Thomas Monjalon wrote: > 2016-01-19 16:12, Yuanhan Liu: > > +#define IO_READ_DEF(nr_bits, type) \ > > +static inline type \ > > +io_read##nr_bits(type *addr) \ > > +{ \ > > + return *(volatile type *)addr; \ > > +} > > + > > +#define IO_WRITE_DEF(nr_bits, type) \ > > +static inline void \ > > +io_write##nr_bits(type val, type *addr) \ > > +{ \ > > + *(volatile type *)addr = val; \ > > +} > > + > > +IO_READ_DEF (8, uint8_t) > > +IO_WRITE_DEF(8, uint8_t) > > + > > +IO_READ_DEF (16, uint16_t) > > +IO_WRITE_DEF(16, uint16_t) > > + > > +IO_READ_DEF (32, uint32_t) > > +IO_WRITE_DEF(32, uint32_t) > > Yes you can do this. > But not sure you should. > > > +static inline void > > +io_write64_twopart(uint64_t val, uint32_t *lo, uint32_t *hi) > > +{ > > + io_write32(val & ((1ULL << 32) - 1), lo); > > + io_write32(val >> 32, hi); > > +} > > When debugging this code, how GDB behave? > How to find the definition of io_write32() with grep or simple editors? Okay, I will unfold them. --yliu