]> rtime.felk.cvut.cz Git - frescor/fosa.git/commitdiff
Cleanup and bugfixes of FOSA implementation of AQuoSA (compile without warnings or...
authorfaggioli <faggioli@35b4ef3e-fd22-0410-ab77-dab3279adceb>
Thu, 14 Jun 2007 17:31:53 +0000 (17:31 +0000)
committerfaggioli <faggioli@35b4ef3e-fd22-0410-ab77-dab3279adceb>
Thu, 14 Jun 2007 17:31:53 +0000 (17:31 +0000)
git-svn-id: http://www.frescor.org/private/svn/frescor/fosa/trunk@487 35b4ef3e-fd22-0410-ab77-dab3279adceb

src_aquosa/Makefile [new file with mode: 0644]
src_aquosa/fosa_clocks_and_timers.c
src_aquosa/fosa_threads_and_signals.c

diff --git a/src_aquosa/Makefile b/src_aquosa/Makefile
new file mode 100644 (file)
index 0000000..1758301
--- /dev/null
@@ -0,0 +1,98 @@
+##
+## Makefile for FSF/FRSH C library
+##                             by Miguel Telleria de Esteban
+##                                Univ. de Cantabria
+##                                telleriam@unican.es
+##                             by Dario Faggioli
+##                                Scuola Superiore S. Anna, Pisa
+#                                 faggioli@gandalf.sssup.it
+##
+## --------------------------------------------
+
+
+# Here we define FRSHPATH, IPATH, OBJOPT, LPATH, EXTRALIBS, CFLAGS, LDFLAGS
+
+PLATFORM = AQuoSA
+
+include ../../frsh/frsh_rules.mk
+
+# Add AQuoSA needed stuff for the code to compile successfully
+
+# this should be parametric !!
+AQUOSA_DIR = /usr/local/aquosa
+
+IPATH += -I$(AQUOSA_DIR)/include/aquosa -I$(AQUOSA_DIR)/include
+LPATH += -L$(AQUOSA_DIR)/lib
+EXTRALIBS += -lqreslib -lqsuplib
+
+# this two should go into frsh_rules.mk !!
+EXTRALIBS += -lpthread
+OBJOPT += -fPIC
+# this should be parametric
+#OBJOPT += -DFRSH_CONFIG_ENABLE_DEBUG -DFRSH_CONFIG_ENABLE_DEBUG_ASSERTS \
+       -DFRSH_CONFIG_ENABLE_SERVICE_TH_MULTITHREAD \
+       -DFRSH_CONFIG_SERVICE_TH_LOCAL_MACHINE \
+       -DFRSH_CONFIG_ENABLE_SERVICE_TH_SAFETY_CHECK
+
+# List of files #
+#################
+STATIC_NAME = libfosa_qres.a
+
+SHARED_NAME = libfosa_qres.so
+
+SRC = fosa_clocks_and_timers.c fosa_threads_and_signals.c frsh_fosa.c fosa_mutexes_and_condvars.c
+
+PUBLIC_H_FOSA = fosa_app_def_sched.h fosa.h fosa_opaque_types.h fosa_clocks_and_timers.h \
+               fosa_configuration_parameters.h fosa_mutexes_and_condvars.h fosa_threads_and_signals.h \
+               fosa_types.h
+
+PUBLIC_H_FRSH_FOSA = frsh_fosa.h frsh_fosa_opaque.h
+
+OBJS = $(SRC:.c=.o)
+
+PUBLIC_H_LOCATIONS = $(addprefix $(FOSAPATH)/include/, $(PUBLIC_H_FOSA) )  $(addprefix $(FRSHPATH)/include, $(PUBLIC_H_FRSH_FOSA) )
+
+# Library and linking  rules #
+##############################
+
+all: ../lib/$(STATIC_NAME) ../lib/$(SHARED_NAME)
+
+../lib/$(STATIC_NAME): $(OBJS)
+       @exec echo -n "=> Generating libfosa_qres.a: ";
+       @$(AR) -rc $@ $(OBJS)
+#      $(RANLIB) $@
+       @exec echo "  [OK]"
+
+../lib/$(SHARED_NAME): $(OBJS)
+       @exec echo -n "=> Generating libfosa_qres.so: ";
+       @$(CC) -shared -o $@ $(OBJS)
+       @exec echo "  [OK]"
+
+
+# Compilation rule:  For simplicity we make all sources       #
+# depend on all header files.                                 #
+# NB. $< represents the first prerequisite (in this case %.c) #
+###############################################################
+
+%.o: %.c $(PUBLIC_H_FILE_LOCATIONS) $(PRIVATE_H)
+       @exec echo -n "=> Compiling $<: ";
+       @$(CC) $(CFLAGS) -c $< 
+       @exec echo "  [OK]"
+
+# Clean up #
+############
+
+clean: lib-uninstall
+       @exec echo -n "=> Cleaning up FOSA: ";
+       -@rm -f $(OBJS)
+       @exec echo "  [OK]"
+
+lib-uninstall:
+       @exec echo -n "=> Removing FOSA library files: ";
+       -@rm -f ../lib/$(STATIC_NAME)
+       -@rm -f ../lib/$(SHARED_NAME)
+       @exec echo "  [OK]"
+
+
+.PHONY: lib-uninstall clean
+
index 77f4bdd6eedb6ae8067cc4c1462fcd2fd06570c0..9de5c7219573de5d4199cb99021839e466fb4bb5 100644 (file)
@@ -96,7 +96,7 @@ int fosa_timer_create(fosa_clock_id_t clockid,
 
        event.sigev_notify = SIGEV_SIGNAL;
        event.sigev_signo = signal;
-       event.sigev_value.sival_int = info.value;
+       event.sigev_value.sival_int = info.sival_int;
 
        return timer_create(clockid, &event, timerid);
 }
index 4b0ae300474090b8caa577d8b87b87f9317d673a..32e1442c91aeb1e0a00e3274c258cfcb712fc25d 100644 (file)
@@ -58,6 +58,7 @@
 //================================================
 
 #include <linux/unistd.h>
+#include <unistd.h>
 #include <fosa.h>
 
 /*************************
@@ -248,7 +249,7 @@ int fosa_signal_queue(frsh_signal_t signal,
 {
        union sigval siginfo;
 
-       siginfo.sival_int = info.value;
+       siginfo.sival_int = info.sival_int;
        return sigqueue(receiver.linux_pid, signal, siginfo);
 }
 
@@ -270,7 +271,7 @@ int fosa_signal_wait (frsh_signal_t set[],
                return -1;
        /* return back informations for the caller */
        *signal_received = recv_signal_info.si_signo;
-       info->value = recv_signal_info.si_value.sival_int;
+       info->sival_int = recv_signal_info.si_value.sival_int;
        /* reset the signal mask to original one (orrible hack!!) */
        pthread_sigmask(SIG_SETMASK, &original_mask, NULL);
 
@@ -298,7 +299,7 @@ int fosa_signal_timedwait(frsh_signal_t set[],
        if (signal_received != NULL)
                *signal_received = recv_signal_info.si_signo;
        if (info != NULL)
-               info->value = recv_signal_info.si_value.sival_int;
+               info->sival_int = recv_signal_info.si_value.sival_int;
        /* reset the signal mask to original one (orrible hack!!) */
        pthread_sigmask(SIG_SETMASK, &original_mask, NULL);