From c90736022b1f62a99b15c8613aa7e3f514e01fc9 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Mon, 21 Sep 2009 18:48:14 +0800 Subject: [PATCH] Added support for 64-bit returns from syscalls - Also added SYS_GETPHYS --- Kernel/syscalls.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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); -- 2.20.1