X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=AcessNative%2Facesskernel_src%2Fsyscalls.c;h=9b9fda4280af62a355d83979fe7042a5368bf975;hb=9d2ff6cf13e1a0ec5cbdc2773e1a3204e600b2e5;hp=58dc80171cf245a83ab481ca6b6fe5dd9a51f287;hpb=6d6b367c4f5e413a9e4135d9f5c40077c3724525;p=tpg%2Facess2.git diff --git a/AcessNative/acesskernel_src/syscalls.c b/AcessNative/acesskernel_src/syscalls.c index 58dc8017..9b9fda42 100644 --- a/AcessNative/acesskernel_src/syscalls.c +++ b/AcessNative/acesskernel_src/syscalls.c @@ -4,7 +4,7 @@ * * Syscall Distribution */ -#define DEBUG 1 +#define DEBUG 0 #include #include #include @@ -194,10 +194,21 @@ SYSCALL2(Syscall_SendMessage, "id", int, void *, return Proc_SendMessage(a0, Sizes[1], a1); ); -SYSCALL2(Syscall_GetMessage, "dd", Uint *, void *, - if( Sizes[0] < sizeof(*a0) ) +SYSCALL2(Syscall_GetMessage, "dd", uint32_t *, void *, + if( a0 && Sizes[0] < sizeof(*a0) ) { + Log_Notice("Syscalls", "Syscall_GetMessage - Arg 1 Undersize (%i < %i)", + Sizes[0], sizeof(*a0)); return -1; - return Proc_GetMessage(a0, a1); + } + Uint tmp; + int rv; + if( a0 ) { + rv = Proc_GetMessage(&tmp, a1); + *a0 = tmp; + } + else + rv = Proc_GetMessage(NULL, a1); + return rv; ); SYSCALL1(Syscall_WaitEvent, "i", int, @@ -298,7 +309,7 @@ tRequestHeader *SyscallRecieve(tRequestHeader *Request, int *ReturnLength) } formatString[i] = '\0'; - //LOG("Request %i(%s) '%s'", Request->CallID, casSYSCALL_NAMES[Request->CallID], formatString); + LOG("Request %i(%s) '%s'", Request->CallID, casSYSCALL_NAMES[Request->CallID], formatString); { char argListData[argListLen]; @@ -341,7 +352,13 @@ tRequestHeader *SyscallRecieve(tRequestHeader *Request, int *ReturnLength) } // Check for non-resident data - if( Request->Params[i].Flags & ARG_FLAG_ZEROED ) + if( Request->Params[i].Length == 0 ) + { + returnData[i] = NULL; + *(void**)&argListData[argListLen] = NULL; + argListLen += sizeof(void*); + } + else if( Request->Params[i].Flags & ARG_FLAG_ZEROED ) { // Allocate and zero the buffer returnData[i] = calloc(1, Request->Params[i].Length);