From: Alexander Gordeev <agordeev@redhat.com>
To: kvm@vger.kernel.org
Cc: Alexander Gordeev <agordeev@redhat.com>,
Thomas Huth <thuth@redhat.com>, Andrew Jones <drjones@redhat.com>,
Peter Xu <peterx@redhat.com>
Subject: [kvm-unit-tests PATCH v11 02/12] pci: x86: Rename pci_config_read() to pci_config_readl()
Date: Mon, 7 Nov 2016 11:14:34 +0100 [thread overview]
Message-ID: <c13b07e15d2ffa2823894bc83be62de400f29e98.1478512824.git.agordeev@redhat.com> (raw)
In-Reply-To: <cover.1478512824.git.agordeev@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Cc: Andrew Jones <drjones@redhat.com>
Cc: Peter Xu <peterx@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
---
lib/pci.c | 8 ++++----
lib/x86/asm/pci.h | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/pci.c b/lib/pci.c
index 43cd0ea4f2fa..e0b4514244f6 100644
--- a/lib/pci.c
+++ b/lib/pci.c
@@ -13,7 +13,7 @@ pcidevaddr_t pci_find_dev(uint16_t vendor_id, uint16_t device_id)
pcidevaddr_t dev;
for (dev = 0; dev < 256; ++dev) {
- uint32_t id = pci_config_read(dev, 0);
+ uint32_t id = pci_config_readl(dev, 0);
if ((id & 0xFFFF) == vendor_id && (id >> 16) == device_id)
return dev;
@@ -24,7 +24,7 @@ pcidevaddr_t pci_find_dev(uint16_t vendor_id, uint16_t device_id)
unsigned long pci_bar_addr(pcidevaddr_t dev, int bar_num)
{
- uint32_t bar = pci_config_read(dev, PCI_BASE_ADDRESS_0 + bar_num * 4);
+ uint32_t bar = pci_config_readl(dev, PCI_BASE_ADDRESS_0 + bar_num * 4);
if (bar & PCI_BASE_ADDRESS_SPACE_IO)
return bar & PCI_BASE_ADDRESS_IO_MASK;
@@ -34,12 +34,12 @@ unsigned long pci_bar_addr(pcidevaddr_t dev, int bar_num)
bool pci_bar_is_memory(pcidevaddr_t dev, int bar_num)
{
- uint32_t bar = pci_config_read(dev, PCI_BASE_ADDRESS_0 + bar_num * 4);
+ uint32_t bar = pci_config_readl(dev, PCI_BASE_ADDRESS_0 + bar_num * 4);
return !(bar & PCI_BASE_ADDRESS_SPACE_IO);
}
bool pci_bar_is_valid(pcidevaddr_t dev, int bar_num)
{
- return pci_config_read(dev, PCI_BASE_ADDRESS_0 + bar_num * 4);
+ return pci_config_readl(dev, PCI_BASE_ADDRESS_0 + bar_num * 4);
}
diff --git a/lib/x86/asm/pci.h b/lib/x86/asm/pci.h
index cddde41a7d97..d00438fe91e4 100644
--- a/lib/x86/asm/pci.h
+++ b/lib/x86/asm/pci.h
@@ -9,7 +9,7 @@
#include "pci.h"
#include "x86/asm/io.h"
-static inline uint32_t pci_config_read(pcidevaddr_t dev, uint8_t reg)
+static inline uint32_t pci_config_readl(pcidevaddr_t dev, uint8_t reg)
{
uint32_t index = reg | (dev << 8) | (0x1 << 31);
outl(index, 0xCF8);
--
1.8.3.1
next prev parent reply other threads:[~2016-11-07 10:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-07 10:14 [kvm-unit-tests PATCH v11 00/12] PCI bus support Alexander Gordeev
2016-11-07 10:14 ` [kvm-unit-tests PATCH v11 01/12] pci: Fix coding style in generic PCI files Alexander Gordeev
2016-11-07 10:14 ` Alexander Gordeev [this message]
2016-11-07 10:14 ` [kvm-unit-tests PATCH v11 03/12] pci: Add 'extern' to public function declarations Alexander Gordeev
2016-11-07 10:14 ` [kvm-unit-tests PATCH v11 04/12] pci: x86: Add remaining PCI configuration space accessors Alexander Gordeev
2016-11-07 10:14 ` [kvm-unit-tests PATCH v11 05/12] pci: Factor out pci_bar_get() Alexander Gordeev
2016-11-07 10:14 ` [kvm-unit-tests PATCH v11 06/12] pci: Rework pci_bar_addr() Alexander Gordeev
2016-11-07 10:14 ` [kvm-unit-tests PATCH v11 07/12] pci: Add pci_bar_set_addr() Alexander Gordeev
2016-11-07 10:14 ` [kvm-unit-tests PATCH v11 08/12] pci: Add pci_dev_exists() Alexander Gordeev
2016-11-07 10:14 ` [kvm-unit-tests PATCH v11 09/12] pci: Add pci_print() Alexander Gordeev
2016-11-07 10:14 ` [kvm-unit-tests PATCH v11 10/12] pci: Add generic ECAM host support Alexander Gordeev
2016-11-07 11:51 ` Andrew Jones
2016-11-07 10:14 ` [kvm-unit-tests PATCH v11 11/12] pci: Add pci-testdev PCI bus test device Alexander Gordeev
2016-11-07 10:14 ` [kvm-unit-tests PATCH v11 12/12] arm/arm64: pci: Add pci-testdev PCI device operation test Alexander Gordeev
2016-11-07 11:55 ` [kvm-unit-tests PATCH v11 00/12] PCI bus support Andrew Jones
2016-11-08 22:25 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c13b07e15d2ffa2823894bc83be62de400f29e98.1478512824.git.agordeev@redhat.com \
--to=agordeev@redhat.com \
--cc=drjones@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=peterx@redhat.com \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).