#define CONFIG_DEBUG_NET 1
#define CONFIG_DEBUG_IPC 1
#define CONFIG_DEBUG_HEAP 0
+#define CONFIG_DEBUG_SYSDEBUG 1
#define CONFIG_SOCKET_MAX 1024
#define CONFIG_NET_MBUF_SIZE 2048
return(0);
}
+#if FEATURE(DEBUG_SYSDEBUG)
+int sys_debug(const char *str, const u32_t len)
+{
+ char buffer[128];
+ int ret_val;
+ process_t *cproc;
+
+ cproc = process_get_current();
+ ret_val = len < sizeof(buffer) ? len : sizeof(buffer);
+
+ process_memcpy_ptok(cproc, buffer, str, ret_val);
+ buffer[sizeof(buffer) - 1] = 0;
+
+ dbg_printf("%s\n", buffer);
+
+ return(ret_val);
+}
+#endif /* FEATURE(DEBUG_SYSDEBUG) */
+
int sys_posixcall(stack_frame_t *stk)
{
int ret_val;
ret_val = sys_outb(stk);
break;
+#if FEATURE(DEBUG_SYSDEBUG)
+ case SYS_DEBUG:
+ ret_val = sys_debug((const char*)stk->ebx, (u32_t)stk->ecx);
+ break;
+#endif /* FEATURE(DEBUG_SYSDEBUG) */
+
default:
ret_val = -EOPNOTSUPP;
break;
.global mmap
.global munmap
+#if FEATURE(DEBUG_SYSDEBUG)
+ .global debug
+#endif /* FEATURE(DEBUG_SYSDEBUG) */
+
_exit:
pushl %ebx
popl %ebx
ret
+#if FEATURE(DEBUG_SYSDEBUG)
+debug:
+ pushl %ebx
+
+ movl $SYS_DEBUG, %eax
+ movl 8(%esp), %ebx
+ movl 12(%esp), %ecx
+ int $SYSCALL_POSIX
+
+ popl %ebx
+ ret
+
+#endif /* FEATURE(DEBUG_SYSDEBUG) */
+
#endif /* FEATURE(POSIX) */