git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed bug in libc.so/brk(), fixed support for VT100 escape codes
[tpg/acess2.git]
/
Kernel
/
syscalls.c
diff --git
a/Kernel/syscalls.c
b/Kernel/syscalls.c
index
d89d6e6
..
ddcdfa2
100644
(file)
--- a/
Kernel/syscalls.c
+++ b/
Kernel/syscalls.c
@@
-2,7
+2,7
@@
* AcessOS Microkernel Version
* syscalls.c
*/
* AcessOS Microkernel Version
* syscalls.c
*/
-#define DEBUG
1
+#define DEBUG
0
#include <common.h>
#include <syscalls.h>
#include <common.h>
#include <syscalls.h>
@@
-19,7
+19,8
@@
extern Uint Binary_Load(char *file, Uint *entryPoint);
// === CODE ===
void SyscallHandler(tSyscallRegs *Regs)
{
// === CODE ===
void SyscallHandler(tSyscallRegs *Regs)
{
- Uint ret=0, err=0;
+ Uint64 ret = 0;
+ Uint err = 0;
#if DEBUG
ENTER("iThread iNum", gCurrentThread->TID, Regs->Num);
if(Regs->Num < NUM_SYSCALLS)
#if DEBUG
ENTER("iThread iNum", gCurrentThread->TID, Regs->Num);
if(Regs->Num < NUM_SYSCALLS)
@@
-52,6
+53,9
@@
void SyscallHandler(tSyscallRegs *Regs)
ret = -1;
break;
ret = -1;
break;
+ case SYS_GETPHYS:
+ ret = MM_GetPhysAddr(Regs->Arg1);
+ break;
// -- Map an address
case SYS_MAP: MM_Map(Regs->Arg1, Regs->Arg2); break;
// -- Allocate an address
// -- Map an address
case SYS_MAP: MM_Map(Regs->Arg1, Regs->Arg2); break;
// -- Allocate an address
@@
-120,6
+124,14
@@
void SyscallHandler(tSyscallRegs *Regs)
#endif
break;
#endif
break;
+ case SYS_READ:
+ #if BITS < 64
+ VFS_Read( Regs->Arg1, Regs->Arg2|((Uint64)Regs->Arg3<<32), (void*)Regs->Arg4 );
+ #else
+ VFS_Read( Regs->Arg1, Regs->Arg2, (void*)Regs->Arg3 );
+ #endif
+ break;
+
// -- Debug
case SYS_DEBUG:
// -- Debug
case SYS_DEBUG:
@@
-136,7
+148,12
@@
void SyscallHandler(tSyscallRegs *Regs)
ret = -1;
break;
}
ret = -1;
break;
}
+ #if BITS < 64
+ Regs->Return = ret&0xFFFFFFFF;
+ Regs->RetHi = ret >> 32;
+ #else
Regs->Return = ret;
Regs->Return = ret;
+ #endif
Regs->Error = err;
#if DEBUG
LOG("SyscallHandler: err = %i", err);
Regs->Error = err;
#if DEBUG
LOG("SyscallHandler: err = %i", err);
UCC
git Repository :: git.ucc.asn.au