grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PPC RTC patch


From: Hollis Blanchard
Subject: PPC RTC patch
Date: Mon, 3 Jan 2005 14:01:57 -0600
User-agent: Mutt/1.5.6+20040907i

This patch implements grub_get_rtc() for PPC. Comments?

-Hollis

2005-01-03  Hollis Blanchard  <address@hidden>

        * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_milliseconds):
        New function.
        * include/grub/powerpc/ieee1275/ieee1275.h
        (grub_ieee1275_milliseconds): New prototype.
        * include/grub/powerpc/ieee1275/time.h (GRUB_TICKS_PER_SECOND):
        Change to 1000.
        * kern/powerpc/ieee1275/init.c (grub_get_rtc): Call
        grub_ieee1275_milliseconds.

Index: boot/powerpc/ieee1275/ieee1275.c
===================================================================
RCS file: /cvsroot/grub/grub2/boot/powerpc/ieee1275/ieee1275.c,v
retrieving revision 1.8
diff -u -p -r1.8 ieee1275.c
--- boot/powerpc/ieee1275/ieee1275.c    29 Oct 2004 02:45:14 -0000      1.8
+++ boot/powerpc/ieee1275/ieee1275.c    3 Jan 2005 20:13:55 -0000
@@ -482,3 +482,19 @@ grub_ieee1275_set_color (grub_ieee1275_i
   
   return 0;
 }
+
+int
+grub_ieee1275_milliseconds (grub_uint32_t *msecs)
+{
+  struct milliseconds_args {
+    struct grub_ieee1275_common_hdr common;
+    grub_uint32_t msecs;
+  } args;
+
+  INIT_IEEE1275_COMMON (&args.common, "milliseconds", 0, 1);
+
+  if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
+    return -1;
+  *msecs = args.msecs;
+  return 0;
+}
Index: include/grub/powerpc/ieee1275/ieee1275.h
===================================================================
RCS file: /cvsroot/grub/grub2/include/grub/powerpc/ieee1275/ieee1275.h,v
retrieving revision 1.11
diff -u -p -r1.11 ieee1275.h
--- include/grub/powerpc/ieee1275/ieee1275.h    3 Jan 2005 17:44:25 -0000       
1.11
+++ include/grub/powerpc/ieee1275/ieee1275.h    3 Jan 2005 20:13:55 -0000
@@ -119,6 +119,7 @@ int EXPORT_FUNC(grub_ieee1275_set_proper
                                             grub_size_t *actual);
 int EXPORT_FUNC(grub_ieee1275_set_color) (grub_ieee1275_ihandle_t ihandle,
                                          int index, int r, int g, int b);
+int EXPORT_FUNC(grub_ieee1275_milliseconds) (grub_uint32_t *msecs);
 
 
 grub_err_t EXPORT_FUNC(grub_devalias_iterate)
Index: include/grub/powerpc/ieee1275/time.h
===================================================================
RCS file: /cvsroot/grub/grub2/include/grub/powerpc/ieee1275/time.h,v
retrieving revision 1.3
diff -u -p -r1.3 time.h
--- include/grub/powerpc/ieee1275/time.h        10 Sep 2004 20:31:55 -0000      
1.3
+++ include/grub/powerpc/ieee1275/time.h        3 Jan 2005 20:13:55 -0000
@@ -26,7 +26,7 @@
 # include <time.h>
 # define GRUB_TICKS_PER_SECOND CLOCKS_PER_SEC
 #else
-# define GRUB_TICKS_PER_SECOND 18
+# define GRUB_TICKS_PER_SECOND 1000
 #endif
 
 /* Return the real time in ticks.  */
Index: kern/powerpc/ieee1275/init.c
===================================================================
RCS file: /cvsroot/grub/grub2/kern/powerpc/ieee1275/init.c,v
retrieving revision 1.11
diff -u -p -r1.11 init.c
--- kern/powerpc/ieee1275/init.c        27 Dec 2004 13:46:20 -0000      1.11
+++ kern/powerpc/ieee1275/init.c        3 Jan 2005 20:13:56 -0000
@@ -82,5 +82,10 @@ grub_stop (void)
 grub_uint32_t
 grub_get_rtc (void)
 {
-  return 0;
+  grub_uint32_t msecs;
+
+  if (grub_ieee1275_milliseconds (&msecs))
+    return 0;
+
+  return msecs;
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]