Don't export grub_get_rtc.
* include/grub/i386/pc/time.h (grub_get_rtc): Don't export. * grub-core/commands/i386/pc/play.c (play): Use grub_get_time_ms.
This commit is contained in:
parent
e7d2a906b0
commit
e2a833958e
3 changed files with 14 additions and 8 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2012-02-26 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
Don't export grub_get_rtc.
|
||||||
|
|
||||||
|
* include/grub/i386/pc/time.h (grub_get_rtc): Don't export.
|
||||||
|
* grub-core/commands/i386/pc/play.c (play): Use grub_get_time_ms.
|
||||||
|
|
||||||
2012-02-26 Vladimir Serbinenko <phcoder@gmail.com>
|
2012-02-26 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/genmod.sh.in: Add -R .note.GNU-stack to strip.
|
* grub-core/genmod.sh.in: Add -R .note.GNU-stack to strip.
|
||||||
|
|
|
@ -24,14 +24,14 @@
|
||||||
#include <grub/disk.h>
|
#include <grub/disk.h>
|
||||||
#include <grub/term.h>
|
#include <grub/term.h>
|
||||||
#include <grub/misc.h>
|
#include <grub/misc.h>
|
||||||
#include <grub/machine/time.h>
|
|
||||||
#include <grub/cpu/io.h>
|
#include <grub/cpu/io.h>
|
||||||
#include <grub/command.h>
|
#include <grub/command.h>
|
||||||
#include <grub/i18n.h>
|
#include <grub/i18n.h>
|
||||||
|
#include <grub/time.h>
|
||||||
|
|
||||||
GRUB_MOD_LICENSE ("GPLv3+");
|
GRUB_MOD_LICENSE ("GPLv3+");
|
||||||
|
|
||||||
#define BASE_TEMPO (60 * GRUB_TICKS_PER_SECOND)
|
#define BASE_TEMPO (60 * 1000)
|
||||||
|
|
||||||
/* The speaker port. */
|
/* The speaker port. */
|
||||||
#define SPEAKER 0x61
|
#define SPEAKER 0x61
|
||||||
|
@ -149,7 +149,7 @@ beep_on (grub_uint16_t pitch)
|
||||||
static int
|
static int
|
||||||
play (unsigned tempo, struct note *note)
|
play (unsigned tempo, struct note *note)
|
||||||
{
|
{
|
||||||
unsigned int to;
|
grub_uint64_t to;
|
||||||
|
|
||||||
if (note->pitch == T_FINE || grub_getkey_noblock () != GRUB_TERM_NO_KEY)
|
if (note->pitch == T_FINE || grub_getkey_noblock () != GRUB_TERM_NO_KEY)
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -168,10 +168,9 @@ play (unsigned tempo, struct note *note)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
to = grub_get_rtc () + BASE_TEMPO * note->duration / tempo;
|
to = grub_get_time_ms () + BASE_TEMPO * note->duration / tempo;
|
||||||
while (((unsigned int) grub_get_rtc () <= to)
|
while ((grub_get_time_ms () <= to)
|
||||||
&& (grub_getkey_noblock () == GRUB_TERM_NO_KEY))
|
&& (grub_getkey_noblock () == GRUB_TERM_NO_KEY));
|
||||||
;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,6 @@
|
||||||
#define GRUB_TICKS_PER_SECOND 18
|
#define GRUB_TICKS_PER_SECOND 18
|
||||||
|
|
||||||
/* Return the real time in ticks. */
|
/* Return the real time in ticks. */
|
||||||
grub_uint32_t EXPORT_FUNC (grub_get_rtc) (void);
|
grub_uint32_t grub_get_rtc (void);
|
||||||
|
|
||||||
#endif /* ! KERNEL_MACHINE_TIME_HEADER */
|
#endif /* ! KERNEL_MACHINE_TIME_HEADER */
|
||||||
|
|
Loading…
Reference in a new issue