From patchwork Fri Feb 26 06:22:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 63270 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1577926lbc; Mon, 29 Feb 2016 18:32:28 -0800 (PST) X-Received: by 10.107.164.145 with SMTP id d17mr21185687ioj.112.1456799521256; Mon, 29 Feb 2016 18:32:01 -0800 (PST) Return-Path: Received: from lists.xen.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id gb7si7275332igd.44.2016.02.29.18.32.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Feb 2016 18:32:00 -0800 (PST) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1aZBp5-000659-VU; Fri, 26 Feb 2016 06:24:19 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1aZBp4-00064v-JQ for xen-devel@lists.xen.org; Fri, 26 Feb 2016 06:24:18 +0000 Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id C2/16-03301-19FEFC65; Fri, 26 Feb 2016 06:24:17 +0000 X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-7.tower-27.messagelabs.com!1456467851!26844942!1 X-Originating-IP: [119.145.14.65] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTE5LjE0NS4xNC42NSA9PiA3NzQ2Mw==\n X-StarScan-Received: X-StarScan-Version: 8.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 25995 invoked from network); 26 Feb 2016 06:24:16 -0000 Received: from szxga02-in.huawei.com (HELO szxga02-in.huawei.com) (119.145.14.65) by server-7.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 26 Feb 2016 06:24:16 -0000 Received: from 172.24.1.47 (EHLO SZXEML429-HUB.china.huawei.com) ([172.24.1.47]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DBZ31778; Fri, 26 Feb 2016 14:23:57 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by SZXEML429-HUB.china.huawei.com (10.82.67.184) with Microsoft SMTP Server id 14.3.235.1; Fri, 26 Feb 2016 14:23:49 +0800 From: Shannon Zhao To: Date: Fri, 26 Feb 2016 14:22:39 +0800 Message-ID: <1456467780-8476-2-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1456467780-8476-1-git-send-email-zhaoshenglong@huawei.com> References: <1456467780-8476-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090201.56CFEF7E.008C, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: c308ff7db8c38d9aa460c63a2c2c42a9 Cc: peter.huangpeng@huawei.com, stefano.stabellini@citrix.com, ian.campbell@citrix.com, shannon.zhao@linaro.org Subject: [Xen-devel] [PATCH v5 01/22] arm/acpi: Emulate io ports for arm X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" From: Shannon Zhao Add macros to emulate x86 style ports for arm. This avoids modification in common code for acpi. Here just print a warning on ARM. Signed-off-by: Shannon Zhao --- V5: not write to the address, just print warning V4: print warning --- xen/include/asm-arm/arm64/io.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/xen/include/asm-arm/arm64/io.h b/xen/include/asm-arm/arm64/io.h index 37abc47..f80156f 100644 --- a/xen/include/asm-arm/arm64/io.h +++ b/xen/include/asm-arm/arm64/io.h @@ -20,6 +20,7 @@ #ifndef _ARM_ARM64_IO_H #define _ARM_ARM64_IO_H +#include #include /* @@ -109,4 +110,26 @@ static inline u64 __raw_readq(const volatile void __iomem *addr) #define writel(v,c) ({ __iowmb(); writel_relaxed((v),(c)); }) #define writeq(v,c) ({ __iowmb(); writeq_relaxed((v),(c)); }) +/* + * Emulate x86 io ports for ARM. + */ +static inline int emulate_read(u64 addr) +{ + printk(XENLOG_G_WARNING "Can't access IO %lx\n", addr); + return 0; +} + +static inline void emulate_write(u64 addr) +{ + printk(XENLOG_G_WARNING "Can't access IO %lx\n", addr); +} + +#define inb(c) ( emulate_read(c) ) +#define inw(c) ( emulate_read(c) ) +#define inl(c) ( emulate_read(c) ) + +#define outb(v, c) ( emulate_write(c) ) +#define outw(v, c) ( emulate_write(c) ) +#define outl(v, c) ( emulate_write(c) ) + #endif /* _ARM_ARM64_IO_H */