summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386/shared/pci/pcibios.c
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2004-04-21 10:43:04 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2004-04-21 10:43:04 +0000
commit6128a4aa5e791ed4e0a655bfd346a52d92da7883 (patch)
treeaf53ca3f67ce405b6fbc6c98399c8e0c87e01a9e /c/src/lib/libbsp/i386/shared/pci/pcibios.c
parent2004-04-20 Ralf Corsepius <ralf_corsepius@rtems.org> (diff)
downloadrtems-6128a4aa5e791ed4e0a655bfd346a52d92da7883.tar.bz2
Remove stray white spaces.
Diffstat (limited to 'c/src/lib/libbsp/i386/shared/pci/pcibios.c')
-rw-r--r--c/src/lib/libbsp/i386/shared/pci/pcibios.c80
1 files changed, 40 insertions, 40 deletions
diff --git a/c/src/lib/libbsp/i386/shared/pci/pcibios.c b/c/src/lib/libbsp/i386/shared/pci/pcibios.c
index 354f6d9e71..1cece0fb86 100644
--- a/c/src/lib/libbsp/i386/shared/pci/pcibios.c
+++ b/c/src/lib/libbsp/i386/shared/pci/pcibios.c
@@ -15,28 +15,28 @@
/*
* This is simpliest possible PCI BIOS, it assumes that addressing
- * is flat and that stack is big enough
- */
+ * is flat and that stack is big enough
+ */
static int pcibInitialized = 0;
static unsigned int pcibEntry;
/*
- * Array to pass data between c and asm parts, at the time of
- * writing I am not yet that familiar with extended asm feature
- * of gcc. This code is not on performance path, so we can care
- * relatively little about performance here
+ * Array to pass data between c and asm parts, at the time of
+ * writing I am not yet that familiar with extended asm feature
+ * of gcc. This code is not on performance path, so we can care
+ * relatively little about performance here
*/
static volatile unsigned int pcibExchg[5];
static int pcib_convert_err(int err);
/*
- * Detects presense of PCI BIOS, returns
+ * Detects presense of PCI BIOS, returns
* error code
*/
-int
+int
pcib_init(void)
{
unsigned char *ucp;
@@ -84,7 +84,7 @@ pcib_init(void)
pcibExchg[0] = *(unsigned int *)ucp;
- asm (" pusha"); /* Push all registers */
+ asm (" pusha"); /* Push all registers */
asm (" movl pcibExchg, %edi"); /* Move entry point to esi */
asm (" movl $0x49435024, %eax"); /* Move signature to eax */
asm (" xorl %ebx, %ebx"); /* Zero ebx */
@@ -107,7 +107,7 @@ pcib_init(void)
/* Let us check whether PCI bios is present */
pcibExchg[0] = pcibEntry;
-
+
asm(" pusha");
asm(" movl pcibExchg, %edi");
asm(" movb $0xb1, %ah");
@@ -133,13 +133,13 @@ pcib_init(void)
}
/* Success */
-
+
pcibInitialized = 1;
return PCIB_ERR_SUCCESS;
}
-/*
- * Find specified device and return its signature: combination
+/*
+ * Find specified device and return its signature: combination
* of bus number, device number and function number
*/
int
@@ -173,8 +173,8 @@ pcib_find_by_devid(int vendorId, int devId, int idx, int *sig)
return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
}
-/*
- * Find specified class code return device signature: combination
+/*
+ * Find specified class code return device signature: combination
* of bus number, device number and function number
*/
int
@@ -210,8 +210,8 @@ pcib_find_by_class(int classCode, int idx, int *sig)
return PCIB_ERR_SUCCESS;
}
-
-
+
+
#define PCI_MULTI_FUNCTION 0x80
@@ -228,42 +228,42 @@ BSP_pciFindDevice( unsigned short vendorid, unsigned short deviceid,
unsigned short s;
unsigned char bus,dev,fun,hd;
- for (bus=0; bus<BusCountPCI(); bus++)
+ for (bus=0; bus<BusCountPCI(); bus++)
{
- for (dev=0; dev<PCI_MAX_DEVICES; dev++)
+ for (dev=0; dev<PCI_MAX_DEVICES; dev++)
{
sig = PCIB_DEVSIG_MAKE(bus,dev,0);
/* pci_read_config_byte(bus,dev,0, PCI_HEADER_TYPE, &hd); */
- pcib_conf_read8(sig, 0xe, &hd);
+ pcib_conf_read8(sig, 0xe, &hd);
hd = (hd & PCI_MULTI_FUNCTION ? PCI_MAX_FUNCTIONS : 1);
for (fun=0; fun<hd; fun++) {
- /*
+ /*
* The last devfn id/slot is special; must skip it
*/
if( PCI_MAX_DEVICES-1 == dev && PCI_MAX_FUNCTIONS-1 == fun )
break;
/*pci_read_config_dword(bus,dev,fun,PCI_VENDOR_ID,&d); */
- pcib_conf_read32(sig, 0, &d);
+ pcib_conf_read32(sig, 0, &d);
if( d == -1 )
continue;
#ifdef PCI_DEBUG
printk("BSP_pciFindDevice: found 0x%08x at %d/%d/%d\n",d,bus,dev,fun);
#endif
/* pci_read_config_word(bus,dev,fun,PCI_VENDOR_ID,&s); */
- pcib_conf_read16(sig, 0, &s);
+ pcib_conf_read16(sig, 0, &s);
if (vendorid != s)
continue;
/* pci_read_config_word(bus,dev,fun,PCI_DEVICE_ID,&s); */
- pcib_conf_read16(sig, 0x2, &s);
+ pcib_conf_read16(sig, 0x2, &s);
if (deviceid == s) {
if (instance--) continue;
- *pbus=bus;
- *pdev=dev;
+ *pbus=bus;
+ *pdev=dev;
*pfun=fun;
return 0;
}
@@ -274,9 +274,9 @@ BSP_pciFindDevice( unsigned short vendorid, unsigned short deviceid,
}
-
-/*
+
+/*
* Generate Special Cycle
*/
int
@@ -305,9 +305,9 @@ pcib_special_cycle(int busNo, int data)
return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
}
-
-/*
+
+/*
* Read byte from config space
*/
int
@@ -343,9 +343,9 @@ pcib_conf_read8(int sig, int off, unsigned char *data)
return PCIB_ERR_SUCCESS;
}
-
-/*
+
+/*
* Read word from config space
*/
int
@@ -381,9 +381,9 @@ pcib_conf_read16(int sig, int off, unsigned short *data)
return PCIB_ERR_SUCCESS;
}
-
-/*
+
+/*
* Read dword from config space
*/
int
@@ -419,9 +419,9 @@ pcib_conf_read32(int sig, int off, unsigned int *data)
return PCIB_ERR_SUCCESS;
}
-
-/*
+
+/*
* Write byte into config space
*/
int
@@ -452,7 +452,7 @@ pcib_conf_write8(int sig, int off, unsigned int data)
return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
}
-/*
+/*
* Write word into config space
*/
int
@@ -482,10 +482,10 @@ pcib_conf_write16(int sig, int off, unsigned int data)
return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
}
-
-/*
+
+/*
* Write dword into config space
*/
int
@@ -515,7 +515,7 @@ pcib_conf_write32(int sig, int off, unsigned int data)
return pcib_convert_err((pcibExchg[0] >> 8) & 0xff);
}
-
+
static int
pcib_convert_err(int err)