|
Revision 531, 1.4 kB
(checked in by mwhitworth, 3 months ago)
|
|
Remove big system call list, add export code.
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | #include <sys.h> |
|---|
| 20 | #include <console.h> |
|---|
| 21 | #include <module.h> |
|---|
| 22 | #include <i386/virtual.h> |
|---|
| 23 | |
|---|
| 24 | struct SysCall sysCallTable[SYSCALL_MAX]; |
|---|
| 25 | |
|---|
| 26 | void 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 | |
|---|
| 34 | SYMBOL_EXPORT(SysRegisterCall); |
|---|
| 35 | |
|---|
| 36 | void SysRegisterRange(int index, struct SysCall* calls) |
|---|
| 37 | { |
|---|
| 38 | struct SysCall* currCall=calls; |
|---|
| 39 | |
|---|
| 40 | while (currCall->addr) |
|---|
| 41 | SysRegisterCall(index++, currCall++); |
|---|
| 42 | } |
|---|
| 43 | |
|---|
| 44 | SYMBOL_EXPORT(SysRegisterRange); |
|---|
| 45 | |
|---|
| 46 | DWORD 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 | } |
|---|