2008-08-08 Robert Millan <rmh@aybabtu.com>

* kern/disk.c: Replace `<grub/machine/time.h>' with `<grub/time.h>'.
        (grub_last_time): Change type to grub_uint64_t.
        (grub_disk_open): Migrate code from to using grub_get_time_ms().
        (grub_disk_close): Likewise.

        * normal/menu.c: Replace `<grub/machine/time.h>' with `<grub/time.h>'.
        (run_menu): Migrate code from to using grub_get_time_ms().

        * util/misc.c (grub_get_time_ms): New function.
This commit is contained in:
robertmh 2008-08-07 23:48:13 +00:00
parent 7f280db554
commit 042bd419da
4 changed files with 35 additions and 12 deletions

View file

@ -33,6 +33,7 @@
#include <grub/util/misc.h>
#include <grub/mm.h>
#include <grub/term.h>
#include <grub/time.h>
#include <grub/machine/time.h>
/* Include malloc.h, only if memalign is available. It is known that
@ -284,6 +285,16 @@ grub_get_rtc (void)
* GRUB_TICKS_PER_SECOND / 1000000));
}
grub_uint64_t
grub_get_time_ms (void)
{
struct timeval tv;
gettimeofday (&tv, 0);
return (tv.tv_sec * 1000 + tv.tv_usec / 1000);
}
void
grub_arch_sync_caches (void *address __attribute__ ((unused)),
grub_size_t len __attribute__ ((unused)))