Fix mips-emu compilation.

This commit is contained in:
Vladimir Serbinenko 2013-12-08 17:49:02 +01:00
parent b75db69ac1
commit d5c14e1e26
9 changed files with 27 additions and 52 deletions

View file

@ -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.

View 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

View file

@ -1,6 +1,7 @@
#include <grub/cache.h>
#if defined(__ia64__) || defined (__arm__) || defined (__aarch64__)
#include <grub/cache.h>
void __clear_cache (char *beg, char *end);
@ -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

View 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

View 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

View file

@ -23,10 +23,6 @@
#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 */

View file

@ -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

View 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));

View file

@ -21,7 +21,14 @@
#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);