Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/mach Implement timebase_info. We don't know exact...



details:   https://anonhg.NetBSD.org/src/rev/b2c26bdb7c15
branches:  trunk
changeset: 539922:b2c26bdb7c15
user:      manu <manu%NetBSD.org@localhost>
date:      Fri Nov 29 17:08:16 2002 +0000

description:
Implement timebase_info. We don't know exactly what it should do yet...

diffstat:

 sys/compat/mach/mach_clock.c |  28 ++++++++++++++++++++++++++--
 sys/compat/mach/mach_misc.c  |  16 ++--------------
 sys/compat/mach/mach_types.h |   6 +++---
 3 files changed, 31 insertions(+), 19 deletions(-)

diffs (108 lines):

diff -r cd5ff5de7a35 -r b2c26bdb7c15 sys/compat/mach/mach_clock.c
--- a/sys/compat/mach/mach_clock.c      Fri Nov 29 17:08:06 2002 +0000
+++ b/sys/compat/mach/mach_clock.c      Fri Nov 29 17:08:16 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_clock.c,v 1.2 2002/11/28 21:21:32 manu Exp $ */
+/*     $NetBSD: mach_clock.c,v 1.3 2002/11/29 17:08:16 manu Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mach_clock.c,v 1.2 2002/11/28 21:21:32 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mach_clock.c,v 1.3 2002/11/29 17:08:16 manu Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -102,6 +102,30 @@
 
        return 0;
 }
+int
+mach_sys_timebase_info(p, v, retval)
+       struct proc *p;
+       void *v;
+       register_t *retval;
+{
+       struct mach_sys_timebase_info_args /*
+               syscallarg(mach_timebase_info_t) info;
+       */ *uap = v;
+       int error;
+       struct mach_timebase_info info;
+
+       /* XXX This is probably bus speed, fill it accurately */
+       info.numer = 4000000000UL;
+       info.denom = 75189611UL;
+
+       if ((error = copyout(&info, (void *)SCARG(uap, info), 
+           sizeof(info))) != 0)
+               return error;
+
+       return 0;
+}
+
+
 
 int 
 mach_clock_get_time(p, msgh, maxlen, dst)
diff -r cd5ff5de7a35 -r b2c26bdb7c15 sys/compat/mach/mach_misc.c
--- a/sys/compat/mach/mach_misc.c       Fri Nov 29 17:08:06 2002 +0000
+++ b/sys/compat/mach/mach_misc.c       Fri Nov 29 17:08:16 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_misc.c,v 1.13 2002/11/28 21:21:32 manu Exp $       */
+/*     $NetBSD: mach_misc.c,v 1.14 2002/11/29 17:08:16 manu Exp $       */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mach_misc.c,v 1.13 2002/11/28 21:21:32 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mach_misc.c,v 1.14 2002/11/29 17:08:16 manu Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -273,18 +273,6 @@
 
 
 int
-mach_sys_timebase_info(struct proc *p, void *v, register_t *r) {
-#ifdef DEBUG_MACH
-       struct mach_sys_timebase_info_args *ap = v;
-#endif
-       *r = 0;
-       DPRINTF(("mach_sys_timebase_info(%p);\n",
-           &SCARG(ap, info)));
-       return 0;
-}
-
-
-int
 mach_sys_wait_until(struct proc *p, void *v, register_t *r) {
 #ifdef DEBUG_MACH
        struct mach_sys_wait_until_args *ap = v;
diff -r cd5ff5de7a35 -r b2c26bdb7c15 sys/compat/mach/mach_types.h
--- a/sys/compat/mach/mach_types.h      Fri Nov 29 17:08:06 2002 +0000
+++ b/sys/compat/mach/mach_types.h      Fri Nov 29 17:08:16 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_types.h,v 1.6 2002/11/26 08:10:19 manu Exp $       */
+/*     $NetBSD: mach_types.h,v 1.7 2002/11/29 17:08:16 manu Exp $       */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -59,10 +59,10 @@
 typedef unsigned long mach_vm_offset_t;
 typedef void *mach_cproc_t;    /* Unkown, see xnu/osfmk/ppc/hw_exception.s */
 
-typedef struct {
+typedef struct mach_timebase_info {
        u_int32_t       numer;
        u_int32_t       denom;
-} mach_timebase_info_t;
+} *mach_timebase_info_t;
 
 typedef struct {
        u_int8_t       mig_vers;



Home | Main Index | Thread Index | Old Index