From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 26 Jan 2016 19:49:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,353,1449561600"; d="scan'208";a="734903900" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.66.49]) by orsmga003.jf.intel.com with ESMTP; 26 Jan 2016 19:49:05 -0800 Date: Wed, 27 Jan 2016 11:49:29 +0800 From: Yuanhan Liu To: Thomas Monjalon 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 Content-Disposition: inline In-Reply-To: <5347304.e6a00tL54Q@xps13> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v5 8/9] virtio: add 1.0 support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2016 03:49:07 -0000 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