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.
This commit is contained in:
Daniel Cederman
2014-03-13 14:33:00 +01:00
committed by Joel Sherrill
parent 5130248e12
commit a46e02c7ea
9 changed files with 32 additions and 4 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -1,3 +1,6 @@
#include <ambapp.h>
#include <b1553brm_pci.h>
/* Select PCI driver */
#define B1553BRM_NO_AMBA
#define B1553BRM_PCI

View File

@@ -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))

View File

@@ -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;

View File

@@ -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"
/*

View File

@@ -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;

View File

@@ -1,3 +1,6 @@
#include <ambapp.h>
#include <apbuart_pci.h>
#undef DEBUG
/* Set registered device name */