Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/darwin Add the kdebug_trace system call. It does ...



details:   https://anonhg.NetBSD.org/src/rev/a53a10c69ee6
branches:  trunk
changeset: 555957:a53a10c69ee6
user:      manu <manu%NetBSD.org@localhost>
date:      Thu Dec 04 23:59:50 2003 +0000

description:
Add the kdebug_trace system call. It does nothing but dumping anything it
gets. dyd uses that feature when DYLD_TRACE is set.

diffstat:

 sys/compat/darwin/darwin_ptrace.c      |  35 ++++++++++++++++++++++++++++++++-
 sys/compat/darwin/darwin_syscall.h     |   7 ++++-
 sys/compat/darwin/darwin_syscallargs.h |  15 ++++++++++++-
 sys/compat/darwin/darwin_syscalls.c    |   8 +++---
 sys/compat/darwin/darwin_sysent.c      |  10 ++++----
 sys/compat/darwin/syscalls.master      |   5 ++-
 6 files changed, 63 insertions(+), 17 deletions(-)

diffs (201 lines):

diff -r 4ed6bef9d69e -r a53a10c69ee6 sys/compat/darwin/darwin_ptrace.c
--- a/sys/compat/darwin/darwin_ptrace.c Thu Dec 04 23:57:44 2003 +0000
+++ b/sys/compat/darwin/darwin_ptrace.c Thu Dec 04 23:59:50 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: darwin_ptrace.c,v 1.1 2003/11/20 07:12:34 manu Exp $ */
+/*     $NetBSD: darwin_ptrace.c,v 1.2 2003/12/04 23:59:50 manu Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: darwin_ptrace.c,v 1.1 2003/11/20 07:12:34 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: darwin_ptrace.c,v 1.2 2003/12/04 23:59:50 manu Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -154,3 +154,34 @@
        
        return 0;
 }
+
+int
+darwin_sys_kdebug_trace(l, v, retval)
+       struct lwp *l;
+       void *v;
+       register_t *retval;
+{
+       struct darwin_sys_kdebug_trace_args /* {
+               syscallarg(int) debugid;
+               syscallarg(int) arg1;
+               syscallarg(int) arg2;
+               syscallarg(int) arg3;
+               syscallarg(int) arg4;
+               syscallarg(int) arg5;
+       } */ *uap = v;
+       int args[4];
+       char *str;
+
+       args[0] = SCARG(uap, arg1);
+       args[1] = SCARG(uap, arg2);
+       args[2] = SCARG(uap, arg3);
+       args[3] = 0;
+       str = (char*)args;
+
+#ifdef DEBUG_DARWIN
+       printf("darwin_sys_kdebug_trace(%x, (%x %x %x)/\"%s\", %x, %x)\n",
+           SCARG(uap, debugid), SCARG(uap, arg1), SCARG(uap, arg2), 
+           SCARG(uap, arg3), str, SCARG(uap, arg4), SCARG(uap, arg5));
+#endif
+       return 0;
+}
diff -r 4ed6bef9d69e -r a53a10c69ee6 sys/compat/darwin/darwin_syscall.h
--- a/sys/compat/darwin/darwin_syscall.h        Thu Dec 04 23:57:44 2003 +0000
+++ b/sys/compat/darwin/darwin_syscall.h        Thu Dec 04 23:59:50 2003 +0000
@@ -1,10 +1,10 @@
-/* $NetBSD: darwin_syscall.h,v 1.34 2003/11/20 07:12:34 manu Exp $ */
+/* $NetBSD: darwin_syscall.h,v 1.35 2003/12/04 23:59:50 manu Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from        NetBSD: syscalls.master,v 1.17 2003/09/06 11:50:02 manu Exp 
+ * created from        NetBSD: syscalls.master,v 1.18 2003/11/20 07:12:35 manu Exp 
  */
 
 /* syscall: "syscall" ret: "int" args: "int" "..." */
@@ -378,6 +378,9 @@
 /* syscall: "osetdomainname" ret: "int" args: "char *" "int" */
 #define        DARWIN_SYS_osetdomainname       163
 
+/* syscall: "kdebug_trace" ret: "int" args: "int" "int" "int" "int" "int" "int" */
+#define        DARWIN_SYS_kdebug_trace 180
+
 /* syscall: "setgid" ret: "int" args: "gid_t" */
 #define        DARWIN_SYS_setgid       181
 
diff -r 4ed6bef9d69e -r a53a10c69ee6 sys/compat/darwin/darwin_syscallargs.h
--- a/sys/compat/darwin/darwin_syscallargs.h    Thu Dec 04 23:57:44 2003 +0000
+++ b/sys/compat/darwin/darwin_syscallargs.h    Thu Dec 04 23:59:50 2003 +0000
@@ -1,10 +1,10 @@
-/* $NetBSD: darwin_syscallargs.h,v 1.34 2003/11/20 07:12:34 manu Exp $ */
+/* $NetBSD: darwin_syscallargs.h,v 1.35 2003/12/04 23:59:50 manu Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from        NetBSD: syscalls.master,v 1.17 2003/09/06 11:50:02 manu Exp 
+ * created from        NetBSD: syscalls.master,v 1.18 2003/11/20 07:12:35 manu Exp 
  */
 
 #ifndef _DARWIN_SYS__SYSCALLARGS_H_
