]> rtime.felk.cvut.cz Git - frescor/frsh.git/commitdiff
Added skeleton files for contract handling
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 7 Sep 2008 15:33:09 +0000 (17:33 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 7 Sep 2008 15:33:09 +0000 (17:33 +0200)
Makefile [new file with mode: 0644]
Makefile.omk [new file with mode: 0644]
contract-idl.idl [new file with mode: 0644]
contract.c [new file with mode: 0644]
contract.h [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..b22a357
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,14 @@
+# Generic directory or leaf node makefile for OCERA make framework
+
+ifndef MAKERULES_DIR
+MAKERULES_DIR := $(shell ( old_pwd="" ;  while [ ! -e Makefile.rules ] ; do if [ "$$old_pwd" = `pwd`  ] ; then exit 1 ; else old_pwd=`pwd` ; cd -L .. 2>/dev/null ; fi ; done ; pwd ) )
+endif
+
+ifeq ($(MAKERULES_DIR),)
+all : default
+.DEFAULT::
+       @echo -e "\nThe Makefile.rules has not been found in this or partent directory\n"
+else
+include $(MAKERULES_DIR)/Makefile.rules
+endif
+
diff --git a/Makefile.omk b/Makefile.omk
new file mode 100644 (file)
index 0000000..7eb64ef
--- /dev/null
@@ -0,0 +1,6 @@
+shared_LIBRARIES = frsh
+
+frsh_SOURCES = contract.c
+frsh_CLIENT_IDL = contract-idl.idl
+
+include_GEN_HEADERS = contract-idl.h
diff --git a/contract-idl.idl b/contract-idl.idl
new file mode 100644 (file)
index 0000000..e3eda15
--- /dev/null
@@ -0,0 +1,56 @@
+/**
+ * @file   contract-idl.idl
+ * @author Michal Sojka <sojkam1@fel.cvut.cz>
+ * @date   Sun Sep  7 17:24:37 2008
+ * 
+ * @brief Definitions of data types and constants for FRESCOR contracts.
+ * 
+ */
+
+module frsh {
+       struct timespec {
+               long tv_sec;
+               long tv_nsec;
+       };
+
+       // TODO: Try to use native types
+       typedef timespec fosa_rel_time_t;
+       typedef timespec fosa_abs_time_t;
+
+       enum frsh_contract_type_t {
+               FRSH_CT_REGULAR,
+               FRSH_CT_BACKGROUND,
+               FRSH_CT_DUMMY
+       };
+
+
+       native contract_t;
+       native contract_handle_t;
+
+
+       module contract {
+
+               /// Contains parameters of contracts grouped by
+               /// modules. Any other module can add their own
+               /// parameters.
+               module params {
+
+                       /// IDs of all (even externally defined) parameters
+                       enum id {
+                               BASIC_PARAMS,
+                               SPARE_CAPACITY_PARAMS
+                       };
+                       struct basic {
+                               fosa_rel_time_t budget;
+                               fosa_rel_time_t period;
+                               frsh_contract_type_t contract_type;
+                       };
+                       
+                       enum granularity_t { DISCRETE, CONTINUOUS };
+                       struct spare_capacity {
+                               fosa_rel_time_t stability_time;
+                               granularity_t granularity;
+                       };
+               };
+       };
+};
diff --git a/contract.c b/contract.c
new file mode 100644 (file)
index 0000000..7af9edf
--- /dev/null
@@ -0,0 +1,2 @@
+#include "contract.h"
+#include <contract-idl.h>
diff --git a/contract.h b/contract.h
new file mode 100644 (file)
index 0000000..774c54a
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef CONTRACT_H
+#define CONTRACT_H
+
+
+
+#endif