]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Remove non-functional EFI grub_get_rtc. Put a better fatal message
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Mon, 11 Jun 2012 18:44:38 +0000 (20:44 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Mon, 11 Jun 2012 18:44:38 +0000 (20:44 +0200)
than current grub_get_rtc() not implemented when booted with
coreboot without TSC.

* grub-core/Makefile.am: Exclude efi/time.h from kernel headers.
Add machine/time.h to kernel headers on loongson.
* grub-core/Makefile.core.def (kernel): Remove
kern/generic/rtc_get_time_ms.c on qemu-multiboot-coreboot.
* grub-core/kern/efi/efi.c (grub_rtc_get_time_ms): Removed.
(grub_get_rtc): Likewise.
* grub-core/kern/generic/rtc_get_time_ms.c: Include grub/machine/time.h.
* grub-core/kern/i386/coreboot/init.c (grub_get_rtc): Removed.
* grub-core/kern/i386/pc/init.c: Include grub/machine/init.h.
* grub-core/kern/i386/tsc.c (grub_tsc_init)
[!GRUB_MACHINE_PCBIOS && !GRUB_MACHINE_IEEE1275]: Call grub_fatal
rather than installing known non-working time source.
* grub-core/kern/ieee1275/init.c (grub_get_rtc): Removed.
* grub-core/kern/mips/loongson/init.c: Include grub/machine/time.h.
* include/grub/time.h: Don't include machine/time.h.
* include/grub/efi/time.h: Removed.
* include/grub/i386/efi/time.h: Likewise.
* include/grub/i386/ieee1275/time.h: Likewise.
* include/grub/powerpc/ieee1275/time.h: Likewise.
* include/grub/sparc64/ieee1275/time.h: Likewise.
* include/grub/x86_64/efi/time.h: Likewise.

17 files changed:
ChangeLog
grub-core/Makefile.am
grub-core/Makefile.core.def
grub-core/kern/efi/efi.c
grub-core/kern/generic/rtc_get_time_ms.c
grub-core/kern/i386/coreboot/init.c
grub-core/kern/i386/pc/init.c
grub-core/kern/i386/tsc.c
grub-core/kern/ieee1275/init.c
grub-core/kern/mips/loongson/init.c
include/grub/efi/time.h [deleted file]
include/grub/i386/efi/time.h [deleted file]
include/grub/i386/ieee1275/time.h [deleted file]
include/grub/powerpc/ieee1275/time.h [deleted file]
include/grub/sparc64/ieee1275/time.h [deleted file]
include/grub/time.h
include/grub/x86_64/efi/time.h [deleted file]

index 64fbf7b3766d95217442e717171e6deb0af62dbe..302365bf46d4b046baa41cca4080d61b0a0ebf10 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,34 @@
 2012-06-11  Vladimir Serbinenko  <phcoder@gmail.com>
 
-       Remove dor on i and j when combining with above diacritics.
+       Remove non-functional EFI grub_get_rtc. Put a better fatal message
+       than current grub_get_rtc() not implemented when booted with
+       coreboot without TSC.
+
+       * grub-core/Makefile.am: Exclude efi/time.h from kernel headers.
+       Add machine/time.h to kernel headers on loongson.
+       * grub-core/Makefile.core.def (kernel): Remove
+       kern/generic/rtc_get_time_ms.c on qemu-multiboot-coreboot.
+       * grub-core/kern/efi/efi.c (grub_rtc_get_time_ms): Removed.
+       (grub_get_rtc): Likewise.
+       * grub-core/kern/generic/rtc_get_time_ms.c: Include grub/machine/time.h.
+       * grub-core/kern/i386/coreboot/init.c (grub_get_rtc): Removed.
+       * grub-core/kern/i386/pc/init.c: Include grub/machine/init.h.
+       * grub-core/kern/i386/tsc.c (grub_tsc_init)
+       [!GRUB_MACHINE_PCBIOS && !GRUB_MACHINE_IEEE1275]: Call grub_fatal
+       rather than installing known non-working time source.
+       * grub-core/kern/ieee1275/init.c (grub_get_rtc): Removed.
+       * grub-core/kern/mips/loongson/init.c: Include grub/machine/time.h.
+       * include/grub/time.h: Don't include machine/time.h.
+       * include/grub/efi/time.h: Removed.
+       * include/grub/i386/efi/time.h: Likewise.
+       * include/grub/i386/ieee1275/time.h: Likewise.
+       * include/grub/powerpc/ieee1275/time.h: Likewise.
+       * include/grub/sparc64/ieee1275/time.h: Likewise.
+       * include/grub/x86_64/efi/time.h: Likewise.
+
+2012-06-11  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       Remove dot on i and j when combining with above diacritics.
 
        * include/grub/unicode.h (GRUB_UNICODE_DOTLESS_LOWERCASE_I): New enum
        value.
index 07918dbea12ce3a2cff7e4e24413e7e87cf309c5..3410c2adf8605b9de3b859d7523331ab0253bbc1 100644 (file)
@@ -93,7 +93,6 @@ endif
 
 if COND_i386_efi
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h
-KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/time.h
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/pit.h
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/pci.h
@@ -124,7 +123,6 @@ endif
 
 if COND_x86_64_efi
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h
-KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/time.h
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/pit.h
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/pci.h
@@ -132,7 +130,6 @@ endif
 
 if COND_ia64_efi
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h
-KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/time.h
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h
 endif
 
@@ -165,6 +162,7 @@ endif
 if COND_mips_loongson
 KERNEL_HEADER_FILES += $(top_builddir)/include/grub/keyboard_layouts.h
 KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h
+KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/time.h
 KERNEL_HEADER_FILES += $(top_builddir)/include/grub/cpu/cache.h
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/bitmap.h
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video.h
index 18ace2f5390d77468af6c0e8e6cf58d4fb4f3593..39e77a4502f345067ff036199dd30712b8da35e5 100644 (file)
@@ -103,9 +103,6 @@ kernel = {
   noemu_nodist = symlist.c;
 
   i386_pc = kern/generic/rtc_get_time_ms.c;
-  i386_qemu = kern/generic/rtc_get_time_ms.c;
-  i386_coreboot = kern/generic/rtc_get_time_ms.c;
-  i386_multiboot = kern/generic/rtc_get_time_ms.c;
   mips = kern/generic/rtc_get_time_ms.c;
 
   ieee1275 = disk/ieee1275/ofdisk.c;
index a59a6edbcda416a00ceb54b846b9e64f114f05c6..02d2f9a0007e8e6bfa6c8f80e197f154fd4899a8 100644 (file)
@@ -23,7 +23,6 @@
 #include <grub/efi/efi.h>
 #include <grub/efi/console_control.h>
 #include <grub/efi/pe32.h>
-#include <grub/machine/time.h>
 #include <grub/time.h>
 #include <grub/term.h>
 #include <grub/kernel.h>
@@ -230,29 +229,6 @@ grub_efi_get_variable (const char *var, const grub_efi_guid_t *guid,
   return NULL;
 }
 
-#ifndef __ia64__
-grub_uint64_t
-grub_rtc_get_time_ms (void)
-{
-  grub_efi_time_t time;
-  grub_efi_runtime_services_t *r;
-
-  r = grub_efi_system_table->runtime_services;
-  if (efi_call_2 (r->get_time, &time, 0) != GRUB_EFI_SUCCESS)
-    /* What is possible in this case?  */
-    return 0;
-
-  return ((time.minute * 60 + time.second) * 1000
-          + time.nanosecond / 1000000);
-}
-
-grub_uint32_t
-grub_get_rtc (void)
-{
-  return grub_rtc_get_time_ms ();
-}
-#endif
-
 #pragma GCC diagnostic ignored "-Wcast-align"
 
 /* Search the mods section from the PE32/PE32+ image. This code uses
index 3592336286060f57efac8872a6c6fcd4e2f0e8b9..49f2acac958025265654fc0dc34fa85f07ee0570 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <grub/time.h>
 #include <grub/misc.h>
+#include <grub/machine/time.h>
 
 /* Calculate the time in milliseconds since the epoch based on the RTC. */
 grub_uint64_t
index b96b9c6f2781cf6501c7637448e771841f7f1b83..52fbba4e811bf7e29d0968e182bf67a4a8e1f9f6 100644 (file)
@@ -42,15 +42,7 @@ extern grub_uint8_t _start[];
 extern grub_uint8_t _end[];
 extern grub_uint8_t _edata[];
 
-#pragma GCC diagnostic warning "-Wsuggest-attribute=noreturn"
-
-grub_uint32_t
-grub_get_rtc (void)
-{
-  grub_fatal ("grub_get_rtc() is not implemented.\n");
-}
-
-void
+void  __attribute__ ((noreturn))
 grub_exit (void)
 {
   /* We can't use grub_fatal() in this function.  This would create an infinite
index c6492619ffb094464673b4f858a5823040c55ba7..0841d8bb16ecedc4c279097645295596620dbb80 100644 (file)
@@ -33,6 +33,7 @@
 #include <grub/cache.h>
 #include <grub/time.h>
 #include <grub/cpu/tsc.h>
+#include <grub/machine/time.h>
 
 struct mem_region
 {
index 36b35e27f796e7607ec1e3b6034991f9bc97fe0b..c4645f04369c4d1f3c9907a659ac6fdd411c22d3 100644 (file)
@@ -69,6 +69,10 @@ grub_tsc_init (void)
     }
   else
     {
+#if defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_IEEE1275)
       grub_install_get_time_ms (grub_rtc_get_time_ms);
+#else
+      grub_fatal ("no TSC found");
+#endif
     }
 }
index bf59dc822a7297065959f14177631fb90a450ed5..7d03a8aac1e5bf7aa843fcfa75be299137990e49 100644 (file)
@@ -292,9 +292,3 @@ ieee1275_get_time_ms (void)
 
   return msecs;
 }
-
-grub_uint32_t
-grub_get_rtc (void)
-{
-  return ieee1275_get_time_ms ();
-}
index f0360dab16f39a37aa7e15cbb8d0581a0d9616eb..19f2d639b3a78d1b15692e967b89f8632035236c 100644 (file)
@@ -23,7 +23,7 @@
 #include <grub/types.h>
 #include <grub/misc.h>
 #include <grub/mm.h>
-#include <grub/time.h>
+#include <grub/machine/time.h>
 #include <grub/machine/kernel.h>
 #include <grub/machine/memory.h>
 #include <grub/memory.h>
diff --git a/include/grub/efi/time.h b/include/grub/efi/time.h
deleted file mode 100644 (file)
index 1c38ac0..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2006,2007,2008  Free Software Foundation, Inc.
- *
- *  GRUB is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  GRUB is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef GRUB_EFI_TIME_HEADER
-#define GRUB_EFI_TIME_HEADER   1
-
-#include <grub/symbol.h>
-
-#ifndef __ia64__
-#define GRUB_TICKS_PER_SECOND  1000
-
-/* Return the real time in ticks.  */
-grub_uint32_t grub_get_rtc (void);
-#endif
-
-#endif /* ! GRUB_EFI_TIME_HEADER */
diff --git a/include/grub/i386/efi/time.h b/include/grub/i386/efi/time.h
deleted file mode 100644 (file)
index 7a9241f..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2006,2007  Free Software Foundation, Inc.
- *
- *  GRUB is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  GRUB is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef GRUB_MACHINE_TIME_HEADER
-#define GRUB_MACHINE_TIME_HEADER       1
-
-#include <grub/efi/time.h>
-
-#endif /* ! GRUB_MACHINE_TIME_HEADER */
diff --git a/include/grub/i386/ieee1275/time.h b/include/grub/i386/ieee1275/time.h
deleted file mode 100644 (file)
index 6f474ba..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <grub/powerpc/ieee1275/time.h>
diff --git a/include/grub/powerpc/ieee1275/time.h b/include/grub/powerpc/ieee1275/time.h
deleted file mode 100644 (file)
index 3f8ad26..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2003,2004,2005,2007  Free Software Foundation, Inc.
- *
- *  GRUB is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  GRUB is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef KERNEL_MACHINE_TIME_HEADER
-#define KERNEL_MACHINE_TIME_HEADER     1
-
-#include <grub/symbol.h>
-
-#define GRUB_TICKS_PER_SECOND  1000
-
-/* Return the real time in ticks.  */
-grub_uint32_t EXPORT_FUNC (grub_get_rtc) (void);
-
-#endif /* ! KERNEL_MACHINE_TIME_HEADER */
diff --git a/include/grub/sparc64/ieee1275/time.h b/include/grub/sparc64/ieee1275/time.h
deleted file mode 100644 (file)
index 3f8ad26..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2003,2004,2005,2007  Free Software Foundation, Inc.
- *
- *  GRUB is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  GRUB is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef KERNEL_MACHINE_TIME_HEADER
-#define KERNEL_MACHINE_TIME_HEADER     1
-
-#include <grub/symbol.h>
-
-#define GRUB_TICKS_PER_SECOND  1000
-
-/* Return the real time in ticks.  */
-grub_uint32_t EXPORT_FUNC (grub_get_rtc) (void);
-
-#endif /* ! KERNEL_MACHINE_TIME_HEADER */
index ae2617edb15bfa2157adef0ea113cc87cb879290..e834796e22ba35a404abc4e089829f5df934cae6 100644 (file)
@@ -27,8 +27,6 @@
 #define GRUB_TICKS_PER_SECOND 100000
 /* Return the real time in ticks.  */
 grub_uint32_t EXPORT_FUNC (grub_get_rtc) (void);
-#else
-#include <grub/machine/time.h>
 #endif
 
 void EXPORT_FUNC(grub_millisleep) (grub_uint32_t ms);
diff --git a/include/grub/x86_64/efi/time.h b/include/grub/x86_64/efi/time.h
deleted file mode 100644 (file)
index 7a9241f..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2006,2007  Free Software Foundation, Inc.
- *
- *  GRUB is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  GRUB is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef GRUB_MACHINE_TIME_HEADER
-#define GRUB_MACHINE_TIME_HEADER       1
-
-#include <grub/efi/time.h>
-
-#endif /* ! GRUB_MACHINE_TIME_HEADER */