summaryrefslogtreecommitdiffstats
path: root/sys/pci/pci.c
diff options
context:
space:
mode:
authorse <se@FreeBSD.org>1995-02-09 20:20:33 +0000
committerse <se@FreeBSD.org>1995-02-09 20:20:33 +0000
commit93f26e434abdf6c41008b87288c038fa1ada912f (patch)
treed42bb73ba47f3412bab161063ad65237c06a7974 /sys/pci/pci.c
parentcf143514eee5ff97ca1bcf31b5a289c48a66e625 (diff)
downloadFreeBSD-src-93f26e434abdf6c41008b87288c038fa1ada912f.zip
FreeBSD-src-93f26e434abdf6c41008b87288c038fa1ada912f.tar.gz
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)
Diffstat (limited to 'sys/pci/pci.c')
-rw-r--r--sys/pci/pci.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/pci/pci.c b/sys/pci/pci.c
index 61e546f..5696c9f 100644
--- a/sys/pci/pci.c
+++ b/sys/pci/pci.c
@@ -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
@@ -575,6 +576,21 @@ int pci_map_mem (pcici_t tag, u_long reg, vm_offset_t* va, vm_offset_t* pa)
#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
*/
OpenPOWER on IntegriCloud