summaryrefslogtreecommitdiff
path: root/Source/Kernel/SyscallManager/Ressource.class.h
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-10-18 17:17:36 +0200
committerAlexis211 <alexis211@gmail.com>2009-10-18 17:17:36 +0200
commite589a45295a871f38d4a1d1f23b370b612f99be5 (patch)
treeb59f1190633368d78b23d78e011c99fa8fa3cc90 /Source/Kernel/SyscallManager/Ressource.class.h
parent323e12f1f9ab33df15dcfed210e807561d98fa8c (diff)
downloadMelon-e589a45295a871f38d4a1d1f23b370b612f99be5.tar.gz
Melon-e589a45295a871f38d4a1d1f23b370b612f99be5.zip
Syscall interface starts being implemented !
Diffstat (limited to 'Source/Kernel/SyscallManager/Ressource.class.h')
-rw-r--r--Source/Kernel/SyscallManager/Ressource.class.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/Source/Kernel/SyscallManager/Ressource.class.h b/Source/Kernel/SyscallManager/Ressource.class.h
new file mode 100644
index 0000000..5f4e6bf
--- /dev/null
+++ b/Source/Kernel/SyscallManager/Ressource.class.h
@@ -0,0 +1,54 @@
+#ifndef DEF_RESSOURCE_CLASS_H
+#define DEF_RESSOURCE_CLASS_H
+
+#include <SimpleList.class.h>
+
+class Ressource;
+
+typedef u32int (Ressource::*call0)();
+typedef u32int (Ressource::*call1)(u32int);
+typedef u32int (Ressource::*call2)(u32int, u32int);
+typedef u32int (Ressource::*call3)(u32int, u32int, u32int);
+typedef u32int (Ressource::*call4)(u32int, u32int, u32int, u32int);
+typedef u32int (Ressource::*call5)(u32int, u32int, u32int, u32int, u32int);
+
+struct call_t {
+ u8int params;
+ u8int id;
+ union {
+ call0 c0;
+ call1 c1;
+ call2 c2;
+ call3 c3;
+ call4 c4;
+ call5 c5;
+ };
+};
+
+class Ressource {
+ private:
+ Ressource(const Ressource&);
+ Ressource& operator=(const Ressource&);
+
+ u32int m_id;
+ u32int m_type;
+ SimpleList<call_t> *m_calls;
+
+ protected:
+ Ressource(u8int type);
+ ~Ressource();
+
+ void addCall0(u8int id, call0 c);
+ void addCall1(u8int id, call1 c);
+ void addCall2(u8int id, call2 c);
+ void addCall3(u8int id, call3 c);
+ void addCall4(u8int id, call4 c);
+ void addCall5(u8int id, call5 c);
+
+ public:
+ u32int doCall(u8int id, u32int a, u32int b, u32int c, u32int d, u32int e);
+ u32int resId() { return m_id; }
+ u32int resType() { return m_type; }
+};
+
+#endif