]> git.proxmox.com Git - grub2.git/commitdiff
Don't export grub_get_rtc.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 26 Feb 2012 22:25:47 +0000 (23:25 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sun, 26 Feb 2012 22:25:47 +0000 (23:25 +0100)
* 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.

ChangeLog
grub-core/commands/i386/pc/play.c
include/grub/i386/pc/time.h

index 76d843da37cfdfc6a74e5b0700ae6ad2d745f859..0bc1e0b9ad7bd1b3a7b7f4944a20ec178f7f4d7b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        * grub-core/genmod.sh.in: Add -R .note.GNU-stack to strip.
index 5ceff66bfcdc698362547bc3d95bdeae6063ac3e..b14cf7c001d7b23b8e06b0a4342e22604757b6a6 100644 (file)
 #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
@@ -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;
 }
index 98399b6878713b1eb566a869f7cfeb815d3cd794..ba227ca6f2b804d14fe5e84ff5a6895dabac4be5 100644 (file)
@@ -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 */