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)
* AQuoSA will be in place
*/
-/*******************/
-/* I N C L U D E S */
-/*******************/
/* Linux files */
#include <unistd.h>
/* 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
* 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)
/* 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