All of lore.kernel.org
 help / color / mirror / Atom feed
* PPC RTC patch
@ 2005-01-03 20:01 Hollis Blanchard
  2005-01-03 21:06 ` Marco Gerards
  0 siblings, 1 reply; 2+ messages in thread
From: Hollis Blanchard @ 2005-01-03 20:01 UTC (permalink / raw)
  To: grub-devel

This patch implements grub_get_rtc() for PPC. Comments?

-Hollis

2005-01-03  Hollis Blanchard  <hollis@penguinppc.org>

	* 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;
 }



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PPC RTC patch
  2005-01-03 20:01 PPC RTC patch Hollis Blanchard
@ 2005-01-03 21:06 ` Marco Gerards
  0 siblings, 0 replies; 2+ messages in thread
From: Marco Gerards @ 2005-01-03 21:06 UTC (permalink / raw)
  To: The development of GRUB 2

Hollis Blanchard <hollis@penguinppc.org> writes:

> This patch implements grub_get_rtc() for PPC. Comments?

Thanks a lot for implementing this.  I guess now all dummy functions
are implemented.

It looks fine.  Please update the copyright years of the files you
changed.  If you have done that, feel free to commit the patch.

Thanks,
Marco




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-01-03 21:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-03 20:01 PPC RTC patch Hollis Blanchard
2005-01-03 21:06 ` Marco Gerards

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.