[Cbe-oss-dev] [PATCH 05/10 v2]MARS/core: Workload module split fix build files

Yuji Mano yuji.mano at am.sony.com
Wed Nov 26 09:50:05 EST 2008


This fixes the build and implementation for the core library after the removal
of task related sources.

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

---
v2:
- fix workload_queue.c implementation to remove usage of obsolete TYPE workload bits

 core/src/host/lib/Makefile.am      |   35 ++++++++--------------------------
 core/src/host/lib/context.c        |    2 -
 core/src/host/lib/mutex.c          |    2 -
 core/src/host/lib/workload_queue.c |   18 +++++------------
 core/src/mpu/lib/Makefile.am       |   38 ++++++++++++-------------------------
 core/src/mpu/lib/mutex.c           |    6 +----
 6 files changed, 31 insertions(+), 70 deletions(-)

--- a/core/src/host/lib/Makefile.am
+++ b/core/src/host/lib/Makefile.am
@@ -59,21 +59,12 @@ MAINTAINERCLEANFILES = Makefile.in
 pkginclude_HEADERS = \
 	$(srcdir)/../../../include/common/mars/error.h \
 	$(srcdir)/../../../include/common/mars/mutex_types.h \
-	$(srcdir)/../../../include/common/mars/task_barrier_types.h \
-	$(srcdir)/../../../include/common/mars/task_event_flag_types.h \
-	$(srcdir)/../../../include/common/mars/task_queue_types.h \
-	$(srcdir)/../../../include/common/mars/task_semaphore_types.h \
-	$(srcdir)/../../../include/common/mars/task_types.h \
+	$(srcdir)/../../../include/common/mars/workload_types.h \
 	$(srcdir)/../../../include/host/mars/context.h \
 	$(srcdir)/../../../include/host/mars/core.h \
 	$(srcdir)/../../../include/host/mars/mars.h \
 	$(srcdir)/../../../include/host/mars/mutex.h \
-	$(srcdir)/../../../include/host/mars/task.h \
-	$(srcdir)/../../../include/host/mars/task_barrier.h \
-	$(srcdir)/../../../include/host/mars/task_event_flag.h \
-	$(srcdir)/../../../include/host/mars/task_queue.h \
-	$(srcdir)/../../../include/host/mars/task_semaphore.h \
-	$(srcdir)/../../../include/host/mars/task_signal.h
+	$(srcdir)/../../../include/host/mars/workload_queue.h
 
 AM_CPPFLAGS = \
 	$(extra_cppflags) \
@@ -95,28 +86,20 @@ AM_CFLAGS = \
 AM_LDFLAGS = \
 	$(extra_ldflags)
 
-lib_LTLIBRARIES = libmars.la
+lib_LTLIBRARIES = libmars_core.la
 
-libmars_la_SOURCES = \
+libmars_core_la_SOURCES = \
 	$(srcdir)/../../../src/common/*.h \
 	alloc.c \
 	context.c \
-	context_internal_types.h \
 	ea.c \
 	mutex.c \
-	task.c \
-	task_barrier.c \
-	task_event_flag.c \
-	task_queue.c \
-	task_semaphore.c \
-	task_signal.c \
-	workload_queue.c \
-	workload_queue.h
+	workload_queue.c
 
-nodist_libmars_la_SOURCES = \
+nodist_libmars_core_la_SOURCES = \
 	mars_kernel.eo
 
-libmars_la_DEPENDENCIES = mars_kernel.eo
+libmars_core_la_DEPENDENCIES = mars_kernel.eo
 
 mars_kernel.eo: ${MARS_KERNEL}
 	$(EMBEDSPU) $(CFLAGS) mars_kernel_entry  $< $@
@@ -134,10 +117,10 @@ mars_kernel.eo: ${MARS_KERNEL}
 # * keep 'current' and 'revision', and increment 'age', if there's no API
 #   change but implementation is changed.
 
-libmars_la_LDFLAGS = \
+libmars_core_la_LDFLAGS = \
 	-version-info 1:0:0 \
 	-Wl,-Map -Wl,$@.map -Wl,--cref
 
-libmars_la_LIBADD = -lspe2
+libmars_core_la_LIBADD = -lspe2
 
 CLEANFILES = *.eo *.map
--- a/core/src/host/lib/context.c
+++ b/core/src/host/lib/context.c
@@ -43,10 +43,10 @@
 #include "mars/context.h"
 #include "mars/core.h"
 #include "mars/error.h"
+#include "mars/workload_queue.h"
 
 #include "context_internal_types.h"
 #include "kernel_internal_types.h"
-#include "workload_queue.h"
 
 extern struct spe_program_handle mars_kernel_entry;
 static struct mars_context *mars_shared_context;
--- a/core/src/host/lib/mutex.c
+++ b/core/src/host/lib/mutex.c
@@ -41,8 +41,6 @@
 #include "mars/error.h"
 #include "mars/mutex.h"
 
-#include "mutex_internal_types.h"
-
 int mars_mutex_create(struct mars_mutex **mutex_ret)
 {
 	struct mars_mutex *mutex;
--- a/core/src/host/lib/workload_queue.c
+++ b/core/src/host/lib/workload_queue.c
@@ -36,18 +36,17 @@
  */
 
 #include <sched.h>
-#include <unistd.h>
 #include <string.h>
+#include <unistd.h>
 
 #include "mars/core.h"
-#include "mars/mutex.h"
 #include "mars/error.h"
+#include "mars/mutex.h"
+#include "mars/workload_queue.h"
 
 #include "context_internal_types.h"
