From patchwork Thu Jan 12 09:17:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerin Jacob X-Patchwork-Id: 19221 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 499EDF950; Thu, 12 Jan 2017 10:19:06 +0100 (CET) Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0072.outbound.protection.outlook.com [104.47.32.72]) by dpdk.org (Postfix) with ESMTP id D8AB3F91B for ; Thu, 12 Jan 2017 10:19:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=RdpoeNlwxSm9NFdiPlUaqrzFGg9PNTtZOMNiYzEuxPc=; b=k9iylwn/9Dlwmj/7eeEUV7WNpgq4BbsB2oPDfv3DzWvIqUsaDnZgWgWyBeQ+JEhnwUPQwfguMIsxDHQkQcJ+7CKL9fzo/68YxIeU0lZuaJj7H5PJlCYnRG4s5Es+tw+MGfv3CPiFxRgDUbPhhA5Xdg1aPESAbdFjdbNdddNJTio= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.caveonetworks.com (111.93.218.67) by BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Thu, 12 Jan 2017 09:18:58 +0000 From: Jerin Jacob To: CC: , , , , , , Jerin Jacob Date: Thu, 12 Jan 2017 14:47:07 +0530 Message-ID: <1484212646-10338-11-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1484212646-10338-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1482832175-27199-1-git-send-email-jerin.jacob@caviumnetworks.com> <1484212646-10338-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: BY2PR06CA0007.namprd06.prod.outlook.com (10.166.106.145) To BLUPR0701MB1714.namprd07.prod.outlook.com (10.163.85.140) X-MS-Office365-Filtering-Correlation-Id: f14a56e8-b674-4961-6d0a-08d43acc0cae X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 3:5QqfBzsz9DK498gTiKEHD3r0e84YzfEGmd5kSQIEskaST07Lu56NVAJ7KgsXvzLt56Ux0EUwRPFfixRYGauvlFraUixYOsvWTVELRtfqrb5cPYjDgZDnQnGTDkL4Q5GUN0v5GJhLmVhey9D94kqrByblbDbSy5QxdrySgeqm57hAwWk558v5rZSzlaYe6/J6G7oPnhq/Ky2onrHGrZLqTo1mhtTzaV7G/XcWpdVYaX6WR2xPt6o9kepjOgIG3ECRzXLUWsWXJIdF1KkJVLdbTA==; 25:VbDUSz9g605sSwLYHreOeauXtYBdB8SFJ1NkAFvUtMzMm3PKT/AhV/+AjubmP6cgQIjHaf2lnBNBKTDXavMgSThzHR2ytj2XH/2U9eHkSOiHzNdD7u91XoujjpQxAEyiFXNLSeR5jaATIGJLtBe3jgEyh2RjN2T1lkhrtBcRWZX3B7uCig6sI9RZriY4IIHsDN7Wx4KulvZndAh28WunMqWpGt1hQKVFbzcEUr8lYWqRKKn+wy01BVOfbsPcGIM9pfcnb87Zxv2bs1NqMYEJnwcQWUIUbflkEA97n40ktyCd4ZduhqXpp1QKHsOJe5Fe+xKVygnj9lFCTWmZUeHCYZjMlG4clcZCCVGRCALAE2hDTqqhQIFHIOXA+ncCRLmY1XaE+nAAjb5E8B2o4eJBzLfo3Id++KIhITz1uJHkmS7EqQ03/yCoYWF2cNHfDYedpXriHS+/yksJ6Q5j37cbdw== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 31:PZisQM9oMmE+jWcjG8TLn1JPSHbE7RC1FTRls8peKSDkaR2lUkurlD1tiDi2Z1a7fy+sl6b4Fw+lmAL0ZkwT73+doHi8sj5SM+LPXFUk3cY9M0iw4VHUC2ZS/jykf9PNi0uomHwdzrwIP49IblJyTR1ckdQbnWaI3MHjFWkyq0FAyxu273mimBknXX9R2ha76dwdqTfU1Vn59XHXg4LO1SdeDyGGsuSokCsmcMf7um0t8kv6C9tiRZPgxoPHxtps; 20:Ej+JZLVxVfFDg7P0zrps5Y0O8autTqTbXOZEI0a9Qr0zqTCW3BZyN9zGYlX+Yf7IXjc3WKRiLQ2/OaAsMEQhlvnMJtky4P+yQOo5KP6m+LdP2ijGMsGBd8BhyW9cyM2FGg0I0FKMef1oJWasSVOEqYNKN6jviUSMAkcOIdD+fTb82VesljDytz96z4LeKrSeih2Qu8tDKsZImOCcTF5Zy6uhvtgTTJuSn03Z4bF2XMzXY+DclBWybkflRyUhzgVLwCytCkE2gF8JFXEkgYbBsFi1FxKq3wcyHIRb9WLNmnSLNJsHWC4bOxfrTCEpQ33hKW+bkAkk8q59NTAct5lJoeWN1jhuUKNlHCS4GRhSMp7scj4hLlQruh56gqWKi/qiBicBLMdd767JuvpKNZDccvqVautzH3I8uOBNrRZ+46V+43/SCVWBjhMFOCDIKynZSy5ZIyanJ6CJlQBYe8kgfQQsbDAdKcLhanrtasXTopTyyzcxuwNSQMEbOTU78DtBh27lg+EPKIjW0UxWetfkEdmsw/DcG7gH8VODwtgdeN/cM0uj37i9RYHI8w1atAPKD/NTpzp4yOWcHwfjDrxuK/myWGnh/v7xJtk+NjGdLKE= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123555025)(20161123562025)(20161123560025)(20161123564025)(6072148); SRVR:BLUPR0701MB1714; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1714; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 4:ibXE8zrsZhyZagnxtp0arukUTMWByjr4IJu3kHzwmcRAvEyL01ndpnRXW9rDpyrMbIkicNjsovLqFyBWzrFOTnPuYF5yWC5c7x7voaJzupK5qimPDIn6/cdBXe1dfnYYXYLw6KWJ+wMiwfQV8GMZ+vGO1zlGw8hAeFJWkHVIZMr+1eqEC3LuwRTnN9++joJT6gGW/J5B5FsMO4nymo/JxOwTVvqisVvqUKnjHMdJztm09VsJ9ZiEpMv4v800K9uxe+SpaezbMIlxJvS2NRxAZ6DG1zkEife2hjco0xooHT171MpObi2xXA+eUIrSDmkle/2oVZNriJ0j03zF7j5paoh0VjgDEmmYwRzVkXBt8qGiySQ3ZwrHAlKAVRlHUqVgDUXLqlkxp45Ecl+VHV9l5EYA+Wn92Thw6m/c+D+CBq2G9aR9/Knlb5I+dG2ZLFE40mbAbZrEYA4W4ISHJniMadFwJODIxheT67z+SBLTAfhWmXFJuZZksPKqMpLK6poiSyYYPw+jHVvIF0Hg9jUug+4rj3PT7z86R9WUbg7pru+TrSzHvw1ZPp2gr0sPHz1syBauFMRHOwwTwFsZAOPWOg== X-Forefront-PRVS: 018577E36E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(39450400003)(189002)(199003)(2950100002)(53416004)(76506005)(92566002)(105586002)(69596002)(2351001)(42186005)(68736007)(106356001)(42882006)(6916009)(305945005)(2906002)(7736002)(50466002)(48376002)(36756003)(5660300001)(110136003)(4326007)(97736004)(107886002)(189998001)(50226002)(6666003)(6506006)(38730400001)(101416001)(54906002)(33646002)(5009440100003)(4001430100002)(6486002)(66066001)(5003940100001)(6116002)(3846002)(47776003)(25786008)(81166006)(6512007)(81156014)(76176999)(50986999)(8676002)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1714; H:localhost.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1714; 23:UhcOkUV+024Q+jbQjplYMaVclCpec5+a951QHLg?= OiXcHOlpnVAF7rj8reHiypEjyeoEE0jHuL1GItpEJ0KBFU1vxi8yr4SYqNvfgjrsdk7s0zhVUdIfDjLxkNIIW8jsO9OeKdyjW0NmOnqNd1CLbGAF0WdrjjNRff388g/5lEbo+quoL8XKraWjKcUbXqGtCLLD+Mdo5tMEwVLx/Ewa7gI3c5tC6R+lZyCL2DGlmaqXXeOFrTXdNJaaaEDjeMvrOvAtbegkAHCwLEhDl9I3w9ZFCW2xnDswuJyD5Ih01TzV9vj39c66ZPQprPboXL+PeI39SbYr4eys53G64jIskCfE2QxklWjNBVWsp5Y7cN3s4uh9zj76rLY0/zH7s0w00JlV2nBqrkl1ZGWxoVA9H3h3K5nBtQE2fO2xRy5moxTjjj3ZWVjAvAij4vX/0A5ZZacQSZjiKvmC5E2CNJLTGkVeEfy3hFL27/VoS4vZMkWNn8Ru/mCDvtnxEd4h6aeehq9qO3pjAlkHjFQCmJMGfxUM/9Y+fU/LRbUIO851ngtvQ2t1M2x6PUWMZTMozwbxtmolLZGWs1cWS/T8RllmNy7apwK/zB2H3rEsV17dvfzyl+V2GAAtVzksmyd5QWsZEVca8H0jdaROAoyFdbG1NYybXquOlIiAITDnV6GOSwP1pvUEMvVdSD7ewP30XiXVuch8Xfmj805Bx6P4qln/nhUe49oaqp49Jyb4b1OrcfTn/Of3O2uqPB3QYRvfsy36HkojU3fW1/UYJgDXY/olIeVoKSckK2iaoZluViHGlHZNv0d0Rpz4K5iM4GEwhiDIh6jpE8fm7q2WH+caU7BV8kz/+sXH6hw6bLO1x+jp1YU2ZA9rBYC45XiwXeD/AnPRvx8jZneyAX0y+tNKjc84XJxmMJP4h7ifLqLXIU/UP6DjvuucNoiNOckFYazwUWdt12fCi2UZFAriLFJbFm5O44Bf5Tc+MRm5kVgX4z0NAqKO8NQ2sV4SDwpVgL8t6k9lKeTOHzA2FaVL3yGdNN8I1i7F3kTnRnTCNKeCVtCKQ7gaW9l2N9ylWyDiXKPzbshGAaNWOrxZJXRFYDezNEUpCwq0Mk+AHeJ4Mo9hXjWKTMQiq1gE2nd/Gecyk//80wzzVuB3M7iQNzTG/NkIH6AtdgaAoSG1QPkLjqa0CH7QYA/43LGesmfnDGI9KFrdifN59OZY+fMDV49FnlpMkXghrjZDD+a/SKggE/wVIFKL53hb4auDF1iSPilMZDVbXB0+Pc2cZHV6Gbq5yb9omrYA48EuM0IH2PJrov+TiPnG2ZZY= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 6:PB7aMbLusT2PE0OH0OD3Fz86GZF25iHgLWj3FsW9a+mVqiJ+wwM+vAU89jwR+A7rDyAjNwR+b1KCHaVeNUNaWWhIwxV3kmCGfDcc2Nc0cwerNQhREYyo1Vu1LOwuyyQm6IBubD9zociEHPKDuhuK7TiLJjRAazCFZhYPd7ETadmPm9g5/9+/60yfQrfAUFcJCEowOEL7E5SIt9XYD8rlRQC4UWSGhsIRjPKQ9oczl37b557VT7j0D6R55mGXBAOqkqem4IhiT1t6FgUPSxwEH8hZwkSMu/EEvV0n8cqsp9gvOtslnXCo5LYYih0iVzqNb/hyBXy3vD6VvLy+JAZ7w80Xdn0MFo7ezKhRrk5HI/LVjfLHRnH7gqCzQyA0ooXjrfbx9RqV5144FExSZTVMSDB3DiCeRKIcEOYlHT8RtVg=; 5:XCoELcHkJjbTKLhf7megZ4eFVs02nHVRTRp04kbZAY9l691laDKwbjxe1HDupchLUA3kVPfS9aXidICeru8SP/tz9yQqJrQKxYsQEpGlo/82YNLPXuYzie5ZWtWwuOBVM+v+Lry+OJmck7w1MQwv4Q==; 24:0F4nQeGcqsccb2UqsnCiiPHEahDS2n0eyDyEfWyF/qGyVWsd2CVyLe65dH8i6asHQKTmUURRwy51728eYNlKItXd3zLhomZi+OnpKgE9Yvw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1714; 7:ayvSm//U4jufHfK1vTGCB+PKx2XlSAe7JDwIaJHn0udkg7fdNdju76w/BZWTEjZ53Vs6tyDx+K/pm9lb7SuYPX2mJ6x73gzo71othxKY1Weyi1a2BYzVlXfaZxFLZKcWuX394knFdDMrQg9DYp0XbAIHsh5FBp5arfukYGabi6cdibKEXoUmmRdfcnpk98Ez8Xlcmj3tm+7HiJQY/MIRoxf/G7DyiGt/Jvy3arBBeHhDoDQzjl03y7L050cOZppXdibzL/NWAMtprDP+Sf7SXyDkADoMCIKvPadFWWjWlqgWsE1ejv/B4CXIRZVenZZWju7bHnfbAbtJLAy0SGey50L0AzY5Q9ZE5i4SZfc+7fgVSnB2g3dSujOP7l70IabHAX/scWFc3/UDrOEdXO2mjxvBby0zJr8RdHGuzhuAU0uNNxYjE+xhBjAeuAb1KDTs4usahYuixeJxoaKUS3prhw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2017 09:18:58.6210 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1714 Subject: [dpdk-dev] [PATCH v3 10/29] eal: introduce I/O device memory read/write operations X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This commit introduces 8-bit, 16-bit, 32bit, 64bit I/O device memory read/write operations along with the relaxed versions. The weakly-ordered machine like ARM needs additional I/O barrier for device memory read/write access over PCI bus. By introducing the eal abstraction for I/O device memory read/write access, The drivers can access I/O device memory in architecture agnostic manner. The relaxed version does not have additional I/O memory barrier, useful in accessing the device registers of integrated controllers which implicitly strongly ordered with respect to memory access. Signed-off-by: Jerin Jacob --- doc/api/doxy-api-index.md | 3 +- lib/librte_eal/common/Makefile | 3 +- lib/librte_eal/common/include/generic/rte_io.h | 263 +++++++++++++++++++++++++ 3 files changed, 267 insertions(+), 2 deletions(-) create mode 100644 lib/librte_eal/common/include/generic/rte_io.h diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md index d26d984..8b3b426 100644 --- a/doc/api/doxy-api-index.md +++ b/doc/api/doxy-api-index.md @@ -71,7 +71,8 @@ There are many libraries, so their headers may be grouped by topics: [cache prefetch] (@ref rte_prefetch.h), [SIMD] (@ref rte_vect.h), [byte order] (@ref rte_byteorder.h), - [CPU flags] (@ref rte_cpuflags.h) + [CPU flags] (@ref rte_cpuflags.h), + [I/O access] (@ref rte_io.h) - **CPU multicore**: [interrupts] (@ref rte_interrupts.h), diff --git a/lib/librte_eal/common/Makefile b/lib/librte_eal/common/Makefile index 09a3d3a..b34dce9 100644 --- a/lib/librte_eal/common/Makefile +++ b/lib/librte_eal/common/Makefile @@ -44,7 +44,8 @@ INC += rte_malloc.h rte_keepalive.h rte_time.h GENERIC_INC := rte_atomic.h rte_byteorder.h rte_cycles.h rte_prefetch.h GENERIC_INC += rte_spinlock.h rte_memcpy.h rte_cpuflags.h rte_rwlock.h -GENERIC_INC += rte_vect.h +GENERIC_INC += rte_vect.h rte_io.h + # defined in mk/arch/$(RTE_ARCH)/rte.vars.mk ARCH_DIR ?= $(RTE_ARCH) ARCH_INC := $(notdir $(wildcard $(RTE_SDK)/lib/librte_eal/common/include/arch/$(ARCH_DIR)/*.h)) diff --git a/lib/librte_eal/common/include/generic/rte_io.h b/lib/librte_eal/common/include/generic/rte_io.h new file mode 100644 index 0000000..edfebf8 --- /dev/null +++ b/lib/librte_eal/common/include/generic/rte_io.h @@ -0,0 +1,263 @@ +/* + * BSD LICENSE + * + * Copyright(c) 2016 Cavium networks. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Cavium networks nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _RTE_IO_H_ +#define _RTE_IO_H_ + +/** + * @file + * I/O device memory operations + * + * This file defines the generic API for I/O device memory read/write operations + */ + +#include +#include +#include + +#ifdef __DOXYGEN__ + +/** + * Read a 8-bit value from I/O device memory address *addr*. + * + * The relaxed version does not have additional I/O memory barrier, useful in + * accessing the device registers of integrated controllers which implicitly + * strongly ordered with respect to memory access. + * + * @param addr + * I/O memory address to read the value from + * @return + * read value + */ +static inline uint8_t +rte_read8_relaxed(const volatile void *addr); + +/** + * Read a 16-bit value from I/O device memory address *addr*. + * + * The relaxed version does not have additional I/O memory barrier, useful in + * accessing the device registers of integrated controllers which implicitly + * strongly ordered with respect to memory access. + * + * @param addr + * I/O memory address to read the value from + * @return + * read value + */ +static inline uint16_t +rte_read16_relaxed(const volatile void *addr); + +/** + * Read a 32-bit value from I/O device memory address *addr*. + * + * The relaxed version does not have additional I/O memory barrier, useful in + * accessing the device registers of integrated controllers which implicitly + * strongly ordered with respect to memory access. + * + * @param addr + * I/O memory address to read the value from + * @return + * read value + */ +static inline uint32_t +rte_read32_relaxed(const volatile void *addr); + +/** + * Read a 64-bit value from I/O device memory address *addr*. + * + * The relaxed version does not have additional I/O memory barrier, useful in + * accessing the device registers of integrated controllers which implicitly + * strongly ordered with respect to memory access. + * + * @param addr + * I/O memory address to read the value from + * @return + * read value + */ +static inline uint64_t +rte_read64_relaxed(const volatile void *addr); + +/** + * Write a 8-bit value to I/O device memory address *addr*. + * + * The relaxed version does not have additional I/O memory barrier, useful in + * accessing the device registers of integrated controllers which implicitly + * strongly ordered with respect to memory access. + * + * @param value + * Value to write + * @param addr + * I/O memory address to write the value to + */ + +static inline void +rte_write8_relaxed(uint8_t value, volatile void *addr); + +/** + * Write a 16-bit value to I/O device memory address *addr*. + * + * The relaxed version does not have additional I/O memory barrier, useful in + * accessing the device registers of integrated controllers which implicitly + * strongly ordered with respect to memory access. + * + * @param value + * Value to write + * @param addr + * I/O memory address to write the value to + */ +static inline void +rte_write16_relaxed(uint16_t value, volatile void *addr); + +/** + * Write a 32-bit value to I/O device memory address *addr*. + * + * The relaxed version does not have additional I/O memory barrier, useful in + * accessing the device registers of integrated controllers which implicitly + * strongly ordered with respect to memory access. + * + * @param value + * Value to write + * @param addr + * I/O memory address to write the value to + */ +static inline void +rte_write32_relaxed(uint32_t value, volatile void *addr); + +/** + * Write a 64-bit value to I/O device memory address *addr*. + * + * The relaxed version does not have additional I/O memory barrier, useful in + * accessing the device registers of integrated controllers which implicitly + * strongly ordered with respect to memory access. + * + * @param value + * Value to write + * @param addr + * I/O memory address to write the value to + */ +static inline void +rte_write64_relaxed(uint64_t value, volatile void *addr); + +/** + * Read a 8-bit value from I/O device memory address *addr*. + * + * @param addr + * I/O memory address to read the value from + * @return + * read value + */ +static inline uint8_t +rte_read8(const volatile void *addr); + +/** + * Read a 16-bit value from I/O device memory address *addr*. + * + * + * @param addr + * I/O memory address to read the value from + * @return + * read value + */ +static inline uint16_t +rte_read16(const volatile void *addr); + +/** + * Read a 32-bit value from I/O device memory address *addr*. + * + * @param addr + * I/O memory address to read the value from + * @return + * read value + */ +static inline uint32_t +rte_read32(const volatile void *addr); + +/** + * Read a 64-bit value from I/O device memory address *addr*. + * + * @param addr + * I/O memory address to read the value from + * @return + * read value + */ +static inline uint64_t +rte_read64(const volatile void *addr); + +/** + * Write a 8-bit value to I/O device memory address *addr*. + * + * @param value + * Value to write + * @param addr + * I/O memory address to write the value to + */ + +static inline void +rte_write8(uint8_t value, volatile void *addr); + +/** + * Write a 16-bit value to I/O device memory address *addr*. + * + * @param value + * Value to write + * @param addr + * I/O memory address to write the value to + */ +static inline void +rte_write16(uint16_t value, volatile void *addr); + +/** + * Write a 32-bit value to I/O device memory address *addr*. + * + * @param value + * Value to write + * @param addr + * I/O memory address to write the value to + */ +static inline void +rte_write32(uint32_t value, volatile void *addr); + +/** + * Write a 64-bit value to I/O device memory address *addr*. + * + * @param value + * Value to write + * @param addr + * I/O memory address to write the value to + */ +static inline void +rte_write64(uint64_t value, volatile void *addr); + +#endif /* __DOXYGEN__ */ + +#endif /* _RTE_IO_H_ */