From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :in-reply-to:references:mime-version:content-transfer-encoding :content-type; bh=zUwPxsqTBGWqXNAvuDTjqHVTgEcCN3oC2iYqZQEo8zM=; b=tsn9PweETC1F7bgkUoSME37WsDY9kYunYqbMLTuUkHNpc9tthpAte/bJKU5+XIBm9d +p1zT1UZlg4VUta59u21lCEO10lVHRy/msVUTMc30jFtcot1dV1B2XswbmHJEMU2Nck3 AbXZf5solk9+yuJuXYqUHpiGA0NoSEpqVH0gCfnwp28lPrP0cfo1CjHOWdBBmAh7v5UX WcT67QAnTeRLrIsZnXspkLNlj3z6sw0G/9almrq46qIcCepICKnE4fLGzZs5LoAzKC14 5ttvBFiTpopAo9Lxef8Ac4uf2Sjm1ggc8yojUorZFgS7o95Pm3bqNUDCczkDkJVm7U8g rjQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=zUwPxsqTBGWqXNAvuDTjqHVTgEcCN3oC2iYqZQEo8zM=; b=DOWTOykvs+PpYWbNf/KO+SUTOxdzheNQwWiFUGnvOAtWNi9OI2tBVYAXIJWFAckTBg 1wByF8RsXzeVmh155SybBHkTIztrp+vW/hqyeMWhZvWC37msbw3tG8hWzQ2gCQedNmc9 5cekFNKG0UUqQ+TJ+xDfPNbyDyQfTEPMnBfEQN28UPRK8UBhFHGf9tLqfb6exLYuE555 L0uI1RMGULs4YX7eMMEwxhXXZzFbVxxOoI32RV4kmYE4qk10hKGCowjeQd72Afu/r5M2 qbgH5TpfGXc90A1VKDpVQ4I1vA4qbiWBQVkzswKa1l4h+ZVbW4hDxmm1Ms9nvPPbkuFj Gcow== X-Gm-Message-State: AG10YOQwkBwTDaHeXLp57aCBUCZPCJ+Zn3aM8OFeq02D+sL8F8htue9z2Nmkxw0mph2uwe5u X-Received: by 10.194.22.101 with SMTP id c5mr28232933wjf.151.1453376322830; Thu, 21 Jan 2016 03:38:42 -0800 (PST) Received: from xps13.localnet (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id v191sm2561940wme.1.2016.01.21.03.38.41 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Jan 2016 03:38:42 -0800 (PST) From: Thomas Monjalon To: Yuanhan Liu Date: Thu, 21 Jan 2016 12:37:42 +0100 Message-ID: <5347304.e6a00tL54Q@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1453191125-26335-9-git-send-email-yuanhan.liu@linux.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> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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: Thu, 21 Jan 2016 11:38:53 -0000 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?