From: John Hodge Date: Mon, 25 Aug 2014 04:58:39 +0000 (+0800) Subject: Syscalls - Work on removing SysDebug (formatted), replacement takes just a string X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=d8238c6af5d96fb4c3638a253d16fb497f865f16;p=tpg%2Facess2.git Syscalls - Work on removing SysDebug (formatted), replacement takes just a string --- diff --git a/KernelLand/Kernel/GenSyscalls.pl b/KernelLand/Kernel/GenSyscalls.pl index 442921ff..e7e3cbe1 100755 --- a/KernelLand/Kernel/GenSyscalls.pl +++ b/KernelLand/Kernel/GenSyscalls.pl @@ -46,8 +46,9 @@ foreach my $call (@calls) } print HEADER " #define NUM_SYSCALLS ",$i," -#define SYS_DEBUG 0x100 -#define SYS_DEBUGHEX 0x101 +#define SYS_DEBUGS 0x100 +#define SYS_DEBUGF 0x101 +#define SYS_DEBUGHEX 0x102 #if !defined(__ASSEMBLER__) && !defined(NO_SYSCALL_STRS) static const char *cSYSCALL_NAMES[] = { diff --git a/KernelLand/Kernel/include/syscalls.h b/KernelLand/Kernel/include/syscalls.h index 0ad44133..9c68195d 100644 --- a/KernelLand/Kernel/include/syscalls.h +++ b/KernelLand/Kernel/include/syscalls.h @@ -78,8 +78,9 @@ #define SYS_UNMARSHALFD 94 // Accept a marshaled FD #define NUM_SYSCALLS 95 -#define SYS_DEBUG 0x100 -#define SYS_DEBUGHEX 0x101 +#define SYS_DEBUGS 0x100 +#define SYS_DEBUGF 0x101 +#define SYS_DEBUGHEX 0x102 #if !defined(__ASSEMBLER__) && !defined(NO_SYSCALL_STRS) static const char *cSYSCALL_NAMES[] = { diff --git a/KernelLand/Kernel/syscalls.c b/KernelLand/Kernel/syscalls.c index 5f52e0ee..7b4855ce 100644 --- a/KernelLand/Kernel/syscalls.c +++ b/KernelLand/Kernel/syscalls.c @@ -444,7 +444,11 @@ void SyscallHandler(tSyscallRegs *Regs) // -- Debug //#if DEBUG_BUILD - case SYS_DEBUG: + case SYS_DEBUGS: + CHECK_STR_NONULL( (char*)Regs->Arg1 ); + Log("Log: %08lli [%i] %s", now(), Threads_GetTID(), (const char*)Regs->Arg1); + break; + case SYS_DEBUGF: CHECK_STR_NONULL( (char*)Regs->Arg1 ); LogF("Log: %08lli [%i] ", now(), Threads_GetTID()); LogF((const char*)Regs->Arg1, diff --git a/Usermode/Libraries/ld-acess.so_src/arch/syscalls.s.h b/Usermode/Libraries/ld-acess.so_src/arch/syscalls.s.h index c783a9b9..1b9c3e82 100644 --- a/Usermode/Libraries/ld-acess.so_src/arch/syscalls.s.h +++ b/Usermode/Libraries/ld-acess.so_src/arch/syscalls.s.h @@ -37,9 +37,10 @@ SYSCALL1(_SysSetFaultHandler, SYS_SETFAULTHANDLER) SYSCALL1(_SysLoadModule, SYS_LOADMOD) -SYSCALL6(_ZN4_sys5debugEPKcz, 0x100) -SYSCALL6(_SysDebug, 0x100) -SYSCALL3(_SysDebugHex, 0x101) +SYSCALL6(_ZN4_sys5debugEPKcz, SYS_DEBUGF) +SYSCALL6(_SysDebug, SYS_DEBUGF) +//SYSCALL3(_SysDebugS, SYS_DEBUGS) +SYSCALL3(_SysDebugHex, SYS_DEBUGHEX) SYSCALL1(_SysGetPhys, SYS_GETPHYS) // uint64_t _SysGetPhys(uint addr) SYSCALL1(_SysAllocate, SYS_ALLOCATE) // uint64_t _SysAllocate(uint addr)