diff options
author | marcel <marcel@FreeBSD.org> | 2003-09-07 21:51:03 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2003-09-07 21:51:03 +0000 |
commit | 99d0e6c9d5d310d7f4c4558288e881c89b3fdf78 (patch) | |
tree | 22e0d3f0111ac1127e824ebbf9c76d4238693f5f /sys/dev/uart/uart_dev_z8530.c | |
parent | 49215d6199e1f0cf0b9f639b2113118e61c3180d (diff) | |
download | FreeBSD-src-99d0e6c9d5d310d7f4c4558288e881c89b3fdf78.zip FreeBSD-src-99d0e6c9d5d310d7f4c4558288e881c89b3fdf78.tar.gz |
Remove the assumption that a bus_space_handle_t is an I/O address
from the SAB82532 and the Z8530 hardware drivers by introducing
uart_cpu_busaddr(). The assumption is not true on pc98 where
bus_space_handle_t is a pointer to a structure.
The uart_cpu_busaddr() function will return the bus address
corresponding the tag and handle given to it by the BAS.
WARNING: the intend of the function is STRICTLY to allow hardware
drivers to determine which logical channel they control and is NOT
to be used for actual I/O. It is therefore EXPLICITLY allowed that
uart_cpu_busaddr() returns only the lower 8 bits of the address
and garbage in all other bits. No mistakes...
Diffstat (limited to 'sys/dev/uart/uart_dev_z8530.c')
-rw-r--r-- | sys/dev/uart/uart_dev_z8530.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/uart/uart_dev_z8530.c b/sys/dev/uart/uart_dev_z8530.c index 498b3a3..a7c6e25 100644 --- a/sys/dev/uart/uart_dev_z8530.c +++ b/sys/dev/uart/uart_dev_z8530.c @@ -42,8 +42,8 @@ __FBSDID("$FreeBSD$"); #define DEFAULT_RCLK 307200 -#define IS_CHANNEL_A(bas) (((bas)->bsh & 7) != 0) -#define IS_CHANNEL_B(bas) (((bas)->bsh & 7) == 0) +#define IS_CHANNEL_A(bas) ((uart_cpu_busaddr(bas) & 7) != 0) +#define IS_CHANNEL_B(bas) ((uart_cpu_busaddr(bas) & 7) == 0) /* Multiplexed I/O. */ static __inline void |