diff options
author | imp <imp@FreeBSD.org> | 2001-05-24 04:03:28 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2001-05-24 04:03:28 +0000 |
commit | 85de757366f537a26a6400585ffe3f4e4218d608 (patch) | |
tree | 1c0f888aa43be02be1038ef698df85ac2cb71f2e /sys | |
parent | 717e07e4944616b973ee8251f533ee5dc4044d30 (diff) | |
download | FreeBSD-src-85de757366f537a26a6400585ffe3f4e4218d608.zip FreeBSD-src-85de757366f537a26a6400585ffe3f4e4218d608.tar.gz |
Move getb1 and putb1 from pcic_isa.c to pcic.c. Rename them to
pcic_{get,put}b_io. There are some pci bridges (the CL-PD6729 and
maybe others) that do not have memory mapped registers, so we'll need
these in both places. Declare them in pcicvar.h.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/pccard/pcic.c | 20 | ||||
-rw-r--r-- | sys/pccard/pcic_isa.c | 24 | ||||
-rw-r--r-- | sys/pccard/pcicvar.h | 2 |
3 files changed, 24 insertions, 22 deletions
diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c index fcf1fce..995600a 100644 --- a/sys/pccard/pcic.c +++ b/sys/pccard/pcic.c @@ -78,6 +78,26 @@ static struct slot_ctrl pcic_cinfo = { }; /* + * Read a register from the PCIC. + */ +unsigned char +pcic_getb_io(struct pcic_slot *sp, int reg) +{ + outb(sp->index, sp->offset + reg); + return (inb(sp->data)); +} + +/* + * Write a register on the PCIC + */ +void +pcic_putb_io(struct pcic_slot *sp, int reg, unsigned char val) +{ + outb(sp->index, sp->offset + reg); + outb(sp->data, val); +} + +/* * Clear bit(s) of a register. */ __inline void diff --git a/sys/pccard/pcic_isa.c b/sys/pccard/pcic_isa.c index 03fc578..d1df7ce 100644 --- a/sys/pccard/pcic_isa.c +++ b/sys/pccard/pcic_isa.c @@ -73,26 +73,6 @@ static struct { }; /* - * Read a register from the PCIC. - */ -static unsigned char -getb1(struct pcic_slot *sp, int reg) -{ - outb(sp->index, sp->offset + reg); - return (inb(sp->data)); -} - -/* - * Write a register on the PCIC - */ -static void -putb1(struct pcic_slot *sp, int reg, unsigned char val) -{ - outb(sp->index, sp->offset + reg); - outb(sp->data, val); -} - -/* * Look for an Intel PCIC (or compatible). * For each available slot, allocate a PC-CARD slot. */ @@ -132,8 +112,8 @@ pcic_isa_probe(device_t dev) /* * Initialise the PCIC slot table. */ - sp->getb = getb1; - sp->putb = putb1; + sp->getb = pcic_getb_io; + sp->putb = pcic_putb_io; sp->index = rman_get_start(r); sp->data = sp->index + 1; sp->offset = slotnum * PCIC_SLOT_SIZE; diff --git a/sys/pccard/pcicvar.h b/sys/pccard/pcicvar.h index 9d5c40d..c02cffe 100644 --- a/sys/pccard/pcicvar.h +++ b/sys/pccard/pcicvar.h @@ -84,3 +84,5 @@ int pcic_set_memory_offset(device_t bus, device_t child, int rid, void pcic_clrb(struct pcic_slot *sp, int reg, unsigned char mask); void pcic_setb(struct pcic_slot *sp, int reg, unsigned char mask); void pcic_dealloc(device_t dev); +unsigned char pcic_getb_io(struct pcic_slot *sp, int reg); +void pcic_putb_io(struct pcic_slot *sp, int reg, unsigned char val); |