[Cbe-oss-dev] [PATCH 05/13]MARS/core: Rename context_internal.h

Yuji Mano yuji.mano at am.sony.com
Fri Dec 12 15:33:28 EST 2008


This renames the internal header context_internal_types.h to context_internal.h
for consistency and also because the header now contains function prototypes.

Signed-off-by: Yuji Mano <yuji.mano at am.sony.com>

---
Index: mars-src/core/src/host/lib/context_internal.h
===================================================================
--- /dev/null
+++ mars-src/core/src/host/lib/context_internal.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2008 Sony Corporation of America
+ *
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this Library and associated documentation files (the
+ * "Library"), to deal in the Library without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Library, and to
+ * permit persons to whom the Library is furnished to do so, subject to
+ * the following conditions:
+ *
+ *  The above copyright notice and this permission notice shall be
+ *  included in all copies or substantial portions of the Library.
+ *
+ *  If you modify the Library, you may copy and distribute your modified
+ *  version of the Library in object code or as an executable provided
+ *  that you also do one of the following:
+ *
+ *   Accompany the modified version of the Library with the complete
+ *   corresponding machine-readable source code for the modified version
+ *   of the Library; or,
+ *
+ *   Accompany the modified version of the Library with a written offer
+ *   for a complete machine-readable copy of the corresponding source
+ *   code of the modified version of the Library.
+ *
+ *
+ * THE LIBRARY IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * LIBRARY OR THE USE OR OTHER DEALINGS IN THE LIBRARY.
+ */
+
+#ifndef MARS_CONTEXT_INTERNAL_TYPES_H
+#define MARS_CONTEXT_INTERNAL_TYPES_H
+
+#include <stdint.h>
+
+#ifdef HAVE_PTHREAD_H
+#include <pthread.h>
+#endif
+
+#define MARS_SHARED_CONTEXT_MAX		16
+
+#ifdef HAVE_LIBSPE2
+typedef pthread_t mars_mpu_context_t;
+#endif
+
+#ifdef HAVE_LIBPTHREAD
+typedef pthread_mutex_t mars_host_mutex_t;
+#endif
+
+struct mars_context {
+	/* parameters for the MARS kernel */
+	uint64_t kernel_params_ea;
+	/* process queue where process requests are added */
+	uint64_t workload_queue_ea;
+	/* array of mpu context threads */
+	mars_mpu_context_t *mpu_contexts;
+	/* num of mpu context threads */
+	uint32_t mpu_context_count;
+	/* reference count */
+	uint32_t reference_count;
+};
+
+int mars_mpu_max(int *num);
+int mars_mpu_run(mars_mpu_context_t *mpu, uint64_t params_ea);
+int mars_mpu_wait(mars_mpu_context_t *mpu);
+
+int mars_shared_context_get(struct mars_context **mars);
+int mars_shared_context_register(struct mars_context *mars);
+int mars_shared_context_unregister(struct mars_context *mars);
+
+extern mars_host_mutex_t mars_shared_context_lock;
+
+int mars_host_mutex_lock(mars_host_mutex_t *mutex);
+int mars_host_mutex_unlock(mars_host_mutex_t *mutex);
+
+#endif
Index: mars-src/core/src/host/lib/context_internal_types.h
===================================================================
--- mars-src.orig/core/src/host/lib/context_internal_types.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright 2008 Sony Corporation of America
- *
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this Library and associated documentation files (the
- * "Library"), to deal in the Library without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Library, and to
- * permit persons to whom the Library is furnished to do so, subject to
- * the following conditions:
- *
- *  The above copyright notice and this permission notice shall be
- *  included in all copies or substantial portions of the Library.
- *
- *  If you modify the Library, you may copy and distribute your modified
- *  version of the Library in object code or as an executable provided
- *  that you also do one of the following:
- *
- *   Accompany the modified version of the Library with the complete
- *   corresponding machine-readable source code for the modified version
- *   of the Library; or,
- *
- *   Accompany the modified version of the Library with a written offer
- *   for a complete machine-readable copy of the corresponding source
- *   code of the modified version of the Library.
- *
- *
- * THE LIBRARY IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * LIBRARY OR THE USE OR OTHER DEALINGS IN THE LIBRARY.
- */
-
-#ifndef MARS_CONTEXT_INTERNAL_TYPES_H
-#define MARS_CONTEXT_INTERNAL_TYPES_H
-
-#include <stdint.h>
-
-#ifdef HAVE_PTHREAD_H
-#include <pthread.h>
-#endif
-
-#define MARS_SHARED_CONTEXT_MAX		16
-
-#ifdef HAVE_LIBSPE2
-typedef pthread_t mars_mpu_context_t;
-#endif
-
-#ifdef HAVE_LIBPTHREAD
-typedef pthread_mutex_t mars_host_mutex_t;
-#endif
-
-struct mars_context {
-	/* parameters for the MARS kernel */
-	uint64_t kernel_params_ea;
-	/* process queue where process requests are added */
-	uint64_t workload_queue_ea;
-	/* array of mpu context threads */
-	mars_mpu_context_t *mpu_contexts;
-	/* num of mpu context threads */
-	uint32_t mpu_context_count;
-	/* reference count */
-	uint32_t reference_count;
-};
-
-int mars_mpu_max(int *num);
-int mars_mpu_run(mars_mpu_context_t *mpu, uint64_t params_ea);
-int mars_mpu_wait(mars_mpu_context_t *mpu);
-
-int mars_shared_context_get(struct mars_context **mars);
-int mars_shared_context_register(struct mars_context *mars);
-int mars_shared_context_unregister(struct mars_context *mars);
-
-extern mars_host_mutex_t mars_shared_context_lock;
-
-int mars_host_mutex_lock(mars_host_mutex_t *mutex);
-int mars_host_mutex_unlock(mars_host_mutex_t *mutex);
-
-#endif
Index: mars-src/core/src/host/lib/Makefile.am
===================================================================
--- mars-src.orig/core/src/host/lib/Makefile.am
+++ mars-src/core/src/host/lib/Makefile.am
@@ -102,7 +102,7 @@ libmars_core_la_SOURCES = \
 	${MARS_PLATFORM_SPECIFIC_SOURCES} \
 	alloc.c \
 	context.c \
