Try to detect overlapping PCI memory assignment.
(This can only happen with devices that are mapped by the BIOS.) Reviewed by: se Submitted by: wolf (Wolfgang Stanglmeier)
This commit is contained in:
parent
cf143514ee
commit
93f26e434a
@ -1,6 +1,6 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** $Id: pci.c,v 1.10 1995/02/02 12:36:18 davidg Exp $
|
||||
** $Id: pci.c,v 1.9 1994/11/02 23:47:13 se Exp $
|
||||
**
|
||||
** General subroutines for the PCI bus on 80*86 systems.
|
||||
** pci_configure ()
|
||||
@ -511,6 +511,7 @@ int pci_map_mem (pcici_t tag, u_long reg, vm_offset_t* va, vm_offset_t* pa)
|
||||
u_long data;
|
||||
vm_size_t vsize;
|
||||
vm_offset_t vaddr;
|
||||
int i;
|
||||
|
||||
/*
|
||||
** sanity check
|
||||
@ -574,6 +575,21 @@ int pci_map_mem (pcici_t tag, u_long reg, vm_offset_t* va, vm_offset_t* pa)
|
||||
(unsigned) reg, (u_long)vaddr, (u_long)pci_paddr);
|
||||
#endif
|
||||
|
||||
/*
|
||||
** probe for already mapped device.
|
||||
*/
|
||||
|
||||
for (i=0; i<vsize; i+=4) {
|
||||
u_long* addr = (u_long*) (vaddr+i);
|
||||
data = *addr;
|
||||
if (data != 0xffffffff) {
|
||||
printf ("WARNING: possible address conflict "
|
||||
"at 0x%08x (read: 0x%08x).\n",
|
||||
(unsigned) pci_paddr+i, (unsigned) data);
|
||||
break;
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
** return them to the driver
|
||||
*/
|
||||
|
@ -1,6 +1,6 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** $Id: pci.c,v 1.10 1995/02/02 12:36:18 davidg Exp $
|
||||
** $Id: pci.c,v 1.9 1994/11/02 23:47:13 se Exp $
|
||||
**
|
||||
** General subroutines for the PCI bus on 80*86 systems.
|
||||
** pci_configure ()
|
||||
@ -511,6 +511,7 @@ int pci_map_mem (pcici_t tag, u_long reg, vm_offset_t* va, vm_offset_t* pa)
|
||||
u_long data;
|
||||
vm_size_t vsize;
|
||||
vm_offset_t vaddr;
|
||||
int i;
|
||||
|
||||
/*
|
||||
** sanity check
|
||||
@ -574,6 +575,21 @@ int pci_map_mem (pcici_t tag, u_long reg, vm_offset_t* va, vm_offset_t* pa)
|
||||
(unsigned) reg, (u_long)vaddr, (u_long)pci_paddr);
|
||||
#endif
|
||||
|
||||
/*
|
||||
** probe for already mapped device.
|
||||
*/
|
||||
|
||||
for (i=0; i<vsize; i+=4) {
|
||||
u_long* addr = (u_long*) (vaddr+i);
|
||||
data = *addr;
|
||||
if (data != 0xffffffff) {
|
||||
printf ("WARNING: possible address conflict "
|
||||
"at 0x%08x (read: 0x%08x).\n",
|
||||
(unsigned) pci_paddr+i, (unsigned) data);
|
||||
break;
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
** return them to the driver
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user