[Cbe-oss-dev] [PATCH 7/7] libspe2: Hide internal symbols: libea handler

Kazunori Asayama asayama at sm.sony.co.jp
Thu Jul 19 23:22:41 EST 2007


This patch hides internal symbols in the libea handler of libspe2.

Signed-off-by: Kazunori Asayama <asayama at sm.sony.co.jp>

---
 spebase/default_libea_handler.c |   26 +++++++++++++-------------
 spebase/default_libea_handler.h |    6 +-----
 spebase/lib_builtin.c           |    2 +-
 3 files changed, 15 insertions(+), 19 deletions(-)

Index: b/spebase/default_libea_handler.c
===================================================================
--- a/spebase/default_libea_handler.c	2007-07-03 10:34:49.000000000 +0900
+++ b/spebase/default_libea_handler.c	2007-07-19 15:09:23.000000000 +0900
@@ -16,14 +16,6 @@ typedef union {
 } addr64;
 
 
-int (*default_libea_funcs[SPE_LIBEA_NR_OPCODES]) (char *, unsigned long) = {
-	[SPE_LIBEA_UNUSED]		= NULL,
-	[SPE_LIBEA_CALLOC]		= default_libea_handler_calloc,
-	[SPE_LIBEA_FREE]		= default_libea_handler_free,
-	[SPE_LIBEA_MALLOC]		= default_libea_handler_malloc,
-	[SPE_LIBEA_REALLOC]		= default_libea_handler_realloc,
-};
-
 /**
  * default_libea_handler_calloc
  * @ls: base pointer to local store area.
@@ -38,7 +30,7 @@ int (*default_libea_funcs[SPE_LIBEA_NR_O
  * rather than LS offset.  On powerpc32 ABI (which is ILP-32), this
  * is handled as a 32b EA pointer.
  */
-int default_libea_handler_calloc(char *ls, unsigned long opdata)
+static int default_libea_handler_calloc(char *ls, unsigned long opdata)
 {
   DECL_2_ARGS();
   DECL_RET();
@@ -73,7 +65,7 @@ int default_libea_handler_calloc(char *l
  * rather than LS offset.  On powerpc32 ABI (which is ILP-32), this
  * is handled as a 32b EA pointer.
  */
-int default_libea_handler_free(char *ls, unsigned long opdata)
+static int default_libea_handler_free(char *ls, unsigned long opdata)
 {
   DECL_1_ARGS();
   addr64 ptr;
@@ -101,7 +93,7 @@ int default_libea_handler_free(char *ls,
  * rather than LS offset.  On powerpc32 ABI (which is ILP-32), this
  * is handled as a 32b EA pointer.
  */
-int default_libea_handler_malloc(char *ls, unsigned long opdata)
+static int default_libea_handler_malloc(char *ls, unsigned long opdata)
 {
   DECL_1_ARGS();
   DECL_RET();
@@ -134,7 +126,7 @@ int default_libea_handler_malloc(char *l
  * rather than LS offsets.  On powerpc32 ABI (which is ILP-32), this
  * is handled as a 32b EA pointer.
  */
-int default_libea_handler_realloc(char *ls, unsigned long opdata)
+static int default_libea_handler_realloc(char *ls, unsigned long opdata)
 {
   DECL_2_ARGS();
   DECL_RET();
@@ -157,6 +149,14 @@ int default_libea_handler_realloc(char *
 
 }
 
+static int (*default_libea_funcs[SPE_LIBEA_NR_OPCODES]) (char *, unsigned long) = {
+	[SPE_LIBEA_UNUSED]		= NULL,
+	[SPE_LIBEA_CALLOC]		= default_libea_handler_calloc,
+	[SPE_LIBEA_FREE]		= default_libea_handler_free,
+	[SPE_LIBEA_MALLOC]		= default_libea_handler_malloc,
+	[SPE_LIBEA_REALLOC]		= default_libea_handler_realloc,
+};
+
 /**
  * default_libea_handler
  * @ls: base pointer to local store area.
@@ -164,7 +164,7 @@ int default_libea_handler_realloc(char *
  *
  * Default POSIX.1 call dispatch function.
  */
-int default_libea_handler(char *base, unsigned long offset)
+int _base_spe_default_libea_handler(char *base, unsigned long offset)
 {
     int op, opdata;
 
Index: b/spebase/default_libea_handler.h
===================================================================
--- a/spebase/default_libea_handler.h	2007-07-19 15:05:46.000000000 +0900
+++ b/spebase/default_libea_handler.h	2007-07-19 15:08:21.000000000 +0900
@@ -8,11 +8,7 @@
 #define SPE_LIBEA_REALLOC      0x04
 #define SPE_LIBEA_NR_OPCODES   0x05
 
-extern int default_libea_handler(char *ls, unsigned long args);
-extern int default_libea_handler_calloc(char *ls, unsigned long args);
-extern int default_libea_handler_free(char *ls, unsigned long args);
-extern int default_libea_handler_malloc(char *ls, unsigned long args);
-extern int default_libea_handler_realloc(char *ls, unsigned long args);
+extern int _base_spe_default_libea_handler(char *ls, unsigned long args);
 
 #define SPE_LIBEA_OP_SHIFT  24
 #define SPE_LIBEA_OP_MASK   0xff
Index: b/spebase/lib_builtin.c
===================================================================
--- a/spebase/lib_builtin.c	2007-07-19 15:06:38.000000000 +0900
+++ b/spebase/lib_builtin.c	2007-07-19 15:08:00.000000000 +0900
@@ -30,7 +30,7 @@
 */
 static void *handlers[] = {
         _base_spe_default_c99_handler, _base_spe_default_posix1_handler,
-        NULL,NULL,default_libea_handler ,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
+        NULL,NULL,_base_spe_default_libea_handler ,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
         NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
         NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
         NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,



More information about the cbe-oss-dev mailing list