opnsense-src/sys/dev/advansys
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
..
adv_eisa.c Add locking to adv(4) driver and mark it MPSAFE. 2012-10-12 21:31:44 +00:00
adv_isa.c Use uintmax_t (typedef'd to rman_res_t type) for rman ranges. 2016-03-18 01:28:41 +00:00
adv_pci.c Add locking to adv(4) driver and mark it MPSAFE. 2012-10-12 21:31:44 +00:00
advansys.c Prevent overflow issues in timeout processing 2014-11-21 21:01:24 +00:00
advansys.h Add locking to adv(4) driver and mark it MPSAFE. 2012-10-12 21:31:44 +00:00
advlib.c Remove instances of variables that were set, but never used. gcc 4.9 2014-03-30 23:43:36 +00:00
advlib.h Add locking to adv(4) driver and mark it MPSAFE. 2012-10-12 21:31:44 +00:00
advmcode.c Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
advmcode.h Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
adw_pci.c Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCI 2013-08-12 23:30:01 +00:00
adwcam.c Remove MAXBSIZE use from drivers where it has nothing to do. 2015-03-22 16:10:28 +00:00
adwlib.c Add locking to the adw(4) driver and mark it MPSAFE. 2012-10-15 15:26:00 +00:00
adwlib.h Add locking to the adw(4) driver and mark it MPSAFE. 2012-10-15 15:26:00 +00:00
adwmcode.c Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
adwmcode.h Start each of the license/copyright comments with /*-, minor shuffle of lines 2005-01-06 01:43:34 +00:00
adwvar.h Add locking to the adw(4) driver and mark it MPSAFE. 2012-10-15 15:26:00 +00:00