freebsd-nq/sys/compat
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
..
cloudabi Call cap_rights_init() properly. 2016-02-24 10:54:26 +00:00
cloudabi64 Refactoring: move out generic bits from cloudabi64_sysvec.c. 2015-10-22 09:07:53 +00:00
freebsd32 Regen. 2016-03-12 22:55:07 +00:00
ia32 Implement vsyscall hack. Prior to 2.13 glibc uses vsyscall 2016-01-09 20:18:53 +00:00
linprocfs Implement /proc/$$/limits. 2016-02-21 14:56:05 +00:00
linsysfs Add support to the jail framework to be able to mount linsysfs(5) and 2015-07-19 08:52:35 +00:00
linux Add support for IPPROTO_IPV6 socket layer for getsockopt/setsockopt calls. 2016-03-09 09:12:40 +00:00
linuxkpi/common Run the LinuxKPI PCI shutdown handler free of the Giant mutex. 2016-03-07 14:35:31 +00:00
ndis Use uintmax_t (typedef'd to rman_res_t type) for rman ranges. 2016-03-18 01:28:41 +00:00
netbsd Remove some more NetBSD compat shims and other unused bits from these 2012-09-10 18:49:49 +00:00
svr4 As <machine/vmparam.h> is included from <vm/vm_param.h>, there is no 2016-02-22 09:08:04 +00:00
x86bios Silence VPS-Studio errors (V512). These buffer underflows are intentional. 2016-02-18 19:37:39 +00:00