+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>
* grub-core/genmod.sh.in: Add -R .note.GNU-stack to strip.
#include <grub/disk.h>
#include <grub/term.h>
#include <grub/misc.h>
-#include <grub/machine/time.h>
#include <grub/cpu/io.h>
#include <grub/command.h>
#include <grub/i18n.h>
+#include <grub/time.h>
GRUB_MOD_LICENSE ("GPLv3+");
-#define BASE_TEMPO (60 * GRUB_TICKS_PER_SECOND)
+#define BASE_TEMPO (60 * 1000)
/* The speaker port. */
#define SPEAKER 0x61
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;
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;
}
#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 */