From 49cb3875e56a97ecb4adb4be5dd4ed018faf3f58 Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 22 Sep 2008 18:42:24 +0200 Subject: [PATCH] Compilation fixes of aquosa cpu module --- frsh_aquosa/Makefile.omk | 10 ++++---- frsh_aquosa/core.c | 49 ++++++++++++++++++++-------------------- 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/frsh_aquosa/Makefile.omk b/frsh_aquosa/Makefile.omk index 7dacc6e..d56941b 100644 --- a/frsh_aquosa/Makefile.omk +++ b/frsh_aquosa/Makefile.omk @@ -1,8 +1,6 @@ lib_LIBRARIES = frsh_aquosa -SUBDIRS = aquosa +CFLAGS += -I /usr/local/aquosa/include frsh_aquosa_SOURCES += core.c cpu_contract.c -include_HEADERS += cpu_contract.h -include_HEADERS +=$(wildcard aquosa/qresmod/*.h) -include_HEADERS +=$(wildcard aquosa/rresmod/*.h) - -lib_LOADLIBES+= frsh +include_HEADERS += cpu_contract.h timespec_usec_ops.h +#include_HEADERS +=$(wildcard aquosa/qresmod/*.h) +#include_HEADERS +=$(wildcard aquosa/rresmod/*.h) diff --git a/frsh_aquosa/core.c b/frsh_aquosa/core.c index 18ef48e..dc71352 100644 --- a/frsh_aquosa/core.c +++ b/frsh_aquosa/core.c @@ -94,9 +94,6 @@ * AQuoSA will be in place */ -/*******************/ -/* I N C L U D E S */ -/*******************/ /* Linux files */ #include @@ -110,19 +107,35 @@ /* FRSH files */ #include "fosa.h" +#include "frsh_error.h" /* AQuoSA files */ -#include "qres_lib.h" -#include "qsup_lib.h" +#include "aquosa/qres_lib.h" +#include "aquosa/qsup_lib.h" /* local timepsec <-> usec utility macros */ -#include "frsh_time_extras.h" +#include "timespec_usec_ops.h" -/***********************************/ -/* G L O B A L V A R I A B L E S */ -/***********************************/ +static int aqcpu_initialized = 0; /* initialization flag */ +/* + * Test whether Aquosa Cpu modue is initialized + * + */ + +static inline int aqcpu_is_initialized() +{ + return (aqcpu_initialized == 1); +} -//int frsh_initialized = 0; /* framework initialization flag */ + +/* + * installed as an exit handler (with 'atexit()') by the initialization + * code... For now it only calls the cleanup function of the AQuoSA + * Framework + */ +static void aqcpu_cleanup_wrapper() { + return qres_cleanup(); +} /* * frsh_init(), initialize FRSH for the calling process @@ -145,10 +158,8 @@ * FRSH_ERR_INTERNAL_ERROR (something, different from the previous case, gone wrong) */ -/* forward declarations, see below ... */ -static void frsh_qres_cleanup_wrapper(); -int frsh_aquosa_init() +int aqcpu_init() { /* check FRSH is not already initialized */ /*if (frsh_initialized) @@ -162,22 +173,12 @@ int frsh_aquosa_init() /* install the cleanup function of th AQuoSA framework as an exit * handler function (quite futile but, for now, it's sufficent) */ - if (atexit(frsh_qres_cleanup_wrapper)) + if (atexit(aqcpu_cleanup_wrapper)) FRSH_ERR_RET(FRSH_ERR_INTERNAL_ERROR); return FRSH_NO_ERROR; } -/* - * installed as an exit handler (with 'atexit()') by the initialization - * code... For now it only calls the cleanup function of the AQuoSA - * Framework - */ -static void frsh_qres_cleanup_wrapper() { - if (qres_cleanup() != QOS_OK) - PERROR_FRESCOR(FRSH_ERR_INTERNAL_ERROR, - "WARNING: error during clenup of AQuoSA framework"); -} /* * frsh_thread_bind(), create a new thread and bind it to a vres -- 2.39.2