@@ -227,6 +227,15 @@
 #else
 #endif
 
+struct darwin_sys_kdebug_trace_args {
+       syscallarg(int) debugid;
+       syscallarg(int) arg1;
+       syscallarg(int) arg2;
+       syscallarg(int) arg3;
+       syscallarg(int) arg4;
+       syscallarg(int) arg5;
+};
+
 struct darwin_sys_stat_args {
        syscallarg(const char *) path;
        syscallarg(struct stat12 *) ub;
@@ -594,6 +603,8 @@
 
 int    compat_09_sys_setdomainname(struct lwp *, void *, register_t *);
 
+int    darwin_sys_kdebug_trace(struct lwp *, void *, register_t *);
+
 int    sys_setgid(struct lwp *, void *, register_t *);
 
 int    sys_setegid(struct lwp *, void *, register_t *);
diff -r 4ed6bef9d69e -r a53a10c69ee6 sys/compat/darwin/darwin_syscalls.c
--- a/sys/compat/darwin/darwin_syscalls.c       Thu Dec 04 23:57:44 2003 +0000
+++ b/sys/compat/darwin/darwin_syscalls.c       Thu Dec 04 23:59:50 2003 +0000
@@ -1,14 +1,14 @@
-/* $NetBSD: darwin_syscalls.c,v 1.34 2003/11/20 07:12:34 manu Exp $ */
+/* $NetBSD: darwin_syscalls.c,v 1.35 2003/12/04 23:59:50 manu Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from        NetBSD: syscalls.master,v 1.17 2003/09/06 11:50:02 manu Exp 
+ * created from        NetBSD: syscalls.master,v 1.18 2003/11/20 07:12:35 manu Exp 
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: darwin_syscalls.c,v 1.34 2003/11/20 07:12:34 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: darwin_syscalls.c,v 1.35 2003/12/04 23:59:50 manu Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ktrace.h"
@@ -233,7 +233,7 @@
        "#177 (unimplemented)",         /* 177 = unimplemented */
        "#178 (unimplemented)",         /* 178 = unimplemented */
        "#179 (unimplemented)",         /* 179 = unimplemented */
-       "#180 (unimplemented kdebug_trace)",            /* 180 = unimplemented kdebug_trace */
+       "kdebug_trace",                 /* 180 = kdebug_trace */
        "setgid",                       /* 181 = setgid */
        "setegid",                      /* 182 = setegid */
        "seteuid",                      /* 183 = seteuid */
diff -r 4ed6bef9d69e -r a53a10c69ee6 sys/compat/darwin/darwin_sysent.c
--- a/sys/compat/darwin/darwin_sysent.c Thu Dec 04 23:57:44 2003 +0000
+++ b/sys/compat/darwin/darwin_sysent.c Thu Dec 04 23:59:50 2003 +0000
@@ -1,14 +1,14 @@
-/* $NetBSD: darwin_sysent.c,v 1.35 2003/11/20 07:12:34 manu Exp $ */
+/* $NetBSD: darwin_sysent.c,v 1.36 2003/12/04 23:59:50 manu Exp $ */
 
 /*
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from        NetBSD: syscalls.master,v 1.17 2003/09/06 11:50:02 manu Exp 
+ * created from        NetBSD: syscalls.master,v 1.18 2003/11/20 07:12:35 manu Exp 
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: darwin_sysent.c,v 1.35 2003/11/20 07:12:34 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: darwin_sysent.c,v 1.36 2003/12/04 23:59:50 manu Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_nfsserver.h"
@@ -418,8 +418,8 @@
            sys_nosys },                        /* 178 = unimplemented */
        { 0, 0, 0,
            sys_nosys },                        /* 179 = unimplemented */
-       { 0, 0, 0,
-           sys_nosys },                        /* 180 = unimplemented kdebug_trace */
+       { 6, s(struct darwin_sys_kdebug_trace_args), 0,
+           darwin_sys_kdebug_trace },          /* 180 = kdebug_trace */
        { 1, s(struct sys_setgid_args), 0,
            sys_setgid },                       /* 181 = setgid */
        { 1, s(struct sys_setegid_args), 0,
diff -r 4ed6bef9d69e -r a53a10c69ee6 sys/compat/darwin/syscalls.master
--- a/sys/compat/darwin/syscalls.master Thu Dec 04 23:57:44 2003 +0000
+++ b/sys/compat/darwin/syscalls.master Thu Dec 04 23:59:50 2003 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.18 2003/11/20 07:12:35 manu Exp $
+       $NetBSD: syscalls.master,v 1.19 2003/12/04 23:59:50 manu Exp $
 
 ;      @(#)syscalls.master     8.2 (Berkeley) 1/13/94
 
@@ -351,7 +351,8 @@
 177    UNIMPL
 178    UNIMPL
 179    UNIMPL
-180    UNIMPL          kdebug_trace
+180    STD             { int darwin_sys_kdebug_trace(int debugid, int arg1, \
+                           int arg2, int arg3, int arg4, int arg5); }
 181    NOARGS          { int sys_setgid(gid_t gid); }
 182    NOARGS          { int sys_setegid(gid_t egid); }
 183    NOARGS          { int sys_seteuid(uid_t euid); }



Home | Main Index | Thread Index | Old Index