1 |
/* |
/* |
2 |
* GRUB -- GRand Unified Bootloader |
* GRUB -- GRand Unified Bootloader |
3 |
* Copyright (C) 2002,2003 Free Software Foundation, Inc. |
* Copyright (C) 2002,2003,2005 Free Software Foundation, Inc. |
4 |
* |
* |
5 |
* GRUB is free software; you can redistribute it and/or modify |
* GRUB is free software; you can redistribute it and/or modify |
6 |
* it under the terms of the GNU General Public License as published by |
* it under the terms of the GNU General Public License as published by |
23 |
#include <string.h> |
#include <string.h> |
24 |
#include <sys/types.h> |
#include <sys/types.h> |
25 |
#include <sys/stat.h> |
#include <sys/stat.h> |
26 |
#include <sys/times.h> |
#include <sys/time.h> |
27 |
#include <malloc.h> |
#include <malloc.h> |
28 |
#include <unistd.h> |
#include <unistd.h> |
29 |
|
|
30 |
#include <grub/util/misc.h> |
#include <grub/util/misc.h> |
31 |
#include <grub/mm.h> |
#include <grub/mm.h> |
32 |
#include <grub/term.h> |
#include <grub/term.h> |
33 |
|
#include <grub/machine/time.h> |
34 |
|
|
35 |
char *progname = 0; |
char *progname = 0; |
36 |
int verbosity = 0; |
int verbosity = 0; |
257 |
grub_uint32_t |
grub_uint32_t |
258 |
grub_get_rtc (void) |
grub_get_rtc (void) |
259 |
{ |
{ |
260 |
struct tms currtime; |
struct timeval tv; |
261 |
|
|
262 |
return times (&currtime); |
gettimeofday (&tv, 0); |
263 |
|
|
264 |
|
return (tv.tv_sec * GRUB_TICKS_PER_SECOND |
265 |
|
+ (((tv.tv_sec % GRUB_TICKS_PER_SECOND) * 1000000 + tv.tv_usec) |
266 |
|
* GRUB_TICKS_PER_SECOND / 1000000)); |
267 |
} |
} |
268 |
|
|
269 |
void |
void |