summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-09-06 15:41:33 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-09-06 15:41:33 +0000
commit2a07d0f40d3085d96d9c9c67d800b8724d9d40cc (patch)
tree4ee8e3a658337bd458cfac554262b3d0e558773b /c
parent2007-09-06 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-2a07d0f40d3085d96d9c9c67d800b8724d9d40cc.tar.bz2
2007-09-06 Joel Sherrill <joel.sherrill@OARcorp.com>
* pci/pci.c: Fix some warnings.
Diffstat (limited to 'c')
-rw-r--r--c/src/lib/libbsp/sparc/leon3/ChangeLog4
-rw-r--r--c/src/lib/libbsp/sparc/leon3/pci/pci.c17
2 files changed, 17 insertions, 4 deletions
diff --git a/c/src/lib/libbsp/sparc/leon3/ChangeLog b/c/src/lib/libbsp/sparc/leon3/ChangeLog
index 10a39e2423..b564cfa486 100644
--- a/c/src/lib/libbsp/sparc/leon3/ChangeLog
+++ b/c/src/lib/libbsp/sparc/leon3/ChangeLog
@@ -1,5 +1,9 @@
2007-09-06 Joel Sherrill <joel.sherrill@OARcorp.com>
+ * pci/pci.c: Fix some warnings.
+
+2007-09-06 Joel Sherrill <joel.sherrill@OARcorp.com>
+
* console/debugputs.c: Add missing include file.
2007-09-06 Daniel Hellstrom <daniel@gaisler.com>
diff --git a/c/src/lib/libbsp/sparc/leon3/pci/pci.c b/c/src/lib/libbsp/sparc/leon3/pci/pci.c
index b959600fdf..7e22aa50ac 100644
--- a/c/src/lib/libbsp/sparc/leon3/pci/pci.c
+++ b/c/src/lib/libbsp/sparc/leon3/pci/pci.c
@@ -25,6 +25,7 @@
*/
#include <pci.h>
+#include <stdlib.h>
#include <rtems/bspIo.h>
#define PCI_ADDR 0x80000400
@@ -97,8 +98,14 @@ static inline unsigned int flip_dword (unsigned int l)
int
-pci_read_config_dword(unsigned char bus, unsigned char slot, unsigned char function, unsigned char offset, unsigned int *val) {
-
+pci_read_config_dword(
+ unsigned char bus,
+ unsigned char slot,
+ unsigned char function,
+ unsigned char offset,
+ unsigned int *val
+)
+{
volatile unsigned int *pci_conf;
if (offset & 3) return PCIBIOS_BAD_REGISTER_NUMBER;
@@ -108,7 +115,8 @@ pci_read_config_dword(unsigned char bus, unsigned char slot, unsigned char funct
return PCIBIOS_SUCCESSFUL;
}
- pci_conf = PCI_CONF + ((slot<<11) | (function<<8) | offset);
+ pci_conf = (volatile unsigned int *) (PCI_CONF +
+ ((slot<<11) | (function<<8) | offset));
#ifdef BT_ENABLED
*val = flip_dword(*pci_conf);
@@ -160,7 +168,8 @@ pci_write_config_dword(unsigned char bus, unsigned char slot, unsigned char func
if (offset & 3 || bus != 0) return PCIBIOS_BAD_REGISTER_NUMBER;
- pci_conf = PCI_CONF + ((slot<<11) | (function<<8) | (offset & ~3));
+ pci_conf = (volatile unsigned int *) (PCI_CONF +
+ ((slot<<11) | (function<<8) | (offset & ~3)));
#ifdef BT_ENABLED
value = flip_dword(val);