]> sourceware.org Git - newlib-cygwin.git/commitdiff
2010-11-17 Bernd Schmidt <bernds@codesourcery.com>
authorJeff Johnston <jjohnstn@redhat.com>
Wed, 17 Nov 2010 21:45:58 +0000 (21:45 +0000)
committerJeff Johnston <jjohnstn@redhat.com>
Wed, 17 Nov 2010 21:45:58 +0000 (21:45 +0000)
        * tic6x/syscalls.c (cio_getclk_to_host, cio_getclk_from_host): New
        structs.
        (cio_to_host, cio_from_host): Use them.
        (clock): New function.

libgloss/ChangeLog
libgloss/tic6x/syscalls.c

index 9dfe5b12fd40ef8c0c7edc7d1b7d10e0b55ff944..186960392969af88aeaebec99e6e3be38dad18ce 100644 (file)
@@ -1,3 +1,10 @@
+2010-11-17  Bernd Schmidt  <bernds@codesourcery.com>
+
+       * tic6x/syscalls.c (cio_getclk_to_host, cio_getclk_from_host): New
+       structs.
+       (cio_to_host, cio_from_host): Use them.
+       (clock): New function.
+
 2010-10-17  Mike Frysinger  <vapier@gentoo.org>
 
        * bfin/include/blackfin.h, bfin/include/builtins.h,
index dc0633ba6e4581503f9273cfe8279b457117780e..393fba6613e80f9bff982c288135182644353270 100644 (file)
@@ -149,6 +149,17 @@ struct __attribute__((packed)) cio_gettime_from_host
   int time;
 };
 
+struct __attribute__((packed)) cio_getclk_to_host
+{
+  /* Empty.  */
+};
+
+struct __attribute__((packed)) cio_getclk_from_host
+{
+  /* Clock cycles (little endian).  */
+  int result;
+};
+
 struct __attribute__((packed)) cio_to_host
 {
   /* Data length (target endian).  */
@@ -167,6 +178,7 @@ struct __attribute__((packed)) cio_to_host
     struct cio_unlink_to_host unlink;
     struct cio_rename_to_host rename;
     struct cio_gettime_to_host gettime;
+    struct cio_getclk_to_host getclk;
   } parms;
   /* Variable-length data.  */
   unsigned char data[];
@@ -188,6 +200,7 @@ struct __attribute__((packed)) cio_from_host
     struct cio_unlink_from_host unlink;
     struct cio_rename_from_host rename;
     struct cio_gettime_from_host gettime;
+    struct cio_getclk_from_host getclk;
   } parms;
   /* Data.  */
   unsigned char data[];
@@ -344,6 +357,14 @@ gettimeofday (struct timeval *tp, void *tzvp)
   return 0;
 }
 
+clock_t
+clock (void)
+{
+  semi_call_wrapper (_DTGETCLK, NULL, 0);
+  return SWAPINT (_CIOBUF_.u.from_host.parms.getclk.result);
+}
+
+
 int
 isatty (int file __attribute__((unused)))
 {
This page took 0.03529 seconds and 5 git commands to generate.