From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VRrfw-0008DD-Hq for mharc-grub-devel@gnu.org; Thu, 03 Oct 2013 18:47:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRrfm-0008Cv-8I for grub-devel@gnu.org; Thu, 03 Oct 2013 18:47:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VRrfd-0004dD-P5 for grub-devel@gnu.org; Thu, 03 Oct 2013 18:47:06 -0400 Received: from mail-ea0-x234.google.com ([2a00:1450:4013:c01::234]:34791) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRrfd-0004d9-Hv for grub-devel@gnu.org; Thu, 03 Oct 2013 18:46:57 -0400 Received: by mail-ea0-f180.google.com with SMTP id h10so1404874eaj.39 for ; Thu, 03 Oct 2013 15:46:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type; bh=wtlI3Z9hymuUfXAOR+k7167IgkyIiMQSN2IxL407sz0=; b=vWwHTQqNwYJVoVqltNumAFBt6MaaSDkltrO2H8pDTTzWAkf0v/R0pOh1AAPZine9J9 eFxldpMif7hisf/fdgnNP03191XUxcqN5xFUOry27gDOPoS6xYfgZw5RLUHJDPm+F76f oLsMsLigVsX78btATLh0z49MIpQnw+6fPIJuP4v4JS84cxiyufau4/Ut+BBMzYirZWm4 cVvp9f+OCB403HBUsZSjJR2c4LFIufAoLTPUTIDnMyscKM5MMXIttHSWRVF23GyDIgK1 jRtvVTeFhnwu61x23rU4cd3ucLSCCkGTXff0yIsteFIn16VIFH1SmYcFeGxRbHnzJ8ah E9bQ== X-Received: by 10.14.214.136 with SMTP id c8mr16161878eep.6.1380840415422; Thu, 03 Oct 2013 15:46:55 -0700 (PDT) Received: from [192.168.1.113] (31-249.1-85.cust.bluewin.ch. [85.1.249.31]) by mx.google.com with ESMTPSA id b45sm20746607eef.4.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Oct 2013 15:46:54 -0700 (PDT) Message-ID: <524DF3DD.9030208@gmail.com> Date: Fri, 04 Oct 2013 00:46:53 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130821 Icedove/17.0.8 MIME-Version: 1.0 To: The development of GRUB 2 Subject: [RFT] Rewrite timer on arm efi and remove leftover in startup code X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="----enig2ANVPAIGIJUNONDVLPVRC" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::234 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Oct 2013 22:47:14 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2ANVPAIGIJUNONDVLPVRC Content-Type: multipart/mixed; boundary="------------060102060108090108050108" This is a multi-part message in MIME format. --------------060102060108090108050108 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Current timer code for ARM EFI is horror. Can anyone test this? --------------060102060108090108050108 Content-Type: text/x-diff; name="arm_efi.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="arm_efi.diff" =3D=3D=3D modified file 'grub-core/kern/arm/efi/init.c' --- grub-core/kern/arm/efi/init.c 2013-04-07 00:41:07 +0000 +++ grub-core/kern/arm/efi/init.c 2013-10-03 22:19:23 +0000 @@ -24,45 +24,47 @@ #include #include =20 -/* - * A bit ugly, but functional - and should be completely portable. - */ +static grub_uint64_t tmr; +static grub_efi_event_t tmr_evt; + static grub_uint64_t -grub_efi_get_time_ms(void) -{ - grub_efi_time_t now; - grub_uint64_t retval; - grub_efi_status_t status; - - status =3D efi_call_2 (grub_efi_system_table->runtime_services->get_ti= me, - &now, NULL); - if (status !=3D GRUB_EFI_SUCCESS) - { - grub_printf("No time!\n"); - return 0; - } - retval =3D now.year * 365 * 24 * 60 * 60 * 1000; - retval +=3D now.month * 30 * 24 * 60 * 60 * 1000; - retval +=3D now.day * 24 * 60 * 60 * 1000; - retval +=3D now.hour * 60 * 60 * 1000; - retval +=3D now.minute * 60 * 1000; - retval +=3D now.second * 1000; - retval +=3D now.nanosecond / 1000; -=20 - grub_dprintf("timer", "timestamp: 0x%llx\n", retval); - - return retval; +grub_efi_get_time_ms (void) +{ + return tmr; +} + +static void=20 +increment_timer (grub_efi_event_t event __attribute__ ((unused)), + void *context __attribute__ ((unused))) +{ + tmr++; } =20 void grub_machine_init (void) { + grub_efi_boot_services_t *b; + grub_efi_init (); + + b =3D grub_efi_system_table->boot_services; + + efi_call_5 (b->create_event, GRUB_EFI_EVT_TIMER | GRUB_EFI_EVT_NOTIFY_= SIGNAL, + GRUB_EFI_TPL_CALLBACK, increment_timer, NULL, &tmr_evt); + efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_PERIODIC, 10000); + grub_install_get_time_ms (grub_efi_get_time_ms); } =20 void grub_machine_fini (void) { + grub_efi_boot_services_t *b; + + b =3D grub_efi_system_table->boot_services; + + efi_call_3 (b->set_timer, tmr_evt, GRUB_EFI_TIMER_PERIODIC, 0); + efi_call_1 (b->close_event, tmr_evt); + grub_efi_fini (); } =3D=3D=3D modified file 'grub-core/kern/arm/efi/startup.S' --- grub-core/kern/arm/efi/startup.S 2013-04-07 00:41:07 +0000 +++ grub-core/kern/arm/efi/startup.S 2013-10-03 22:20:58 +0000 @@ -33,6 +33,4 @@ str r1, [ip] ldr ip, =3DEXT_C(grub_main) bx ip - .thumb @ For relocation debugging - blx _start .end --------------060102060108090108050108-- ------enig2ANVPAIGIJUNONDVLPVRC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iF4EAREKAAYFAlJN890ACgkQNak7dOguQgmMfQD/eFkf7VQ6A4cFxxWLF66G3M6Q lqIJIUXc45mYTxZMjqEBAK5Dud+EirxQ9avUIOCuL0lrSZSJGeO1sAoFV43tuMoc =JNXV -----END PGP SIGNATURE----- ------enig2ANVPAIGIJUNONDVLPVRC--