Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LYm3k-0005jx-5X for mharc-grub-devel@gnu.org; Sun, 15 Feb 2009 13:49:44 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LYm3h-0005jd-9B for grub-devel@gnu.org; Sun, 15 Feb 2009 13:49:41 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LYm3f-0005jR-Rg for grub-devel@gnu.org; Sun, 15 Feb 2009 13:49:41 -0500 Received: from [199.232.76.173] (port=44595 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LYm3f-0005jO-B5 for grub-devel@gnu.org; Sun, 15 Feb 2009 13:49:39 -0500 Received: from moutng.kundenserver.de ([212.227.17.10]:53411) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LYm3e-0007RV-O8 for grub-devel@gnu.org; Sun, 15 Feb 2009 13:49:39 -0500 Received: from [85.180.28.51] (e180028051.adsl.alicedsl.de [85.180.28.51]) by mrelayeu.kundenserver.de (node=mrelayeu0) with ESMTP (Nemesis) id 0MKwh2-1LYm3S41pk-0006Y3; Sun, 15 Feb 2009 19:49:27 +0100 From: Felix Zielcke To: The development of GRUB 2 Content-Type: multipart/mixed; boundary="=-69XOuplqhnHX/yukQPPV" Date: Sun, 15 Feb 2009 19:49:38 +0100 Message-Id: <1234723778.4746.7.camel@fz.local> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 X-Provags-ID: V01U2FsdGVkX1+xpK24RKccFnHN6pYmlYelXUl32yPxQo93IuL XIRfSnRDQPKVYkkZHR8nXWAYo+QNkm6uxqKGHeXoTV8qPy/0eB FJFW4qzOwM+kPinp4SMiDR1vw/1W4nW X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [PATCH] implement grub_millisleep in util/misc.c for grub-emu X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 18:49:42 -0000 --=-69XOuplqhnHX/yukQPPV Content-Type: text/plain Content-Transfer-Encoding: 7bit Here's a small patch which implements grub_millisleep () using nanosleep () in util/misc.c. I hope it's correct. -- Felix Zielcke --=-69XOuplqhnHX/yukQPPV Content-Disposition: attachment; filename=millisleep.diff Content-Type: text/x-patch; name=millisleep.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit 2009-02-15 Felix Zielcke * util/misc.c: Define _POSIX_C_SOURCE 199309L. Include . (grub_millisleep): New function. Index: util/misc.c =================================================================== --- util/misc.c (revision 1996) +++ util/misc.c (working copy) @@ -27,6 +27,9 @@ #include #include +#define _POSIX_C_SOURCE 199309L +#include + #include #include #include @@ -310,6 +313,16 @@ grub_get_time_ms (void) 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))) --=-69XOuplqhnHX/yukQPPV--