All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hollis Blanchard <hollis@penguinppc.org>
To: grub-devel@gnu.org
Subject: PPC RTC patch
Date: Mon, 3 Jan 2005 14:01:57 -0600	[thread overview]
Message-ID: <20050103200157.GA32191@miracle> (raw)

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



             reply	other threads:[~2005-01-03 20:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-03 20:01 Hollis Blanchard [this message]
2005-01-03 21:06 ` PPC RTC patch Marco Gerards

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050103200157.GA32191@miracle \
    --to=hollis@penguinppc.org \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.