summaryrefslogtreecommitdiffstats
path: root/sys/dev/fdt/fdt_common.c
diff options
context:
space:
mode:
authorandrew <andrew@FreeBSD.org>2016-03-01 11:39:07 +0000
committerandrew <andrew@FreeBSD.org>2016-03-01 11:39:07 +0000
commitf5009ab96f95675190ec64e737eee2590f029ad0 (patch)
tree68ccbeb72be10a34376c8e15fdaa34ec2818d2e8 /sys/dev/fdt/fdt_common.c
parentfa1857f11586cb976c4962c4748f7b39cb3d96d2 (diff)
downloadFreeBSD-src-f5009ab96f95675190ec64e737eee2590f029ad0.zip
FreeBSD-src-f5009ab96f95675190ec64e737eee2590f029ad0.tar.gz
Make the memory size returned from fdt_get_mem_regions a 64-bit type. This
is the physical memory size so may be larger than a u_long can hold, e.g. on ARM with LPAE we could see an address space of up to 40 bits. On ARM u_long is only 32 bits so the memory size will be truncated, possibly to zero. Reported by: bz Sponsored by: ABT Systems Ltd
Diffstat (limited to 'sys/dev/fdt/fdt_common.c')
-rw-r--r--sys/dev/fdt/fdt_common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/fdt/fdt_common.c b/sys/dev/fdt/fdt_common.c
index b435551..6211aca 100644
--- a/sys/dev/fdt/fdt_common.c
+++ b/sys/dev/fdt/fdt_common.c
@@ -647,12 +647,12 @@ out:
}
int
-fdt_get_mem_regions(struct mem_region *mr, int *mrcnt, u_long *memsize)
+fdt_get_mem_regions(struct mem_region *mr, int *mrcnt, uint64_t *memsize)
{
pcell_t reg[FDT_REG_CELLS * FDT_MEM_REGIONS];
pcell_t *regp;
phandle_t memory;
- u_long memory_size;
+ uint64_t memory_size;
int addr_cells, size_cells;
int i, max_size, reg_len, rv, tuple_size, tuples;
OpenPOWER on IntegriCloud