From 85de757366f537a26a6400585ffe3f4e4218d608 Mon Sep 17 00:00:00 2001 From: imp Date: Thu, 24 May 2001 04:03:28 +0000 Subject: [PATCH] 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. --- sys/pccard/pcic.c | 20 ++++++++++++++++++++ sys/pccard/pcic_isa.c | 24 ++---------------------- 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 fcf1fce4679..995600af426 100644 --- a/sys/pccard/pcic.c +++ b/sys/pccard/pcic.c @@ -77,6 +77,26 @@ static struct slot_ctrl pcic_cinfo = { PCIC_IO_WIN }; +/* + * 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. */ diff --git a/sys/pccard/pcic_isa.c b/sys/pccard/pcic_isa.c index 03fc5782307..d1df7cee3bc 100644 --- a/sys/pccard/pcic_isa.c +++ b/sys/pccard/pcic_isa.c @@ -72,26 +72,6 @@ static struct { { "Intel i82365SL-DF", PCIC_DF_POWER} }; -/* - * 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 9d5c40d3c3e..c02cffeac34 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); -- 2.45.2