diff options
author | William Breathitt Gray <vilhelm.gray@gmail.com> | 2016-05-01 18:43:10 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-05-02 09:32:04 -0700 |
commit | d9a9c6172d1cec51851e9015b6c4379635c31f1a (patch) | |
tree | b30d1e4e703e43daa93644c16141c1816ef9f1b5 /include/linux/isa.h | |
parent | 339e6e31d2bfb40354cbfe672b357b88a88223f2 (diff) | |
download | blackbird-op-linux-d9a9c6172d1cec51851e9015b6c4379635c31f1a.tar.gz blackbird-op-linux-d9a9c6172d1cec51851e9015b6c4379635c31f1a.zip |
isa: Implement the max_num_isa_dev macro
max_num_isa_dev is a macro to determine the maximum possible number of
ISA devices which may be registered in the I/O port address space given
the address extent of the ISA devices.
The highest base address possible for an ISA device is 0x3FF; this
results in 1024 possible base addresses. Dividing the number of possible
base addresses by the address extent taken by each device results in the
maximum number of devices on a system.
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/isa.h')
-rw-r--r-- | include/linux/isa.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/isa.h b/include/linux/isa.h index e394917d18c2..5ab85281230b 100644 --- a/include/linux/isa.h +++ b/include/linux/isa.h @@ -57,4 +57,15 @@ static void __exit __isa_driver##_exit(void) \ } \ module_exit(__isa_driver##_exit); +/** + * max_num_isa_dev() - Maximum possible number registered of an ISA device + * @__ida_dev_ext: ISA device address extent + * + * The highest base address possible for an ISA device is 0x3FF; this results in + * 1024 possible base addresses. Dividing the number of possible base addresses + * by the address extent taken by each device results in the maximum number of + * devices on a system. + */ +#define max_num_isa_dev(__isa_dev_ext) (1024 / __isa_dev_ext) + #endif /* __LINUX_ISA_H */ |