freebsd-nq/sys/dev/ofw
Justin Hibbits da1b038af9 Use uintmax_t (typedef'd to rman_res_t type) for rman ranges.
On some architectures, u_long isn't large enough for resource definitions.
Particularly, powerpc and arm allow 36-bit (or larger) physical addresses, but
type `long' is only 32-bit.  This extends rman's resources to uintmax_t.  With
this change, any resource can feasibly be placed anywhere in physical memory
(within the constraints of the driver).

Why uintmax_t and not something machine dependent, or uint64_t?  Though it's
possible for uintmax_t to grow, it's highly unlikely it will become 128-bit on
32-bit architectures.  64-bit architectures should have plenty of RAM to absorb
the increase on resource sizes if and when this occurs, and the number of
resources on memory-constrained systems should be sufficiently small as to not
pose a drastic overhead.  That being said, uintmax_t was chosen for source
clarity.  If it's specified as uint64_t, all printf()-like calls would either
need casts to uintmax_t, or be littered with PRI*64 macros.  Casts to uintmax_t
aren't horrible, but it would also bake into the API for
resource_list_print_type() either a hidden assumption that entries get cast to
uintmax_t for printing, or these calls would need the PRI*64 macros.  Since
source code is meant to be read more often than written, I chose the clearest
path of simply using uintmax_t.

Tested on a PowerPC p5020-based board, which places all device resources in
0xfxxxxxxxx, and has 8GB RAM.
Regression tested on qemu-system-i386
Regression tested on qemu-system-mips (malta profile)

Tested PAE and devinfo on virtualbox (live CD)

Special thanks to bz for his testing on ARM.

Reviewed By: bz, jhb (previous)
Relnotes:	Yes
Sponsored by:	Alex Perez/Inertial Computing
Differential Revision: https://reviews.freebsd.org/D4544
2016-03-18 01:28:41 +00:00
..
ofw_bus_if.m
ofw_bus_subr.c Teach ofw_bus_parse_xref_list_alloc to be able to return the length of the parsed list. 2016-02-09 03:35:40 +00:00
ofw_bus_subr.h Teach ofw_bus_parse_xref_list_alloc to be able to return the length of the parsed list. 2016-02-09 03:35:40 +00:00
ofw_bus.h
ofw_console.c
ofw_cpu.c Limit ofw_cpu_early_foreach() to CPUs only 2015-07-28 13:16:08 +00:00
ofw_cpu.h
ofw_disk.c
ofw_fdt.c Remove fdt_fixup_table from architectures where it's unneeded. We only make 2016-01-21 16:48:01 +00:00
ofw_if.m
ofw_iicbus.c Use EARLY_DRIVER_MODULE() with BUS_PASS_BUS priority for ofw_gpiobus 2016-03-15 15:24:18 +00:00
ofw_pci.h Revert r295756: 2016-02-20 12:28:20 +00:00
ofw_standard.c
ofw_subr.c Revert r295756: 2016-02-20 12:28:20 +00:00
ofw_subr.h Implement OF_decode_addr() for arm. Move most of powerpc's implementation 2015-12-21 18:07:32 +00:00
ofwbus.c Use uintmax_t (typedef'd to rman_res_t type) for rman ranges. 2016-03-18 01:28:41 +00:00
ofwvar.h
openfirm.c Do not destroy input buffer of the OF_getencprop() function on error 2016-01-25 14:42:44 +00:00
openfirm.h Allow callers of OF_decode_addr to get the size of the found mapping. This 2016-02-16 15:18:12 +00:00
openfirmio.c
openfirmio.h
openpromio.c
openpromio.h