diff options
author | Alexis211 <alexis211@gmail.com> | 2009-10-18 17:50:02 +0200 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2009-10-18 17:50:02 +0200 |
commit | eb7b832d47bcbd74181028c62e871d407ba63a23 (patch) | |
tree | 29489cb58898c77860fe83118ef30689e131ae2d /Source/Library | |
parent | e589a45295a871f38d4a1d1f23b370b612f99be5 (diff) | |
download | Melon-eb7b832d47bcbd74181028c62e871d407ba63a23.tar.gz Melon-eb7b832d47bcbd74181028c62e871d407ba63a23.zip |
More work on syscalls
Diffstat (limited to 'Source/Library')
-rw-r--r-- | Source/Library/Interface/Process.iface.h | 8 | ||||
-rw-r--r-- | Source/Library/Interface/Thread.iface.h | 8 | ||||
-rw-r--r-- | Source/Library/Userland/Binding/Process.class.h | 19 | ||||
-rw-r--r-- | Source/Library/Userland/Binding/Thread.class.h | 19 | ||||
-rw-r--r-- | Source/Library/Userland/Binding/VirtualTerminal.class.h (renamed from Source/Library/Userland/VirtualTerminal.class.h) | 0 |
5 files changed, 54 insertions, 0 deletions
diff --git a/Source/Library/Interface/Process.iface.h b/Source/Library/Interface/Process.iface.h new file mode 100644 index 0000000..d639725 --- /dev/null +++ b/Source/Library/Interface/Process.iface.h @@ -0,0 +1,8 @@ +#ifndef DEF_PROCESS_IFACE_H +#define DEF_PROCESS_IFACE_H + +#define PR_IFACE_OBJTYPE 0x20 +#define PR_IFACE_EXIT 0x01 +#define PR_IFACE_ALLOCPAGE 0x02 + +#endif diff --git a/Source/Library/Interface/Thread.iface.h b/Source/Library/Interface/Thread.iface.h new file mode 100644 index 0000000..2a64924 --- /dev/null +++ b/Source/Library/Interface/Thread.iface.h @@ -0,0 +1,8 @@ +#ifndef DEF_THREAD_IFACE_H +#define DEF_THREAD_IFACE_H + +#define TH_IFACE_OBJTYPE 0x21 +#define TH_IFACE_SLEEP 0x01 +#define TH_IFACE_FINISH 0x02 + +#endif diff --git a/Source/Library/Userland/Binding/Process.class.h b/Source/Library/Userland/Binding/Process.class.h new file mode 100644 index 0000000..c484e19 --- /dev/null +++ b/Source/Library/Userland/Binding/Process.class.h @@ -0,0 +1,19 @@ +#include <Syscall/RessourceCaller.class.h> + +#include <Process.iface.h> + +class Process : public RessourceCaller { + public: + static Process get() { + u32int id = RessourceCaller::getObjId(PR_IFACE_OBJTYPE); + return Process(id); + } + Process(u32int id) : RessourceCaller(id, PR_IFACE_OBJTYPE) {} + + void exit() { + doCall(PR_IFACE_EXIT); + } + void allocPage(u32int pos) { + doCall(PR_IFACE_ALLOCPAGE, pos); + } +}; diff --git a/Source/Library/Userland/Binding/Thread.class.h b/Source/Library/Userland/Binding/Thread.class.h new file mode 100644 index 0000000..beef9c5 --- /dev/null +++ b/Source/Library/Userland/Binding/Thread.class.h @@ -0,0 +1,19 @@ +#include <Syscall/RessourceCaller.class.h> + +#include <Thread.iface.h> + +class Thread : public RessourceCaller { + public: + static Thread get() { + u32int id = RessourceCaller::getObjId(TH_IFACE_OBJTYPE); + return Thread(id); + } + Thread(u32int id) : RessourceCaller(id, TH_IFACE_OBJTYPE) {} + + void sleep(u32int msecs) { + doCall(TH_IFACE_SLEEP, msecs); + } + void finish(u32int errcode) { + doCall(TH_IFACE_FINISH, errcode); + } +}; diff --git a/Source/Library/Userland/VirtualTerminal.class.h b/Source/Library/Userland/Binding/VirtualTerminal.class.h index a7bb4c2..a7bb4c2 100644 --- a/Source/Library/Userland/VirtualTerminal.class.h +++ b/Source/Library/Userland/Binding/VirtualTerminal.class.h |