summaryrefslogtreecommitdiff
path: root/Source/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Library')
-rw-r--r--Source/Library/Interface/Process.iface.h8
-rw-r--r--Source/Library/Interface/Thread.iface.h8
-rw-r--r--Source/Library/Userland/Binding/Process.class.h19
-rw-r--r--Source/Library/Userland/Binding/Thread.class.h19
-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