]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
bugfixes. Merge MIPS and MIPSel
authorphcoder <phcoder@debian.bg45.phnet>
Sat, 10 Oct 2009 12:19:50 +0000 (14:19 +0200)
committerphcoder <phcoder@debian.bg45.phnet>
Sat, 10 Oct 2009 12:19:50 +0000 (14:19 +0200)
17 files changed:
conf/mips.rmk
configure.ac
include/grub/mips/cache.h [new file with mode: 0644]
include/grub/mips/kernel.h [moved from include/grub/mipsel/kernel.h with 100% similarity]
include/grub/mips/libgcc.h [new file with mode: 0644]
include/grub/mips/qemu-r4k/kernel.h [moved from include/grub/mipsel/qemu-r4k/kernel.h with 100% similarity]
include/grub/mips/qemu-r4k/machine.h [moved from include/grub/mipsel/qemu-r4k/machine.h with 100% similarity]
include/grub/mips/qemu-r4k/memory.h [moved from include/grub/mipsel/qemu-r4k/memory.h with 100% similarity]
include/grub/mips/qemu-r4k/time.h [moved from include/grub/mipsel/qemu-r4k/time.h with 100% similarity]
include/grub/mips/time.h [moved from include/grub/mipsel/time.h with 100% similarity]
include/grub/mips/types.h [moved from include/grub/mipsel/types.h with 84% similarity]
kern/mips/cache.S [moved from kern/mipsel/cache.S with 100% similarity]
kern/mips/dl.c [moved from kern/mipsel/dl.c with 95% similarity]
kern/mips/qemu-r4k/init.c [moved from kern/mipsel/qemu-r4k/init.c with 100% similarity]
kern/mips/qemu-r4k/startup.S [moved from kern/mipsel/qemu-r4k/startup.S with 100% similarity]
kern/term.c
lib/mipsel/setjmp.S [deleted file]

index ad0219b068e0a20f9f5861be82ed4abf17910110..b0a07819701ac12167596583be4203d3521a2c82 100644 (file)
@@ -84,7 +84,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c   \
 
 grub_emu_LDFLAGS = $(LIBCURSES)
 
-kernel_img_SOURCES = kern/mipsel/qemu-r4k/startup.S \
+kernel_img_SOURCES = kern/mips/qemu-r4k/startup.S \
        kern/main.c kern/device.c kern/$(target_cpu)/$(target_machine)/init.c           \
        kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c          \
        kern/misc.c kern/mm.c kern/reader.c kern/term.c         \
index 74dcc5dd4185ef9b853aae13b6163e69ff2b8b2e..fa85c29b45737bb2bf7af46d6531d91104b3a8f7 100644 (file)
@@ -90,12 +90,15 @@ case "$target_cpu"-"$platform" in
   powerpc-ieee1275) ;;
   sparc64-ieee1275) ;;
   mipsel-qemu-r4k) ;;
+  mips-qemu-r4k) ;;
   *) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;;
 esac
 
 case "$target_cpu" in
   i386 | powerpc) target_m32=1 ;;
   x86_64 | sparc64) target_m64=1 ;;
+  mipsel) TARGET_CFLAGS="$TARGET_CFLAGS -DGRUB_CPU_MIPSEL=1"; target_cpu=mips ;;
+  mips) TARGET_CFLAGS="$TARGET_CFLAGS -DGRUB_CPU_MIPS=1" ;;
 esac
 
 case "$host_os" in
diff --git a/include/grub/mips/cache.h b/include/grub/mips/cache.h
new file mode 100644 (file)
index 0000000..c347057
--- /dev/null
@@ -0,0 +1,27 @@
+/* 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 
diff --git a/include/grub/mips/libgcc.h b/include/grub/mips/libgcc.h
new file mode 100644 (file)
index 0000000..a658425
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ *  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/>.
+ */
+
+void *EXPORT_FUNC (memset) (void *s, int c, int n) __attribute__ ((weak));
+void EXPORT_FUNC (__ashldi3) (void) __attribute__ ((weak));
+void EXPORT_FUNC (__ashrdi3) (void) __attribute__ ((weak));
+void EXPORT_FUNC (__lshrdi3) (void) __attribute__ ((weak));
+void EXPORT_FUNC (__trampoline_setup) (void) __attribute__ ((weak));
+void EXPORT_FUNC (__ucmpdi2) (void) __attribute__ ((weak));
+void EXPORT_FUNC (__bswapsi2) (void) __attribute__ ((weak));
+void EXPORT_FUNC (__bswapdi2) (void) __attribute__ ((weak));
similarity index 84%
rename from include/grub/mipsel/types.h
rename to include/grub/mips/types.h
index 94a35be6e69f498f1315c38e41e7bd2c2cd63524..f5f4602e47d108babdc8b7ae7090143d22aadd5f 100644 (file)
 /* The size of long.  */
 #define GRUB_TARGET_SIZEOF_LONG                4
 
+#ifdef GRUB_CPU_MIPSEL
 /* mipsEL is little-endian.  */
 #undef GRUB_TARGET_WORDS_BIGENDIAN
+#elif defined (GRUB_CPU_MIPS)
+/* mips is big-endian.  */
+#define GRUB_TARGET_WORDS_BIGENDIAN
+#else
+#error Neither GRUB_CPU_MIPS nor GRUB_CPU_MIPSEL is defined
+#endif
 
 #endif /* ! GRUB_TYPES_CPU_HEADER */
similarity index 100%
rename from kern/mipsel/cache.S
rename to kern/mips/cache.S
similarity index 95%
rename from kern/mipsel/dl.c
rename to kern/mips/dl.c
index 57854964b4617509d4ee2e20a0e156ed29c55e04..ca93893d23a9877fc91f21cc0acae87f557d3fc0 100644 (file)
@@ -92,6 +92,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
 
                switch (ELF_R_TYPE (rel->r_info))
                  {
+#if 0
                  case R_386_32:
                    *addr += sym->st_value;
                    break;
@@ -100,6 +101,11 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
                    *addr += (sym->st_value - (Elf_Word) seg->addr
                              - rel->r_offset);
                    break;
+#endif
+                 default:
+                   grub_printf ("Unknown relocation type %d\n",
+                                ELF_R_TYPE (rel->r_info));
+                   break
                  }
              }
          }
index 22660c6a86b673a1d27ada87a316b2814c25a14e..0a99ff318a36eb1adf674536660566dd7f77dad2 100644 (file)
@@ -135,21 +135,24 @@ grub_getcharwidth (grub_uint32_t code)
 int
 grub_getkey (void)
 {
-  return (grub_cur_term_input->getkey) ();
+  while (!(*((grub_uint8_t *)0x140003f8+5) & 0x01));
+  return *((grub_uint8_t *)0x140003f8);
+  //  return (grub_cur_term_input->getkey) ();
 }
 
 int
 grub_checkkey (void)
 {
-  return (grub_cur_term_input->checkkey) ();
+  return !!(*((grub_uint8_t *)0x140003f8+5) & 0x01);
+  //return (grub_cur_term_input->checkkey) ();
 }
 
 int
 grub_getkeystatus (void)
 {
-  if (grub_cur_term_input->getkeystatus)
+  /*  if (grub_cur_term_input->getkeystatus)
     return (grub_cur_term_input->getkeystatus) ();
-  else
+    else*/
     return 0;
 }
 
diff --git a/lib/mipsel/setjmp.S b/lib/mipsel/setjmp.S
deleted file mode 100644 (file)
index e69de29..0000000