summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Cederman <cederman@gaisler.com>2014-03-13 14:33:00 +0100
committerJoel Sherrill <joel.sherrill@oarcorp.com>2014-03-21 09:57:20 -0500
commita46e02c7eabc58cb61eebe94d3a69def5f4edb2a (patch)
treef0c96baae327889ade36c6d91e3e5f415031a161
parentsmc91111: Move driver attach prototype to header file. (diff)
downloadrtems-a46e02c7eabc58cb61eebe94d3a69def5f4edb2a.tar.bz2
bsps/sparc: Make local functions static.
The PCI and RASTA versions of the uart, spacewire and 1553 drivers directly includes the c-file of the standard versions of the drivers, but uses a macro to change the name of the driver register function. When the standard version is used this function should be global, when it is included as part of the PCI and RASTA versions it should be local and static.
-rw-r--r--c/src/lib/libbsp/sparc/leon2/pci/pci.c4
-rw-r--r--c/src/lib/libbsp/sparc/leon3/pci/pci.c4
-rw-r--r--c/src/lib/libbsp/sparc/shared/1553/b1553brm.c5
-rw-r--r--c/src/lib/libbsp/sparc/shared/1553/b1553brm_pci.c3
-rw-r--r--c/src/lib/libbsp/sparc/shared/can/occan_pci.c2
-rw-r--r--c/src/lib/libbsp/sparc/shared/spw/grspw.c5
-rw-r--r--c/src/lib/libbsp/sparc/shared/spw/grspw_pci.c5
-rw-r--r--c/src/lib/libbsp/sparc/shared/uart/apbuart.c5
-rw-r--r--c/src/lib/libbsp/sparc/shared/uart/apbuart_pci.c3
9 files changed, 32 insertions, 4 deletions
diff --git a/c/src/lib/libbsp/sparc/leon2/pci/pci.c b/c/src/lib/libbsp/sparc/leon2/pci/pci.c
index fa904c578b..fcc63df567 100644
--- a/c/src/lib/libbsp/sparc/leon2/pci/pci.c
+++ b/c/src/lib/libbsp/sparc/leon2/pci/pci.c
@@ -231,7 +231,7 @@ rtems_pci_config_t BSP_pci_configuration = {
};
-void init_at697_pci(void) {
+static void init_at697_pci(void) {
/* Reset */
pcic->pciic = 0xffffffff;
@@ -418,7 +418,7 @@ static inline void swap_res(struct pci_res **p1, struct pci_res **p2) {
*
*
*/
-void pci_allocate_resources(void) {
+static void pci_allocate_resources(void) {
unsigned int slot, numfuncs, func, id, pos, size, tmp, i, swapped, addr, dev, fn;
unsigned char header;
diff --git a/c/src/lib/libbsp/sparc/leon3/pci/pci.c b/c/src/lib/libbsp/sparc/leon3/pci/pci.c
index 5ae63ef8da..b36b02643c 100644
--- a/c/src/lib/libbsp/sparc/leon3/pci/pci.c
+++ b/c/src/lib/libbsp/sparc/leon3/pci/pci.c
@@ -223,7 +223,7 @@ rtems_pci_config_t BSP_pci_configuration = {
};
-int init_grpci(void) {
+static int init_grpci(void) {
volatile unsigned int *page0 = (unsigned volatile int *) PCI_MEM_START;
uint32_t data;
@@ -333,7 +333,7 @@ static inline void swap_res(struct pci_res **p1, struct pci_res **p2) {
*
*
*/
-void pci_allocate_resources(void) {
+static void pci_allocate_resources(void) {
unsigned int slot, numfuncs, func, pos, i, swapped, addr, dev, fn;
uint32_t id, tmp, size;
diff --git a/c/src/lib/libbsp/sparc/shared/1553/b1553brm.c b/c/src/lib/libbsp/sparc/shared/1553/b1553brm.c
index c156222797..045146a58b 100644
--- a/c/src/lib/libbsp/sparc/shared/1553/b1553brm.c
+++ b/c/src/lib/libbsp/sparc/shared/1553/b1553brm.c
@@ -30,6 +30,8 @@
#ifndef B1553BRM_PREFIX
#define B1553BRM_PREFIX(name) b1553brm##name
+#else
+ #define B1553BRM_REGISTER_STATIC
#endif
/* default to no translation */
@@ -340,6 +342,9 @@ int brm_register_leon3_ramon_asic(void){
#endif
#endif
+#ifdef B1553BRM_REGISTER_STATIC
+static
+#endif
int B1553BRM_PREFIX(_register)(struct ambapp_bus *bus, unsigned int clksel, unsigned int clkdiv, unsigned int brm_freq)
{
rtems_status_code r;
diff --git a/c/src/lib/libbsp/sparc/shared/1553/b1553brm_pci.c b/c/src/lib/libbsp/sparc/shared/1553/b1553brm_pci.c
index 3be26b1b74..2ae4af5607 100644
--- a/c/src/lib/libbsp/sparc/shared/1553/b1553brm_pci.c
+++ b/c/src/lib/libbsp/sparc/shared/1553/b1553brm_pci.c
@@ -1,3 +1,6 @@
+#include <ambapp.h>
+#include <b1553brm_pci.h>
+
/* Select PCI driver */
#define B1553BRM_NO_AMBA
#define B1553BRM_PCI
diff --git a/c/src/lib/libbsp/sparc/shared/can/occan_pci.c b/c/src/lib/libbsp/sparc/shared/can/occan_pci.c
index a1fecc52dc..12273c99fc 100644
--- a/c/src/lib/libbsp/sparc/shared/can/occan_pci.c
+++ b/c/src/lib/libbsp/sparc/shared/can/occan_pci.c
@@ -3,6 +3,8 @@
*/
#define OCCAN_WORD_REGS
+#include <occan_pci.h>
+
/* Set registered device name */
#define OCCAN_DEVNAME "/dev/occanpci0"
#define OCCAN_DEVNAME_NO(devstr,no) ((devstr)[13]='0'+(no))
diff --git a/c/src/lib/libbsp/sparc/shared/spw/grspw.c b/c/src/lib/libbsp/sparc/shared/spw/grspw.c
index 538e8bb099..b311500ffd 100644
--- a/c/src/lib/libbsp/sparc/shared/spw/grspw.c
+++ b/c/src/lib/libbsp/sparc/shared/spw/grspw.c
@@ -58,6 +58,8 @@
#ifndef GRSPW_PREFIX
#define GRSPW_PREFIX(name) grspw##name
+#else
+ #define GRSPW_REGISTER_STATIC
#endif
/* default to no translation */
@@ -373,6 +375,9 @@ static rtems_device_driver grspw_control(
static rtems_driver_address_table grspw_driver = GRSPW_DRIVER_TABLE_ENTRY;
static struct ambapp_bus *amba_bus;
+#ifdef GRSPW_REGISTER_STATIC
+static
+#endif
int GRSPW_PREFIX(_register)(struct ambapp_bus *bus)
{
rtems_status_code r;
diff --git a/c/src/lib/libbsp/sparc/shared/spw/grspw_pci.c b/c/src/lib/libbsp/sparc/shared/spw/grspw_pci.c
index 2a9a8d6094..fce2fa8b36 100644
--- a/c/src/lib/libbsp/sparc/shared/spw/grspw_pci.c
+++ b/c/src/lib/libbsp/sparc/shared/spw/grspw_pci.c
@@ -1,3 +1,7 @@
+#include <ambapp.h>
+#include <rtems/libio.h>
+#include <grspw_pci.h>
+
/* Select PCI driver */
#define GRSPW_PCI
@@ -70,6 +74,7 @@ static inline unsigned int hw_to_cpu(unsigned int addr) {
#endif
int grspwpci_interrupt_handler(int irq, void *arg);
+
#include "grspw.c"
/*
diff --git a/c/src/lib/libbsp/sparc/shared/uart/apbuart.c b/c/src/lib/libbsp/sparc/shared/uart/apbuart.c
index fe6ea3bf86..e64784faec 100644
--- a/c/src/lib/libbsp/sparc/shared/uart/apbuart.c
+++ b/c/src/lib/libbsp/sparc/shared/uart/apbuart.c
@@ -34,6 +34,8 @@
#ifndef APBUART_PREFIX
#define APBUART_PREFIX(name) apbuart##name
+#else
+ #define APBUART_REGISTER_STATIC
#endif
#if !defined(APBUART_DEVNAME) || !defined(APBUART_DEVNAME_NO)
@@ -323,6 +325,9 @@ static void apbuart_interrupt(apbuart_priv *uart){
}
}
+#ifdef APBUART_REGISTER_STATIC
+static
+#endif
int APBUART_PREFIX(_register)(struct ambapp_bus *bus) {
rtems_status_code r;
rtems_device_major_number m;
diff --git a/c/src/lib/libbsp/sparc/shared/uart/apbuart_pci.c b/c/src/lib/libbsp/sparc/shared/uart/apbuart_pci.c
index 63cac35178..9ea396786f 100644
--- a/c/src/lib/libbsp/sparc/shared/uart/apbuart_pci.c
+++ b/c/src/lib/libbsp/sparc/shared/uart/apbuart_pci.c
@@ -1,3 +1,6 @@
+#include <ambapp.h>
+#include <apbuart_pci.h>
+
#undef DEBUG
/* Set registered device name */