On the alpha, ports may be allocated above 64k.

Change the port address argument to pci_map_port to pci_port_t* which is
defined as u_int on the alpha, u_short on i386.  This is a stopgap with a
hopefully limited lifetime.

Discussed with: Stefan Esser <se@freebsd.org>
This commit is contained in:
Doug Rabson 1998-07-22 08:39:08 +00:00
parent 0bf030847d
commit df9efa9a8b
3 changed files with 26 additions and 7 deletions

View File

@ -26,7 +26,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: pcivar.h,v 1.17 1997/08/21 07:05:54 fsmp Exp $
* $Id: pcivar.h,v 1.18 1997/08/21 08:31:41 fsmp Exp $
*
*/
@ -192,10 +192,16 @@ struct pci_lkm {
struct pci_lkm *next;
};
#ifdef __i386__
typedef u_short pci_port_t;
#else
typedef u_int pci_port_t;
#endif
u_long pci_conf_read (pcici_t tag, u_long reg);
void pci_conf_write (pcici_t tag, u_long reg, u_long data);
void pci_configure (void);
int pci_map_port (pcici_t tag, u_long reg, u_short* pa);
int pci_map_port (pcici_t tag, u_long reg, pci_port_t* pa);
int pci_map_mem (pcici_t tag, u_long reg, vm_offset_t* va, vm_offset_t* pa);
int pci_map_int (pcici_t tag, pci_inthand_t *func, void *arg, unsigned *maskptr);
int pci_unmap_int (pcici_t tag);

View File

@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: pci_compat.c,v 1.6 1997/08/21 08:42:59 fsmp Exp $
* $Id: pci_compat.c,v 1.7 1998/04/01 21:07:37 tegge Exp $
*
*/
@ -56,7 +56,6 @@ static int
pci_mapno(pcicfgregs *cfg, int reg)
{
int map = -1;
if ((reg & 0x03) == 0) {
map = (reg -0x10) / 4;
if (map < 0 || map >= cfg->nummaps)
@ -106,7 +105,7 @@ pci_conf_write(pcici_t tag, u_long reg, u_long data)
pci_cfgwrite(tag, reg, data, 4);
}
int pci_map_port(pcici_t cfg, u_long reg, u_short* pa)
int pci_map_port(pcici_t cfg, u_long reg, pci_port_t* pa)
{
int map;
@ -149,7 +148,15 @@ int pci_map_mem(pcici_t cfg, u_long reg, vm_offset_t* va, vm_offset_t* pa)
vm_offset_t vaddr;
poffs = paddr - trunc_page(paddr);
#ifdef __i386__
vaddr = (vm_offset_t)pmap_mapdev(paddr-poffs, psize+poffs);
#endif
#ifdef __alpha__
/* XXX should talk to chipset.
Hardwire pyxis for now */
vaddr = ALPHA_PHYS_TO_K0SEG(0x8600000000L
+ paddr-poffs);
#endif
if (vaddr != NULL) {
vaddr += poffs;
*va = vaddr;

View File

@ -26,7 +26,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: pcivar.h,v 1.17 1997/08/21 07:05:54 fsmp Exp $
* $Id: pcivar.h,v 1.18 1997/08/21 08:31:41 fsmp Exp $
*
*/
@ -192,10 +192,16 @@ struct pci_lkm {
struct pci_lkm *next;
};
#ifdef __i386__
typedef u_short pci_port_t;
#else
typedef u_int pci_port_t;
#endif
u_long pci_conf_read (pcici_t tag, u_long reg);
void pci_conf_write (pcici_t tag, u_long reg, u_long data);
void pci_configure (void);
int pci_map_port (pcici_t tag, u_long reg, u_short* pa);
int pci_map_port (pcici_t tag, u_long reg, pci_port_t* pa);
int pci_map_mem (pcici_t tag, u_long reg, vm_offset_t* va, vm_offset_t* pa);
int pci_map_int (pcici_t tag, pci_inthand_t *func, void *arg, unsigned *maskptr);
int pci_unmap_int (pcici_t tag);