root / Whitix / branches / hybrid / kernel / sys.c

Revision 531, 1.4 kB (checked in by mwhitworth, 3 months ago)

Remove big system call list, add export code.

Line 
1/*  This file is part of Whitix.
2 *
3 *  Whitix is free software; you can redistribute it and/or modify
4 *  it under the terms of the GNU General Public License as published by
5 *  the Free Software Foundation; either version 2 of the License, or
6 *  (at your option) any later version.
7 *
8 *  Whitix is distributed in the hope that it will be useful,
9 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 *  GNU General Public License for more details.
12 *
13 *  You should have received a copy of the GNU General Public License
14 *  along with Whitix; if not, write to the Free Software
15 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
16 *
17 */
18
19#include <sys.h>
20#include <console.h>
21#include <module.h>
22#include <i386/virtual.h>
23
24struct SysCall sysCallTable[SYSCALL_MAX];
25
26void SysRegisterCall(int index, struct SysCall* call)
27{
28        if (index > SYSCALL_MAX)
29                return;
30
31        memcpy(&sysCallTable[index], call, sizeof(struct SysCall));
32}
33
34SYMBOL_EXPORT(SysRegisterCall);
35
36void SysRegisterRange(int index, struct SysCall* calls)
37{
38        struct SysCall* currCall=calls;
39
40        while (currCall->addr)
41                SysRegisterCall(index++, currCall++);
42}
43
44SYMBOL_EXPORT(SysRegisterRange);
45
46DWORD SysGetCall(DWORD index, DWORD argBytes)
47{
48        if (index > SYSCALL_MAX)
49                return 0;
50
51        if (sysCallTable[index].numBytes != argBytes)
52                return 0;
53
54        return sysCallTable[index].addr;
55}
Note: See TracBrowser for help on using the browser.