From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.33) id 1ClYtb-000178-Qg for mharc-grub-devel@gnu.org; Mon, 03 Jan 2005 15:33:44 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1ClYtV-00016b-JI for grub-devel@gnu.org; Mon, 03 Jan 2005 15:33:37 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1ClYtU-000163-FP for grub-devel@gnu.org; Mon, 03 Jan 2005 15:33:36 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1ClYtU-00015h-8p for grub-devel@gnu.org; Mon, 03 Jan 2005 15:33:36 -0500 Received: from [207.217.121.254] (helo=pop-a065d23.pas.sa.earthlink.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ClYhF-0002Bx-HB for grub-devel@gnu.org; Mon, 03 Jan 2005 15:20:57 -0500 Received: from user-0vvde4j.cable.mindspring.com ([63.246.184.147] helo=miracle) by pop-a065d23.pas.sa.earthlink.net with esmtp (Exim 3.33 #1) id 1ClYhE-0003tG-00 for grub-devel@gnu.org; Mon, 03 Jan 2005 12:20:56 -0800 Received: from hollis by miracle with local (Exim 3.36 #1 (Debian)) id 1ClYOs-0008Nd-00 for ; Mon, 03 Jan 2005 14:01:58 -0600 Date: Mon, 3 Jan 2005 14:01:57 -0600 To: grub-devel@gnu.org Message-ID: <20050103200157.GA32191@miracle> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i From: Hollis Blanchard Subject: PPC RTC patch X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jan 2005 20:33:38 -0000 This patch implements grub_get_rtc() for PPC. Comments? -Hollis 2005-01-03 Hollis Blanchard * 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 # 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; }