diff options
author | Bruce Evans <bde@FreeBSD.org> | 1998-11-23 13:58:55 +0000 |
---|---|---|
committer | Bruce Evans <bde@FreeBSD.org> | 1998-11-23 13:58:55 +0000 |
commit | 976d09b9f24624cbba422fa49cfdba565dac4577 (patch) | |
tree | bd08c04136263f59ae2475a7b3052437b0c1c3c5 /sys/i386/isa/cyreg.h | |
parent | aa045fa499198eb2eb8470a800289fd6c40cff0d (diff) | |
download | src-976d09b9f24624cbba422fa49cfdba565dac4577.tar.gz src-976d09b9f24624cbba422fa49cfdba565dac4577.zip |
Untangled the Cyclades offsets a little. CY16_RESET and CY_CLEAR_INTR
were half of their physical offsets for ISA and 1/4 of their physical
offsets for PCI, while all other Cyclades offsets were physical/1 for
ISA and physical/2 for PCI. Logically wrong macros were used to scale
CY16_RESET and CY_CLEAR_INTR to the correct physical offsets.
Fixed some style bugs (mostly long lines).
Notes
Notes:
svn path=/head/; revision=41309
Diffstat (limited to 'sys/i386/isa/cyreg.h')
-rw-r--r-- | sys/i386/isa/cyreg.h | 46 |
1 files changed, 32 insertions, 14 deletions
diff --git a/sys/i386/isa/cyreg.h b/sys/i386/isa/cyreg.h index d98cfd80ece0..baedda4175b2 100644 --- a/sys/i386/isa/cyreg.h +++ b/sys/i386/isa/cyreg.h @@ -26,32 +26,50 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cyreg.h,v 1.6 1998/08/13 13:54:10 bde Exp $ + * $Id: cyreg.h,v 1.7 1998/08/13 19:03:22 bde Exp $ */ /* * Definitions for Cyclades Cyclom-Y serial boards. */ -#define CY8_SVCACKR 0x100 -#define CY8_SVCACKT 0x200 -#define CY8_SVCACKM 0x300 -#define CY16_RESET 0x0a00 -#define CY_CLEAR_INTR 0x0c00 /* intr ack address */ +/* + * Cyclades register offsets. These are physical offsets for ISA boards + * and physical offsets divided by 2 for PCI boards. + */ +#define CY8_SVCACKR 0x100 /* (r) */ +#define CY8_SVCACKT 0x200 /* (r) */ +#define CY8_SVCACKM 0x300 /* (r) */ +#define CY16_RESET 0x1400 /* (r) */ +#define CY_CLEAR_INTR 0x1800 /* intr ack address (w) */ #define CY_MAX_CD1400s 8 /* for Cyclom-32Y */ #define CY_CLOCK(version) ((version) >= 0x48 ? 60000000 : 25000000) #define CY_RTS_DTR_SWAPPED(version) ((version) >= 0x48) +/* + * The `cd' macros are for access to cd1400 registers. The `cy' macros + * are for access to Cyclades registers. Both sets of macros scale the + * register number to get an offset, but the scales are different for + * mostly historical reasons. + */ #ifdef CyDebug -#define cd_inb(iobase, reg, cy_align) (++cd_inbs, *((iobase) + ((reg)*2 << (cy_align)))) -#define cy_inb(iobase, reg) (++cy_inbs, *((iobase) + (reg))) -#define cd_outb(iobase, reg, cy_align, val) (++cd_outbs, (void)(*((iobase) + ((reg)*2 << (cy_align))) = (val))) -#define cy_outb(iobase, reg, val) (++cy_outbs, (void)(*((iobase) + (reg)) = (val))) +#define cd_inb(iobase, reg, cy_align) \ + (++cd_inbs, *((iobase) + (2 * (reg) << (cy_align)))) +#define cy_inb(iobase, reg, cy_align) \ + (++cy_inbs, *((iobase) + ((reg) << (cy_align)))) +#define cd_outb(iobase, reg, cy_align, val) \ + (++cd_outbs, (void)(*((iobase) + (2 * (reg) << (cy_align))) = (val))) +#define cy_outb(iobase, reg, cy_align, val) \ + (++cy_outbs, (void)(*((iobase) + ((reg) << (cy_align))) = (val))) #else -#define cd_inb(iobase, reg, cy_align) (*((iobase) + ((reg)*2 << (cy_align)))) -#define cy_inb(iobase, reg) (*((iobase) + (reg))) -#define cd_outb(iobase, reg, cy_align, val) ((void)(*((iobase) + ((reg)*2 << (cy_align))) = (val))) -#define cy_outb(iobase, reg, val) ((void)(*((iobase) + (reg)) = (val))) +#define cd_inb(iobase, reg, cy_align) \ + (*((iobase) + (2 * (reg) << (cy_align)))) +#define cy_inb(iobase, reg, cy_align) \ + (*((iobase) + ((reg) << (cy_align)))) +#define cd_outb(iobase, reg, cy_align, val) \ + ((void)(*((iobase) + (2 * (reg) << (cy_align))) = (val))) +#define cy_outb(iobase, reg, cy_align, val) \ + ((void)(*((iobase) + ((reg) << (cy_align))) = (val))) #endif |