-#include "mutex_internal_types.h"
 #include "kernel_internal_types.h"
 #include "workload_internal_types.h"
-#include "workload_queue.h"
 
 int mars_workload_queue_create(struct mars_context *mars)
 {
@@ -79,8 +78,6 @@ int mars_workload_queue_create(struct ma
 		for (index = 0; index < MARS_WORKLOAD_PER_BLOCK; index++) {
 			uint64_t *bits = &queue->block[block].bits[index];
 
-			MARS_BITS_SET(bits, TYPE,
-				MARS_WORKLOAD_TYPE_NONE);
 			MARS_BITS_SET(bits, STATE,
 				MARS_WORKLOAD_STATE_NONE);
 			MARS_BITS_SET(bits, PRIORITY,
@@ -115,7 +112,7 @@ int mars_workload_queue_destroy(struct m
 
 	queue = mars->workload_queue;
 
-	/* check for any tasks left in workload queue */
+	/* check for any workloads left in workload queue */
 	while (id < MARS_WORKLOAD_MAX) {
 		block = id / MARS_WORKLOAD_PER_BLOCK;
 		index = id % MARS_WORKLOAD_PER_BLOCK;
@@ -154,7 +151,7 @@ int mars_workload_queue_exit(struct mars
 }
 
 int mars_workload_queue_add_begin(struct mars_context *mars,
-				uint16_t *id, uint8_t type,
+				uint16_t *id,
 				struct mars_workload_context **workload)
 {
 	struct mars_workload_queue *queue;
@@ -169,8 +166,6 @@ int mars_workload_queue_add_begin(struct
 		return MARS_ERROR_STATE;
 	if (!id)
 		return MARS_ERROR_NULL;
-	if (type != MARS_WORKLOAD_TYPE_TASK)
-		return MARS_ERROR_PARAMS;
 
 	queue = mars->workload_queue;
 
@@ -206,8 +201,7 @@ int mars_workload_queue_add_begin(struct
 		return MARS_ERROR_STATE;
 	}
 
-	/* set type and set state to adding */
-	MARS_BITS_SET(bits, TYPE, type);
+	/* set state to adding */
 	MARS_BITS_SET(bits, STATE, MARS_WORKLOAD_STATE_ADDING);
 
 	mars_mutex_unlock((struct mars_mutex *)&queue->block[block]);
--- a/core/src/mpu/lib/Makefile.am
+++ b/core/src/mpu/lib/Makefile.am
@@ -57,20 +57,12 @@ MAINTAINERCLEANFILES = Makefile.in
 pkginclude_HEADERS = \
 	$(srcdir)/../../../include/common/mars/error.h \
 	$(srcdir)/../../../include/common/mars/mutex_types.h \
-	$(srcdir)/../../../include/common/mars/task_types.h \
-	$(srcdir)/../../../include/common/mars/task_barrier_types.h \
-	$(srcdir)/../../../include/common/mars/task_event_flag_types.h \
-	$(srcdir)/../../../include/common/mars/task_queue_types.h \
-	$(srcdir)/../../../include/common/mars/task_semaphore_types.h \
+	$(srcdir)/../../../include/common/mars/workload_types.h \
 	$(srcdir)/../../../include/mpu/mars/core.h \
+	$(srcdir)/../../../include/mpu/mars/dma.h \
 	$(srcdir)/../../../include/mpu/mars/mars.h \
-	$(srcdir)/../../../include/mpu/mars/mutex.h \
-	$(srcdir)/../../../include/mpu/mars/task.h \
-	$(srcdir)/../../../include/mpu/mars/task_barrier.h \
-	$(srcdir)/../../../include/mpu/mars/task_event_flag.h \
-	$(srcdir)/../../../include/mpu/mars/task_queue.h \
-	$(srcdir)/../../../include/mpu/mars/task_semaphore.h \
-	$(srcdir)/../../../include/mpu/mars/task_signal.h
+	$(srcdir)/../../../include/mpu/mars/module.h \
+	$(srcdir)/../../../include/mpu/mars/mutex.h
 
 AM_CPPFLAGS = \
 	$(extra_cppflags) \
@@ -79,6 +71,7 @@ AM_CPPFLAGS = \
 	-I$(srcdir)/../../../src/common
 
 AM_CFLAGS = \
+	$(extra_cflags) \
 	-W \
 	-Wall \
 	-Wunused \
@@ -88,18 +81,13 @@ AM_CFLAGS = \
 	-Wmissing-prototypes \
 	-Wmissing-declarations
 
-lib_LIBRARIES = libmars.a
+AM_LDFLAGS = \
+	$(extra_ldflags) \
+	-static
 
-libmars_a_SOURCES = \
+lib_LTLIBRARIES = libmars_core.la
+
+libmars_core_la_SOURCES = \
 	$(srcdir)/../../../src/common/*.h \
-	dma.h \
-	entry.S \
-	mutex.c \
-	syscalls.c \
-	syscalls.h \
-	task.c \
-	task_barrier.c \
-	task_event_flag.c \
-	task_queue.c \
-	task_semaphore.c \
-	task_signal.c
+	module.c \
+	mutex.c
--- a/core/src/mpu/lib/mutex.c
+++ b/core/src/mpu/lib/mutex.c
@@ -37,11 +37,9 @@
 
 #include <spu_mfcio.h>
 
-#include "mars/mutex.h"
+#include "mars/dma.h"
 #include "mars/error.h"
-
-#include "mutex_internal_types.h"
-#include "dma.h"
+#include "mars/mutex.h"
 
 static struct mars_mutex mutex;
 





More information about the cbe-oss-dev mailing list