summaryrefslogtreecommitdiff
path: root/Source/Kernel/TaskManager
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/Kernel/TaskManager
parent866580161b826443bed3862b8315cefd505de37c (diff)
downloadMelon-90b49b6f171108f272ff529f7546bd9625ca7d17.tar.gz
Melon-90b49b6f171108f272ff529f7546bd9625ca7d17.zip
Implemented static syscalls, specific to a class and not an object.
Diffstat (limited to 'Source/Kernel/TaskManager')
-rw-r--r--Source/Kernel/TaskManager/Process.class.cpp5
-rw-r--r--Source/Kernel/TaskManager/Process.class.h2
-rw-r--r--Source/Kernel/TaskManager/Thread.class.cpp5
-rw-r--r--Source/Kernel/TaskManager/Thread.class.h2
4 files changed, 14 insertions, 0 deletions
diff --git a/Source/Kernel/TaskManager/Process.class.cpp b/Source/Kernel/TaskManager/Process.class.cpp
index 7ebac72..a2bbfb4 100644
--- a/Source/Kernel/TaskManager/Process.class.cpp
+++ b/Source/Kernel/TaskManager/Process.class.cpp
@@ -16,6 +16,11 @@ call_t Process::m_callTable[] = {
CALL0(0, 0)
};
+u32int Process::scall(u8int wat, u32int a, u32int b, u32int c, u32int d) {
+ if (wat == PRIF_SGETCPR) return Task::currProcess()->resId();
+ return (u32int) - 1;
+}
+
Process::Process() : Ressource(PRIF_OBJTYPE, m_callTable) { //Private constructor, does nothing
}
diff --git a/Source/Kernel/TaskManager/Process.class.h b/Source/Kernel/TaskManager/Process.class.h
index 0013dfb..89efd0c 100644
--- a/Source/Kernel/TaskManager/Process.class.h
+++ b/Source/Kernel/TaskManager/Process.class.h
@@ -53,6 +53,8 @@ class Process : public Ressource {
u32int allocPageSC(u32int);
public:
+ static u32int scall(u8int, u32int, u32int, u32int, u32int);
+
static Process* createKernel(String cmdline, VirtualTerminal *vt); //Also creates a Thread for what's curently happening
static Process* run(String filename, FSNode* cwd, u32int uid);
Process(String cmdline, u32int uid);
diff --git a/Source/Kernel/TaskManager/Thread.class.cpp b/Source/Kernel/TaskManager/Thread.class.cpp
index d846630..21ef954 100644
--- a/Source/Kernel/TaskManager/Thread.class.cpp
+++ b/Source/Kernel/TaskManager/Thread.class.cpp
@@ -12,6 +12,11 @@ call_t Thread::m_callTable[] = {
CALL0(0, 0)
};
+u32int Thread::scall(u8int wat, u32int a, u32int b, u32int c, u32int d) {
+ if (wat == THIF_SGETCTH) return Task::currThread()->resId();
+ return (u32int) - 1;
+}
+
void runThread(Thread* thread, void* data, thread_entry_t entry_point) {
if (thread->m_isKernel) {
asm volatile("sti");
diff --git a/Source/Kernel/TaskManager/Thread.class.h b/Source/Kernel/TaskManager/Thread.class.h
index 5938e2e..35a9fd6 100644
--- a/Source/Kernel/TaskManager/Thread.class.h
+++ b/Source/Kernel/TaskManager/Thread.class.h
@@ -43,6 +43,8 @@ class Thread : public Ressource {
u32int finishSC(u32int errcode);
public:
+ static u32int scall(u8int, u32int, u32int, u32int, u32int);
+
Thread(thread_entry_t entry_point, void* data, bool iskernel = false); //Assumes process is current process, or is kprocess if isk
Thread(Process* process, thread_entry_t entry_point, void* data);
~Thread();