Usermode/syscalls - Add SysDebugHex syscall (Debug_HexDump)
authorJohn Hodge <[email protected]>
Fri, 6 Jun 2014 15:41:28 +0000 (23:41 +0800)
committerJohn Hodge <[email protected]>
Fri, 6 Jun 2014 15:41:28 +0000 (23:41 +0800)
- Also disable assertion on STB_WEAK locals

KernelLand/Kernel/GenSyscalls.pl
KernelLand/Kernel/include/syscalls.h
KernelLand/Kernel/syscalls.c
Usermode/Libraries/ld-acess.so_src/arch/syscalls.s.h
Usermode/Libraries/ld-acess.so_src/elf.c
Usermode/Libraries/ld-acess.so_src/include_exp/acess/sys.h

index fdf33e9..442921f 100755 (executable)
@@ -47,6 +47,7 @@ foreach my $call (@calls)
 print HEADER "
 #define NUM_SYSCALLS   ",$i,"
 #define SYS_DEBUG      0x100
+#define SYS_DEBUGHEX   0x101
 
 #if !defined(__ASSEMBLER__) && !defined(NO_SYSCALL_STRS)
 static const char *cSYSCALL_NAMES[] = {
index 9916458..b040fc9 100644 (file)
@@ -72,6 +72,7 @@
 
 #define NUM_SYSCALLS   88
 #define SYS_DEBUG      0x100
+#define SYS_DEBUGHEX   0x101
 
 #if !defined(__ASSEMBLER__) && !defined(NO_SYSCALL_STRS)
 static const char *cSYSCALL_NAMES[] = {
index d2f9185..6b970d6 100644 (file)
@@ -388,6 +388,11 @@ void SyscallHandler(tSyscallRegs *Regs)
                        Regs->Arg2, Regs->Arg3, Regs->Arg4, Regs->Arg5, Regs->Arg6);
                LogF("\r\n");
                break;
+       case SYS_DEBUGHEX:
+               CHECK_STR_NONULL( (char*)Regs->Arg1 );
+               CHECK_NUM_NONULL( (void*)Regs->Arg2, Regs->Arg3 );
+               Debug_HexDump( (const char*)Regs->Arg1, (void*)Regs->Arg2, Regs->Arg3 );
+               break;
        //#endif
        
        // -- Default (Return Error)
index 14ee2da..aa09b3b 100644 (file)
@@ -39,6 +39,8 @@ SYSCALL1(_SysLoadModule, SYS_LOADMOD)
 
 SYSCALL6(_ZN4_sys5debugEPKcz, 0x100)
 SYSCALL6(_SysDebug, 0x100)
+SYSCALL2(_SysDebugHex, 0x101)
+
 SYSCALL1(_SysGetPhys, SYS_GETPHYS)     // uint64_t _SysGetPhys(uint addr)
 SYSCALL1(_SysAllocate, SYS_ALLOCATE)   // uint64_t _SysAllocate(uint addr)
 SYSCALL3(_SysSetMemFlags, SYS_SETFLAGS)        // uint32_t SysSetMemFlags(uint addr, uint flags, uint mask)
index 236983c..bcf66cc 100644 (file)
@@ -346,8 +346,8 @@ void *Elf32Relocate(void *Base, char **envp, const char *Filename)
                        if( ELF32_ST_BIND(sym->st_info) == STB_WEAK )
                        {
                                WARNING("TODO: Weak bound local symbols '%s'", name);
-                               assert(ELF32_ST_BIND(sym->st_info) != STB_WEAK);
-                               return NULL;
+                               //assert(ELF32_ST_BIND(sym->st_info) != STB_WEAK);
+                               //return NULL;
                        }
                        TRACE("Sym %i'%s' %p += 0x%x", i, name, sym->st_value, iBaseDiff);
                        sym->st_value += iBaseDiff;
@@ -445,7 +445,7 @@ void *Elf32Relocate(void *Base, char **envp, const char *Filename)
                {
                        // Handled previously
                        // TODO: What about weak locally-defined symbols?
-                       assert( ELF32_ST_BIND(sym->st_info) != STB_WEAK );
+                       //assert( ELF32_ST_BIND(sym->st_info) != STB_WEAK );
                }
        }
        if( fail ) {
index d32f8c3..21b575f 100644 (file)
@@ -51,6 +51,7 @@ extern int    _errno;
 
 // === FUNCTIONS ===
 extern void    _SysDebug(const char *format, ...);
+extern void    _SysDebugHex(const char *Label, const void *Data, size_t Size);
 // --- Proc ---
 extern void    _exit(int status)       __attribute__((noreturn));
 extern int     _SysKill(int pid, int sig);

UCC git Repository :: git.ucc.asn.au