summaryrefslogtreecommitdiff
path: root/Source/Kernel/SyscallManager/Ressource.class.h
blob: 5f4e6bf4de32f3208075b6d27db82a84f937974d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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