From: John Hodge Date: Mon, 21 Sep 2009 10:48:14 +0000 (+0800) Subject: Added support for 64-bit returns from syscalls X-Git-Tag: rel0.06~552 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=c90736022b1f62a99b15c8613aa7e3f514e01fc9;p=tpg%2Facess2.git Added support for 64-bit returns from syscalls - Also added SYS_GETPHYS --- diff --git a/Kernel/syscalls.c b/Kernel/syscalls.c index 84c9a924..ddcdfa2d 100644 --- a/Kernel/syscalls.c +++ b/Kernel/syscalls.c @@ -19,7 +19,8 @@ extern Uint Binary_Load(char *file, Uint *entryPoint); // === 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) @@ -52,6 +53,9 @@ void SyscallHandler(tSyscallRegs *Regs) 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 @@ -144,7 +148,12 @@ void SyscallHandler(tSyscallRegs *Regs) ret = -1; break; } + #if BITS < 64 + Regs->Return = ret&0xFFFFFFFF; + Regs->RetHi = ret >> 32; + #else Regs->Return = ret; + #endif Regs->Error = err; #if DEBUG LOG("SyscallHandler: err = %i", err);