-	context_internal_types.h \
+	context_internal.h \
 	numa_internal.h \
 	shared_context.c \
 	workload_queue.c
Index: mars-src/core/src/host/lib/context.c
===================================================================
--- mars-src.orig/core/src/host/lib/context.c
+++ mars-src/core/src/host/lib/context.c
@@ -45,7 +45,7 @@
 #include "mars/error.h"
 #include "mars/workload_queue.h"
 
-#include "context_internal_types.h"
+#include "context_internal.h"
 #include "kernel_internal_types.h"
 
 uint32_t mars_get_ticks(void)
Index: mars-src/core/src/host/lib/host_mutex_linux.c
===================================================================
--- mars-src.orig/core/src/host/lib/host_mutex_linux.c
+++ mars-src/core/src/host/lib/host_mutex_linux.c
@@ -40,7 +40,7 @@
 
 #include "mars/error.h"
 
-#include "context_internal_types.h"
+#include "context_internal.h"
 
 /* global locks */
 pthread_mutex_t mars_shared_context_lock = PTHREAD_MUTEX_INITIALIZER;
Index: mars-src/core/src/host/lib/mpu_cell.c
===================================================================
--- mars-src.orig/core/src/host/lib/mpu_cell.c
+++ mars-src/core/src/host/lib/mpu_cell.c
@@ -43,7 +43,7 @@
 #include "mars/context.h"
 #include "mars/error.h"
 
-#include "context_internal_types.h"
+#include "context_internal.h"
 #include "numa_internal.h"
 
 #ifdef MARS_ENABLE_NUMA
Index: mars-src/core/src/host/lib/shared_context.c
===================================================================
--- mars-src.orig/core/src/host/lib/shared_context.c
+++ mars-src/core/src/host/lib/shared_context.c
@@ -40,7 +40,7 @@
 #include "mars/context.h"
 #include "mars/error.h"
 
-#include "context_internal_types.h"
+#include "context_internal.h"
 #include "numa_internal.h"
 
 #ifdef MARS_ENABLE_NUMA
Index: mars-src/core/src/host/lib/workload_queue.c
===================================================================
--- mars-src.orig/core/src/host/lib/workload_queue.c
+++ mars-src/core/src/host/lib/workload_queue.c
@@ -44,7 +44,7 @@
 #include "mars/mutex.h"
 #include "mars/workload_queue.h"
 
-#include "context_internal_types.h"
+#include "context_internal.h"
 #include "kernel_internal_types.h"
 #include "workload_internal_types.h"
 






More information about the cbe-oss-dev mailing list