diff --git a/ChangeLog b/ChangeLog index 76d843da3..0bc1e0b9a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-02-26 Vladimir Serbinenko + + 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 * grub-core/genmod.sh.in: Add -R .note.GNU-stack to strip. diff --git a/grub-core/commands/i386/pc/play.c b/grub-core/commands/i386/pc/play.c index 5ceff66bf..b14cf7c00 100644 --- a/grub-core/commands/i386/pc/play.c +++ b/grub-core/commands/i386/pc/play.c @@ -24,14 +24,14 @@ #include #include #include -#include #include #include #include +#include GRUB_MOD_LICENSE ("GPLv3+"); -#define BASE_TEMPO (60 * GRUB_TICKS_PER_SECOND) +#define BASE_TEMPO (60 * 1000) /* The speaker port. */ #define SPEAKER 0x61 @@ -149,7 +149,7 @@ beep_on (grub_uint16_t pitch) static int 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) return 1; @@ -168,10 +168,9 @@ play (unsigned tempo, struct note *note) break; } - to = grub_get_rtc () + BASE_TEMPO * note->duration / tempo; - while (((unsigned int) grub_get_rtc () <= to) - && (grub_getkey_noblock () == GRUB_TERM_NO_KEY)) - ; + to = grub_get_time_ms () + BASE_TEMPO * note->duration / tempo; + while ((grub_get_time_ms () <= to) + && (grub_getkey_noblock () == GRUB_TERM_NO_KEY)); return 0; } diff --git a/include/grub/i386/pc/time.h b/include/grub/i386/pc/time.h index 98399b687..ba227ca6f 100644 --- a/include/grub/i386/pc/time.h +++ b/include/grub/i386/pc/time.h @@ -24,6 +24,6 @@ #define GRUB_TICKS_PER_SECOND 18 /* 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 */