From 48de0cd029b52f64f76345b6e1fdf3cde5c58de3 Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Fri, 23 Oct 2009 19:40:08 +0200 Subject: More work on syscalls and shell --- Source/Kernel/SyscallManager/Res.ns.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Source/Kernel/SyscallManager/Res.ns.h') diff --git a/Source/Kernel/SyscallManager/Res.ns.h b/Source/Kernel/SyscallManager/Res.ns.h index e454693..d3a0129 100644 --- a/Source/Kernel/SyscallManager/Res.ns.h +++ b/Source/Kernel/SyscallManager/Res.ns.h @@ -5,9 +5,19 @@ namespace Res { +extern Ressource** ressources; +extern u32int size; + u32int registerRes(Ressource* r); void unregisterRes(u32int id); +template +T* get(u32int id, u32int type) { + if (id > size or ressources[id] == 0) return 0; + if (ressources[id]->resType() != type) return 0; + return (T*)ressources[id]; +} + u32int call(u32int ressource, u8int wat, u32int a, u32int b, u32int c, u32int d, u32int e); } -- cgit v1.2.3