]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Fix mips-emu compilation.
authorVladimir Serbinenko <phcoder@gmail.com>
Sun, 8 Dec 2013 16:49:02 +0000 (17:49 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Sun, 8 Dec 2013 16:49:02 +0000 (17:49 +0100)
ChangeLog
grub-core/Makefile.am
grub-core/kern/emu/cache.c
grub-core/kern/emu/cache_s.S
grub-core/kern/mips/cache.S
include/grub/cache.h
include/grub/mips/cache.h [deleted file]
include/grub/misc.h
include/grub/time.h

index 284be912a0885cc882879a7f25fe0b35531a394c..07f8dfb96042638060b12547fd886533cd10c323 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-12-08  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       Fix mips-emu compilation.
+
 2013-12-08  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * configure.ac: Check for freetype library usability.
index f69da18c381e55b25f758365a75b7697bb0bba8c..5b804c7d4d827cac196385f989521d5cc8496745 100644 (file)
@@ -169,7 +169,6 @@ endif
 if COND_mips_qemu_mips
 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/cpu/cache.h
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/serial.h
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h
@@ -181,7 +180,6 @@ 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/video.h
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video_fb.h
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/gfxterm.h
index 4a701f44ac764046af675897fab579bf8fe4960f..b6f6faca236af063e7b65514668a2db7edfb53a6 100644 (file)
@@ -1,7 +1,8 @@
 
-#if defined(__ia64__) || defined (__arm__) || defined (__aarch64__)
 #include <grub/cache.h>
 
+#if defined(__ia64__) || defined (__arm__) || defined (__aarch64__)
+
 void __clear_cache (char *beg, char *end);
 
 void
@@ -9,5 +10,15 @@ grub_arch_sync_caches (void *address, grub_size_t len)
 {
   __clear_cache (address, (char *) address + len);
 }
+
+#elif defined (__mips__)
+void _flush_cache (void *address, grub_size_t len, int type);
+
+void
+grub_arch_sync_caches (void *address, grub_size_t len)
+{
+  return _flush_cache (address, len, 0);
+}
+
 #endif
 
index 7fbebb80d20b0a5bf7a6b30e02c0b44bd40af57a..76cf7560dbe4745df5ebb2c10f0a3c45c3cccac2 100644 (file)
@@ -6,24 +6,9 @@
 /* Nothing is necessary.  */
 #elif defined(__sparc__)
 #include "../sparc64/cache.S"
-#elif defined(__mips__)
-/* On MIPS we must go through standard functions.  */
-#include <grub/symbol.h>
-
-FUNCTION (grub_cpu_flush_cache)
-FUNCTION (grub_arch_sync_caches)
-       .set nomacro
-       .set noreorder
-       lui $t0, %hi(_flush_cache)
-       addui $t0, $t0, %lo(_flush_cache)
-       move $a3, $zero
-       jr $t0
-        nop
-       .set reorder
-       .set macro
 #elif defined(__powerpc__)
 #include "../powerpc/cache.S"
-#elif defined(__ia64__) || defined(__arm__) || defined(__aarch64__)
+#elif defined(__ia64__) || defined(__arm__) || defined(__aarch64__) || defined(__mips__)
 #else
 #error "No target cpu type is defined"
 #endif
index cca4b30fe38d8c3dbef337dc713160db3d107c9c..78e40bcea08ceeb2a1e3ad1ca0c6c89940118feb 100644 (file)
@@ -4,7 +4,6 @@
        .set noreorder
        .set nomacro
 
-FUNCTION (grub_cpu_flush_cache)
 FUNCTION (grub_arch_sync_caches)
 #include "cache_flush.S"
        j $ra
index 292830566604cfc72318ddc20a31613dee5a6b9a..c6a0b0ba447fb3746eb7c7decadf448e3dac6db9 100644 (file)
 #include <grub/symbol.h>
 #include <grub/types.h>
 
-#ifdef _mips
-#include <grub/mips/cache.h>
-#endif
-
 #if defined (__i386__) || defined (__x86_64__)
 static inline void
 grub_arch_sync_caches (void *address __attribute__ ((unused)),
@@ -37,6 +33,7 @@ grub_arch_sync_caches (void *address __attribute__ ((unused)),
 void EXPORT_FUNC(grub_arch_sync_caches) (void *address, grub_size_t len);
 #endif
 
+#ifndef GRUB_MACHINE_EMU
 #ifdef _mips
 void EXPORT_FUNC(grub_arch_sync_dma_caches) (void *address, grub_size_t len);
 #else
@@ -46,5 +43,6 @@ grub_arch_sync_dma_caches (void *address __attribute__ ((unused)),
 {
 }
 #endif
+#endif
 
 #endif /* ! GRUB_CACHE_HEADER */
diff --git a/include/grub/mips/cache.h b/include/grub/mips/cache.h
deleted file mode 100644 (file)
index c347057..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/* cache.h - Flush the processor's cache.  */
-/*
- *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2004,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_CPU_CACHE_H
-#define GRUB_CPU_CACHE_H       1
-
-#include <grub/symbol.h>
-#include <grub/types.h>
-
-void EXPORT_FUNC(grub_cpu_flush_cache) (void *start, grub_size_t size, int type);
-#endif 
index d80da33491ab42607d1f7800fadd30e1f1412ef4..be74d908235082feb22e0036d03c239be560c171 100644 (file)
@@ -429,7 +429,7 @@ void __attribute__ ((noreturn)) EXPORT_FUNC (abort) (void);
 /* Halt the system, using APM if possible. If NO_APM is true, don't
  * use APM even if it is available.  */
 void grub_halt (int no_apm) __attribute__ ((noreturn));
-#elif defined (__mips__)
+#elif defined (__mips__) && !defined (GRUB_MACHINE_EMU)
 void EXPORT_FUNC (grub_halt) (void) __attribute__ ((noreturn));
 #else
 void grub_halt (void) __attribute__ ((noreturn));
index 9494526805405b5066a9260a8a5775fb754aae5d..64ac99a125a1ef134448dc8bb602ff0ac1d82008 100644 (file)
 
 #include <grub/types.h>
 #include <grub/symbol.h>
+#ifndef GRUB_MACHINE_EMU
 #include <grub/cpu/time.h>
+#else
+static inline void
+grub_cpu_idle(void)
+{
+}
+#endif
 
 void EXPORT_FUNC(grub_millisleep) (grub_uint32_t ms);
 grub_uint64_t EXPORT_FUNC(grub_get_time_ms) (void);