From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v5 8/9] virtio: add 1.0 support Date: Thu, 21 Jan 2016 12:37:42 +0100 Message-ID: <5347304.e6a00tL54Q@xps13> 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Yuanhan Liu Return-path: Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) by dpdk.org (Postfix) with ESMTP id E31EA3005 for ; Thu, 21 Jan 2016 12:38:52 +0100 (CET) Received: by mail-wm0-f45.google.com with SMTP id b14so75948082wmb.1 for ; Thu, 21 Jan 2016 03:38:52 -0800 (PST) In-Reply-To: <1453191125-26335-9-git-send-email-yuanhan.liu@linux.intel.com> 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" 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?