summaryrefslogtreecommitdiff
path: root/Source/Library/Userland
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2009-10-20 18:30:50 +0200
committerAlexis211 <alexis211@gmail.com>2009-10-20 18:30:50 +0200
commit90b49b6f171108f272ff529f7546bd9625ca7d17 (patch)
treec32f714fc7936867decb3a359effbc1f5c07dc64 /Source/Library/Userland
parent866580161b826443bed3862b8315cefd505de37c (diff)
downloadMelon-90b49b6f171108f272ff529f7546bd9625ca7d17.tar.gz
Melon-90b49b6f171108f272ff529f7546bd9625ca7d17.zip
Implemented static syscalls, specific to a class and not an object.
Diffstat (limited to 'Source/Library/Userland')
-rw-r--r--Source/Library/Userland/Binding/Process.class.h2
-rw-r--r--Source/Library/Userland/Binding/Thread.class.h2
-rw-r--r--Source/Library/Userland/Binding/VirtualTerminal.class.h2
-rw-r--r--Source/Library/Userland/Syscall/RessourceCaller.class.cpp4
-rw-r--r--Source/Library/Userland/Syscall/RessourceCaller.class.h5
5 files changed, 9 insertions, 6 deletions
diff --git a/Source/Library/Userland/Binding/Process.class.h b/Source/Library/Userland/Binding/Process.class.h
index e532ad3..00afe27 100644
--- a/Source/Library/Userland/Binding/Process.class.h
+++ b/Source/Library/Userland/Binding/Process.class.h
@@ -5,7 +5,7 @@
class Process : public RessourceCaller {
public:
static Process get() {
- u32int id = RessourceCaller::getObjId(PRIF_OBJTYPE);
+ u32int id = RessourceCaller::sCall(PRIF_OBJTYPE, PRIF_SGETCPR);
return Process(id);
}
Process(u32int id) : RessourceCaller(id, PRIF_OBJTYPE) {}
diff --git a/Source/Library/Userland/Binding/Thread.class.h b/Source/Library/Userland/Binding/Thread.class.h
index 1a354d3..a19c256 100644
--- a/Source/Library/Userland/Binding/Thread.class.h
+++ b/Source/Library/Userland/Binding/Thread.class.h
@@ -5,7 +5,7 @@
class Thread : public RessourceCaller {
public:
static Thread get() {
- u32int id = RessourceCaller::getObjId(THIF_OBJTYPE);
+ u32int id = RessourceCaller::sCall(THIF_OBJTYPE, THIF_SGETCTH);
return Thread(id);
}
Thread(u32int id) : RessourceCaller(id, THIF_OBJTYPE) {}
diff --git a/Source/Library/Userland/Binding/VirtualTerminal.class.h b/Source/Library/Userland/Binding/VirtualTerminal.class.h
index 4329c86..0da1be4 100644
--- a/Source/Library/Userland/Binding/VirtualTerminal.class.h
+++ b/Source/Library/Userland/Binding/VirtualTerminal.class.h
@@ -8,7 +8,7 @@
class VirtualTerminal : public RessourceCaller {
public:
static VirtualTerminal get() {
- u32int id = RessourceCaller::getObjId(VTIF_OBJTYPE);
+ u32int id = RessourceCaller::sCall(VTIF_OBJTYPE, VTIF_SGETPRVT);
return VirtualTerminal(id);
}
VirtualTerminal(u32int id) : RessourceCaller(id, VTIF_OBJTYPE) {}
diff --git a/Source/Library/Userland/Syscall/RessourceCaller.class.cpp b/Source/Library/Userland/Syscall/RessourceCaller.class.cpp
index 2d7b6ba..f3b61a8 100644
--- a/Source/Library/Userland/Syscall/RessourceCaller.class.cpp
+++ b/Source/Library/Userland/Syscall/RessourceCaller.class.cpp
@@ -7,8 +7,8 @@ RessourceCaller::RessourceCaller(u32int id, u32int type) {
if (m_type != type) m_type = 0;
}
-u32int RessourceCaller::getObjId(u32int type) {
- return syscall(0xFFFFFE00, type);
+u32int RessourceCaller::sCall(u32int type, u8int wat, u32int a, u32int b, u32int c, u32int d) {
+ return syscall(0xFFFFFE00 | wat, type, a, b, c, d);
}
u32int RessourceCaller::doCall(u8int call, u32int a, u32int b, u32int c, u32int d, u32int e) {
diff --git a/Source/Library/Userland/Syscall/RessourceCaller.class.h b/Source/Library/Userland/Syscall/RessourceCaller.class.h
index 3602ef0..85beacf 100644
--- a/Source/Library/Userland/Syscall/RessourceCaller.class.h
+++ b/Source/Library/Userland/Syscall/RessourceCaller.class.h
@@ -21,7 +21,10 @@ class RessourceCaller {
protected:
RessourceCaller(u32int id, u32int type);
- static u32int getObjId(u32int type);
+
+ //Static call -- a call specific to a class and not an object
+ static u32int sCall(u32int type, u8int wat, u32int a = 0, u32int b = 0, u32int c = 0, u32int d = 0);
+
u32int doCall(u8int call, u32int a = 0, u32int b = 0, u32int c = 0, u32int d = 0, u32int e = 0);
public: