[PATCH 1/7-V2] bsps/sparc: Make local functions for amba plug&play static.
Daniel Cederman
cederman at gaisler.com
Mon Mar 17 07:41:53 UTC 2014
Also move amba.h to bsp namespace.
---
c/src/lib/libbsp/sparc/leon3/Makefile.am | 2 +-
c/src/lib/libbsp/sparc/leon3/include/cache_.h | 2 +-
c/src/lib/libbsp/sparc/leon3/include/leon.h | 2 +-
c/src/lib/libbsp/sparc/leon3/preinstall.am | 6 +++---
c/src/lib/libbsp/sparc/shared/amba/ambapp.c | 12 ++++++------
c/src/lib/libbsp/sparc/shared/amba/ambapp_freq.c | 2 +-
c/src/lib/libbsp/sparc/shared/amba/ambapp_names.c | 1 +
c/src/lib/libbsp/sparc/shared/amba/ambapp_old.c | 2 +-
c/src/lib/libbsp/sparc/shared/amba/ambapp_show.c | 5 +----
9 files changed, 16 insertions(+), 18 deletions(-)
diff --git a/c/src/lib/libbsp/sparc/leon3/Makefile.am b/c/src/lib/libbsp/sparc/leon3/Makefile.am
index a9c1448..aba82eb 100644
--- a/c/src/lib/libbsp/sparc/leon3/Makefile.am
+++ b/c/src/lib/libbsp/sparc/leon3/Makefile.am
@@ -47,7 +47,7 @@ libbsp_a_SOURCES += ../../sparc/shared/irq_asm.S
libbsp_a_SOURCES += gnatsupp/gnatsupp.c ../../sparc/shared/gnatcommon.c
include_bsp_HEADERS = ../shared/include/gnatcommon.h
# AMBA bus
-include_HEADERS += include/amba.h
+include_bsp_HEADERS += include/amba.h
include_HEADERS += ../../sparc/shared/include/ambapp.h
include_HEADERS += ../../sparc/shared/include/ambapp_ids.h
include_HEADERS += ../../sparc/shared/include/grlib.h
diff --git a/c/src/lib/libbsp/sparc/leon3/include/cache_.h b/c/src/lib/libbsp/sparc/leon3/include/cache_.h
index a3f4af8..79a94c0 100644
--- a/c/src/lib/libbsp/sparc/leon3/include/cache_.h
+++ b/c/src/lib/libbsp/sparc/leon3/include/cache_.h
@@ -15,7 +15,7 @@
#ifndef LEON3_CACHE_H
#define LEON3_CACHE_H
-#include <amba.h>
+#include <bsp/amba.h>
#include <leon.h>
#ifdef __cplusplus
diff --git a/c/src/lib/libbsp/sparc/leon3/include/leon.h b/c/src/lib/libbsp/sparc/leon3/include/leon.h
index 685b553..6bb1014 100644
--- a/c/src/lib/libbsp/sparc/leon3/include/leon.h
+++ b/c/src/lib/libbsp/sparc/leon3/include/leon.h
@@ -24,7 +24,7 @@
#define _INCLUDE_LEON_h
#include <rtems.h>
-#include <amba.h>
+#include <bsp/amba.h>
#ifdef __cplusplus
extern "C" {
diff --git a/c/src/lib/libbsp/sparc/leon3/preinstall.am b/c/src/lib/libbsp/sparc/leon3/preinstall.am
index 112474e..9823b65 100644
--- a/c/src/lib/libbsp/sparc/leon3/preinstall.am
+++ b/c/src/lib/libbsp/sparc/leon3/preinstall.am
@@ -89,9 +89,9 @@ PREINSTALL_FILES += $(PROJECT_LIB)/linkcmds.ngmp
$(INSTALL_DATA) $< /gnatcommon.h
PREINSTALL_FILES += /gnatcommon.h
-$(PROJECT_INCLUDE)/amba.h: include/amba.h $(PROJECT_INCLUDE)/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/amba.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/amba.h
+$(PROJECT_INCLUDE)/bsp/amba.h: include/amba.h $(PROJECT_INCLUDE)/bsp/$(dirstamp)
+ $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/bsp/amba.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/bsp/amba.h
$(PROJECT_INCLUDE)/ambapp.h: ../../sparc/shared/include/ambapp.h $(PROJECT_INCLUDE)/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/ambapp.h
diff --git a/c/src/lib/libbsp/sparc/shared/amba/ambapp.c b/c/src/lib/libbsp/sparc/shared/amba/ambapp.c
index 504a3e7..7b3ae4a 100644
--- a/c/src/lib/libbsp/sparc/shared/amba/ambapp.c
+++ b/c/src/lib/libbsp/sparc/shared/amba/ambapp.c
@@ -21,7 +21,7 @@
#define AMBA_APB_SLAVES 16
/* Allocate one AMBA device */
-struct ambapp_dev *ambapp_alloc_dev_struct(int dev_type)
+static struct ambapp_dev *ambapp_alloc_dev_struct(int dev_type)
{
int size = sizeof(struct ambapp_dev);
struct ambapp_dev *dev;
@@ -38,7 +38,7 @@ struct ambapp_dev *ambapp_alloc_dev_struct(int dev_type)
return dev;
}
-unsigned int
+static unsigned int
ambapp_addr_from (struct ambapp_mmap *mmaps, unsigned int address)
{
/* no translation? */
@@ -55,7 +55,7 @@ ambapp_addr_from (struct ambapp_mmap *mmaps, unsigned int address)
return 1;
}
-void ambapp_ahb_dev_init(
+static void ambapp_ahb_dev_init(
unsigned int ioarea,
struct ambapp_mmap *mmaps,
struct ambapp_pnp_ahb *ahb,
@@ -102,7 +102,7 @@ void ambapp_ahb_dev_init(
}
}
-void ambapp_apb_dev_init(
+static void ambapp_apb_dev_init(
unsigned int base,
struct ambapp_mmap *mmaps,
struct ambapp_pnp_apb *apb,
@@ -123,7 +123,7 @@ void ambapp_apb_dev_init(
apb_info->mask = ambapp_pnp_apb_mask(apb->iobar);
}
-int ambapp_add_ahbbus(
+static int ambapp_add_ahbbus(
struct ambapp_bus *abus,
unsigned int ioarea
)
@@ -298,7 +298,7 @@ int ambapp_scan(
}
/* Match search options againt device */
-int ambapp_dev_match_options(struct ambapp_dev *dev, unsigned int options, int vendor, int device)
+static int ambapp_dev_match_options(struct ambapp_dev *dev, unsigned int options, int vendor, int device)
{
if ((((options & (OPTIONS_ALL_DEVS)) == OPTIONS_ALL_DEVS) || /* TYPE */
((options & OPTIONS_AHB_MSTS) && (dev->dev_type == DEV_AHB_MST)) ||
diff --git a/c/src/lib/libbsp/sparc/shared/amba/ambapp_freq.c b/c/src/lib/libbsp/sparc/shared/amba/ambapp_freq.c
index 03c0f68..0d18fea 100644
--- a/c/src/lib/libbsp/sparc/shared/amba/ambapp_freq.c
+++ b/c/src/lib/libbsp/sparc/shared/amba/ambapp_freq.c
@@ -21,7 +21,7 @@
* If a unsupported bridge is found the invalid frequncy of 0Hz is
* returned.
*/
-unsigned int ambapp_freq_calc(
+static unsigned int ambapp_freq_calc(
struct ambapp_bus *abus,
int ahbidx,
unsigned int freq_hz,
diff --git a/c/src/lib/libbsp/sparc/shared/amba/ambapp_names.c b/c/src/lib/libbsp/sparc/shared/amba/ambapp_names.c
index 4a47366..c0a8d63 100644
--- a/c/src/lib/libbsp/sparc/shared/amba/ambapp_names.c
+++ b/c/src/lib/libbsp/sparc/shared/amba/ambapp_names.c
@@ -12,6 +12,7 @@
* http://www.rtems.com/license/LICENSE.
*/
+#include <ambapp.h>
#include <ambapp_ids.h>
#include <string.h>
diff --git a/c/src/lib/libbsp/sparc/shared/amba/ambapp_old.c b/c/src/lib/libbsp/sparc/shared/amba/ambapp_old.c
index 15aebe5..5d8212c 100644
--- a/c/src/lib/libbsp/sparc/shared/amba/ambapp_old.c
+++ b/c/src/lib/libbsp/sparc/shared/amba/ambapp_old.c
@@ -19,7 +19,7 @@ struct ambapp_dev_find_match_arg {
};
/* AMBA PP find routines */
-int ambapp_dev_find_match(struct ambapp_dev *dev, int index, void *arg)
+static int ambapp_dev_find_match(struct ambapp_dev *dev, int index, void *arg)
{
struct ambapp_dev_find_match_arg *p = arg;
diff --git a/c/src/lib/libbsp/sparc/shared/amba/ambapp_show.c b/c/src/lib/libbsp/sparc/shared/amba/ambapp_show.c
index f73ec1d..e4e04fd 100644
--- a/c/src/lib/libbsp/sparc/shared/amba/ambapp_show.c
+++ b/c/src/lib/libbsp/sparc/shared/amba/ambapp_show.c
@@ -12,16 +12,13 @@
#include <stdio.h>
#include <ambapp.h>
-extern char *ambapp_device_id2str(int vendor, int id);
-extern char *ambapp_vendor_id2str(int vendor);
-
struct ambapp_dev_print_arg {
int show_depth;
};
static char *unknown = "unknown";
-int ambapp_dev_print(struct ambapp_dev *dev, int index, void *arg)
+static int ambapp_dev_print(struct ambapp_dev *dev, int index, void *arg)
{
char *dev_str, *ven_str, *type_str;
struct ambapp_dev_print_arg *p = arg;
--
1.7.9.5
More information about the devel
mailing list