summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2023-01-29 23:49:06 +0100
committerPali Rohár <pali@kernel.org>2023-01-29 23:49:06 +0100
commit3444b81f6b0e83eacb391e10b41f9a7b60e66f4e (patch)
tree163017329794fe9b6bee9431c325c5b56fcb7d90
parent5abf19113f5fa88817d6f6e3f190c40205c46b8d (diff)
downloadpciutils-3444b81f6b0e83eacb391e10b41f9a7b60e66f4e.tar.gz
libpci: mmio-ports: Fix support for 64-bit non-LLP64 systems
On 64-bit non-LLP64 systems is type long 64-bit. On 32-bit and 64-bit LLP64 systems is type long only 32-bit. But readl() and writel() functions works with 32-bit PCI word. Fix it for non-LLP64 systems by using type u32.
-rw-r--r--lib/mmio-ports.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/mmio-ports.c b/lib/mmio-ports.c
index c8e5f8c..a9e23c3 100644
--- a/lib/mmio-ports.c
+++ b/lib/mmio-ports.c
@@ -124,9 +124,9 @@ writew(unsigned short value, volatile void *addr)
}
static void
-writel(unsigned long value, volatile void *addr)
+writel(u32 value, volatile void *addr)
{
- *(volatile unsigned long *)addr = value;
+ *(volatile u32 *)addr = value;
}
static unsigned char
@@ -141,10 +141,10 @@ readw(volatile void *addr)
return *(volatile unsigned short *)addr;
}
-static unsigned long
+static u32
readl(volatile void *addr)
{
- return *(volatile unsigned long *)addr;
+ return *(volatile u32 *)addr;
}
static int