From eb7b832d47bcbd74181028c62e871d407ba63a23 Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Sun, 18 Oct 2009 17:50:02 +0200 Subject: More work on syscalls --- Source/Library/Interface/Process.iface.h | 8 ++++++++ Source/Library/Interface/Thread.iface.h | 8 ++++++++ Source/Library/Userland/Binding/Process.class.h | 19 +++++++++++++++++++ Source/Library/Userland/Binding/Thread.class.h | 19 +++++++++++++++++++ .../Userland/Binding/VirtualTerminal.class.h | 22 ++++++++++++++++++++++ Source/Library/Userland/VirtualTerminal.class.h | 22 ---------------------- 6 files changed, 76 insertions(+), 22 deletions(-) create mode 100644 Source/Library/Interface/Process.iface.h create mode 100644 Source/Library/Interface/Thread.iface.h create mode 100644 Source/Library/Userland/Binding/Process.class.h create mode 100644 Source/Library/Userland/Binding/Thread.class.h create mode 100644 Source/Library/Userland/Binding/VirtualTerminal.class.h delete mode 100644 Source/Library/Userland/VirtualTerminal.class.h (limited to 'Source/Library') 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 + +#include + +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 + +#include + +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/Binding/VirtualTerminal.class.h b/Source/Library/Userland/Binding/VirtualTerminal.class.h new file mode 100644 index 0000000..a7bb4c2 --- /dev/null +++ b/Source/Library/Userland/Binding/VirtualTerminal.class.h @@ -0,0 +1,22 @@ +#include + +#include + +#include + +class VirtualTerminal : public RessourceCaller { + public: + static VirtualTerminal get() { + u32int id = RessourceCaller::getObjId(VT_IFACE_OBJTYPE); + return VirtualTerminal(id); + } + VirtualTerminal(u32int id) : RessourceCaller(id, VT_IFACE_OBJTYPE) {} + + void writeHex(u32int number) { + doCall(VT_IFACE_WRITEHEX, number); + } + + void put(WChar c) { + doCall(VT_IFACE_PUT, c); + } +}; diff --git a/Source/Library/Userland/VirtualTerminal.class.h b/Source/Library/Userland/VirtualTerminal.class.h deleted file mode 100644 index a7bb4c2..0000000 --- a/Source/Library/Userland/VirtualTerminal.class.h +++ /dev/null @@ -1,22 +0,0 @@ -#include - -#include - -#include - -class VirtualTerminal : public RessourceCaller { - public: - static VirtualTerminal get() { - u32int id = RessourceCaller::getObjId(VT_IFACE_OBJTYPE); - return VirtualTerminal(id); - } - VirtualTerminal(u32int id) : RessourceCaller(id, VT_IFACE_OBJTYPE) {} - - void writeHex(u32int number) { - doCall(VT_IFACE_WRITEHEX, number); - } - - void put(WChar c) { - doCall(VT_IFACE_PUT, c); - } -}; -- cgit v1.2.3