+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.
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
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
-#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
{
__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
/* 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
.set noreorder
.set nomacro
-FUNCTION (grub_cpu_flush_cache)
FUNCTION (grub_arch_sync_caches)
#include "cache_flush.S"
j $ra
#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)),
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
{
}
#endif
+#endif
#endif /* ! GRUB_CACHE_HEADER */
+++ /dev/null
-/* 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
/* 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));
#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);