commit-grub
[Top][All Lists]
Advanced

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

[2013] 2009-03-04 Felix Zielcke <address@hidden>


From: Felix Zielcke
Subject: [2013] 2009-03-04 Felix Zielcke <address@hidden>
Date: Wed, 04 Mar 2009 10:25:32 +0000

Revision: 2013
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2013
Author:   fzielcke
Date:     2009-03-04 10:25:31 +0000 (Wed, 04 Mar 2009)
Log Message:
-----------
2009-03-04  Felix Zielcke  <address@hidden>

        * util/misc.c: Include <time.h>.
        (grub_millisleep): New function.

Modified Paths:
--------------
    trunk/grub2/util/misc.c

Modified: trunk/grub2/util/misc.c
===================================================================
--- trunk/grub2/util/misc.c     2009-03-04 05:56:31 UTC (rev 2012)
+++ trunk/grub2/util/misc.c     2009-03-04 10:25:31 UTC (rev 2013)
@@ -1,6 +1,6 @@
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2002,2003,2005,2006,2007,2008  Free Software Foundation, Inc.
+ *  Copyright (C) 2002,2003,2005,2006,2007,2008,2009  Free Software 
Foundation, Inc.
  *
  *  GRUB is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -26,6 +26,7 @@
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <unistd.h>
+#include <time.h>
 
 #include <grub/kernel.h>
 #include <grub/misc.h>
@@ -310,6 +311,16 @@
   return (tv.tv_sec * 1000 + tv.tv_usec / 1000);
 }
 
+void
+grub_millisleep (grub_uint32_t ms)
+{
+  struct timespec ts;
+
+  ts.tv_sec = ms / 1000;
+  ts.tv_nsec = (ms % 1000) * 1000000;
+  nanosleep (&ts, NULL);
+}
+
 void 
 grub_arch_sync_caches (void *address __attribute__ ((unused)),
                       grub_size_t len __attribute__ ((unused)))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]