aboutsummaryrefslogtreecommitdiff
path: root/sys/arm64
diff options
context:
space:
mode:
authorJustin Hibbits <jhibbits@FreeBSD.org>2016-02-20 01:32:58 +0000
committerJustin Hibbits <jhibbits@FreeBSD.org>2016-02-20 01:32:58 +0000
commit7915adb56014e31e8ed8a4418060625c2e223fc0 (patch)
tree1d99680c416ab999716f7e3fb78956be8804e81f /sys/arm64
parent2bc4747cc49351d47d2bdacd5c5d82bf4b44474b (diff)
Notes
Diffstat (limited to 'sys/arm64')
-rw-r--r--sys/arm64/arm64/gic_fdt.c2
-rw-r--r--sys/arm64/arm64/gic_v3_fdt.c3
-rw-r--r--sys/arm64/arm64/nexus.c2
-rw-r--r--sys/arm64/cavium/thunder_pcie.c2
-rw-r--r--sys/arm64/cavium/thunder_pcie_fdt.c2
-rw-r--r--sys/arm64/cavium/thunder_pcie_pem.c2
6 files changed, 7 insertions, 6 deletions
diff --git a/sys/arm64/arm64/gic_fdt.c b/sys/arm64/arm64/gic_fdt.c
index 075f1d6b8523..34d8009ad223 100644
--- a/sys/arm64/arm64/gic_fdt.c
+++ b/sys/arm64/arm64/gic_fdt.c
@@ -211,7 +211,7 @@ arm_gic_fdt_alloc_resource(device_t bus, device_t child, int type, int *rid,
* Request for the default allocation with a given rid: use resource
* list stored in the local device info.
*/
- if ((start == 0UL) && (end == ~0UL)) {
+ if (RMAN_IS_DEFAULT_RANGE(start, end)) {
if ((di = device_get_ivars(child)) == NULL)
return (NULL);
diff --git a/sys/arm64/arm64/gic_v3_fdt.c b/sys/arm64/arm64/gic_v3_fdt.c
index 6c8de4929caf..e5d75c3c0db9 100644
--- a/sys/arm64/arm64/gic_v3_fdt.c
+++ b/sys/arm64/arm64/gic_v3_fdt.c
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
#include <sys/bus.h>
#include <sys/kernel.h>
#include <sys/module.h>
+#include <sys/rman.h>
#include <machine/resource.h>
@@ -180,7 +181,7 @@ gic_v3_ofw_bus_alloc_res(device_t bus, device_t child, int type, int *rid,
struct resource_list_entry *rle;
int ranges_len;
- if ((start == 0UL) && (end == ~0UL)) {
+ if (RMAN_IS_DEFAULT_RANGE(start, end)) {
if ((di = device_get_ivars(child)) == NULL)
return (NULL);
if (type != SYS_RES_MEMORY)
diff --git a/sys/arm64/arm64/nexus.c b/sys/arm64/arm64/nexus.c
index c56c7aa83439..94b904873409 100644
--- a/sys/arm64/arm64/nexus.c
+++ b/sys/arm64/arm64/nexus.c
@@ -223,7 +223,7 @@ nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,
* (ie. they aren't maintained by a child bus), then work out
* the start/end values.
*/
- if ((start == 0UL) && (end == ~0UL) && (count == 1)) {
+ if (RMAN_IS_DEFAULT_RANGE(start, end) && (count == 1)) {
if (device_get_parent(child) != bus || ndev == NULL)
return(NULL);
rle = resource_list_find(&ndev->nx_resources, type, *rid);
diff --git a/sys/arm64/cavium/thunder_pcie.c b/sys/arm64/cavium/thunder_pcie.c
index ca2fd6f7ea68..b4ac43c88ef4 100644
--- a/sys/arm64/cavium/thunder_pcie.c
+++ b/sys/arm64/cavium/thunder_pcie.c
@@ -292,7 +292,7 @@ thunder_pcie_alloc_resource(device_t dev, device_t child, int type, int *rid,
type, rid, start, end, count, flags));
};
- if ((start == 0UL) && (end == ~0UL)) {
+ if (RMAN_IS_DEFAULT_RANGE(start, end)) {
/* Read BAR manually to get resource address and size */
pci_read_bar(child, *rid, &map, &testval, NULL);
diff --git a/sys/arm64/cavium/thunder_pcie_fdt.c b/sys/arm64/cavium/thunder_pcie_fdt.c
index f1624f615484..09b56602d74a 100644
--- a/sys/arm64/cavium/thunder_pcie_fdt.c
+++ b/sys/arm64/cavium/thunder_pcie_fdt.c
@@ -283,7 +283,7 @@ thunder_pcie_ofw_bus_alloc_res(device_t bus, device_t child, int type, int *rid,
sc = device_get_softc(bus);
- if ((start == 0UL) && (end == ~0UL)) {
+ if (RMAN_IS_DEFAULT_RANGE(start, end)) {
if ((di = device_get_ivars(child)) == NULL)
return (NULL);
if (type == SYS_RES_IOPORT)
diff --git a/sys/arm64/cavium/thunder_pcie_pem.c b/sys/arm64/cavium/thunder_pcie_pem.c
index a7138dc70870..0f1e6a31b7fb 100644
--- a/sys/arm64/cavium/thunder_pcie_pem.c
+++ b/sys/arm64/cavium/thunder_pcie_pem.c
@@ -435,7 +435,7 @@ thunder_pem_alloc_resource(device_t dev, device_t child, int type, int *rid,
end, count, flags));
};
- if ((start == 0UL) && (end == ~0UL)) {
+ if (RMAN_IS_DEFAULT_RANGE(start, end)) {
device_printf(dev,
"Cannot allocate resource with unspecified range\n");
goto fail;