forked from pool/grub2
Accepting request 229655 from home:k0da:branches:Base:System
- Build GRUB2 for ppc64le as LittleEndian and 64bit - Fix timeout issue on ppc64le (bnc#869166) - Add powerpc-utils requires to grub2-powerpc-ieee1275 - added patches: * grub2-ppc64-build-ppc64-32bit.patch * grub2-ppc64-qemu.patch * grub2-ppc64le-01-Add-Little-Endian-support-for-Power64-to-the-build.patch * grub2-ppc64le-02-Build-grub-as-O1-until-we-add-savegpr-and-restgpr-ro.patch * grub2-ppc64le-03-disable-creation-of-vsx-and-altivec-instructions.patch * grub2-ppc64le-04-powerpc64-LE-s-linker-knows-how-to-handle-the-undefi.patch * grub2-ppc64le-05-grub-install-can-now-recognize-and-install-a-LE-grub.patch * grub2-ppc64le-06-set-the-ABI-version-to-0x02-in-the-e_flag-of-the-PPC.patch * grub2-ppc64le-07-Add-IEEE1275_ADDR-helper.patch * grub2-ppc64le-08-Fix-some-more-warnings-when-casting.patch * grub2-ppc64le-09-Add-powerpc64-types.patch * grub2-ppc64le-10-powerpc64-is-not-necessarily-BigEndian-anymore.patch * grub2-ppc64le-11-Fix-warnings-when-building-powerpc-linux-loader-64bi.patch * grub2-ppc64le-12-GRUB_ELF_R_PPC_-processing-is-applicable-only-for-32.patch * grub2-ppc64le-13-Fix-powerpc-setjmp-longjmp-64bit-issues.patch * grub2-ppc64le-14-Add-powerpc64-ieee1275-trampoline.patch * grub2-ppc64le-15-Add-64bit-support-to-powerpc-startup-code.patch * grub2-ppc64le-16-Add-grub_dl_find_section_addr.patch * grub2-ppc64le-17-Add-ppc64-relocations.patch * grub2-ppc64le-18-ppc64-doesn-t-need-libgcc-routines.patch * grub2-ppc64le-19-Use-FUNC_START-FUNC_END-for-powerpc-function-definit.patch * grub2-ppc64le-20-.TOC.-symbol-is-special-in-ppc64le-.-It-maps-to-the-.patch * grub2-ppc64le-21-the-.toc-section-in-powerpc64le-modules-are-sometime.patch * grub2-ppc64le-22-all-parameter-to-firmware-calls-should-to-be-BigEndi.patch * grub2-ppc64le-23-grub-segfaults-if-initrd-is-specified-before-specify.patch * grub2-ppc64le-timeout.patch OBS-URL: https://build.opensuse.org/request/show/229655 OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=87
This commit is contained in:
parent
60734cece4
commit
d993d29491
@ -1,301 +0,0 @@
|
||||
Index: grub-2.02~beta2/configure.ac
|
||||
===================================================================
|
||||
--- grub-2.02~beta2.orig/configure.ac
|
||||
+++ grub-2.02~beta2/configure.ac
|
||||
@@ -1014,7 +1014,7 @@ else
|
||||
CFLAGS="$TARGET_CFLAGS -nostdlib -Wno-error"
|
||||
fi
|
||||
CPPFLAGS="$TARGET_CPPFLAGS"
|
||||
-if test x$target_cpu = xi386 || test x$target_cpu = xx86_64 || test "x$grub_cv_cc_target_clang" = xyes ; then
|
||||
+if test x$target_cpu = xi386 || test x$target_cpu = xx86_64 || test x$target_cpu = xpowerpc || test "x$grub_cv_cc_target_clang" = xyes ; then
|
||||
TARGET_LIBGCC=
|
||||
else
|
||||
TARGET_LIBGCC=-lgcc
|
||||
Index: grub-2.02~beta2/grub-core/kern/powerpc/crtsavres.S
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ grub-2.02~beta2/grub-core/kern/powerpc/crtsavres.S
|
||||
@@ -0,0 +1,125 @@
|
||||
+/*
|
||||
+ * Special support for eabi and SVR4
|
||||
+ *
|
||||
+ * Copyright (C) 1995, 1996, 1998, 2000, 2001 Free Software Foundation, Inc.
|
||||
+ * Written By Michael Meissner
|
||||
+ * 64-bit support written by David Edelsohn
|
||||
+ *
|
||||
+ * This file 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 2, or (at your option) any
|
||||
+ * later version.
|
||||
+ *
|
||||
+ * In addition to the permissions in the GNU General Public License, the
|
||||
+ * Free Software Foundation gives you unlimited permission to link the
|
||||
+ * compiled version of this file with other programs, and to distribute
|
||||
+ * those programs without any restriction coming from the use of this
|
||||
+ * file. (The General Public License restrictions do apply in other
|
||||
+ * respects; for example, they cover modification of the file, and
|
||||
+ * distribution when not linked into another program.)
|
||||
+ *
|
||||
+ * This file 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 this program; see the file COPYING. If not, write to
|
||||
+ * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
+ * Boston, MA 02110-1301, USA.
|
||||
+ *
|
||||
+ * As a special exception, if you link this library with files
|
||||
+ * compiled with GCC to produce an executable, this does not cause
|
||||
+ * the resulting executable to be covered by the GNU General Public License.
|
||||
+ * This exception does not however invalidate any other reasons why
|
||||
+ * the executable file might be covered by the GNU General Public License.
|
||||
+ */
|
||||
+
|
||||
+/* Do any initializations needed for the eabi environment */
|
||||
+
|
||||
+ .file "crtsavres.S"
|
||||
+ .section ".text"
|
||||
+
|
||||
+/* On PowerPC64 Linux, these functions are provided by the linker. */
|
||||
+#ifndef __powerpc64__
|
||||
+
|
||||
+#define FUNC_START(name) \
|
||||
+ .type name,@function; \
|
||||
+ .globl name; \
|
||||
+name:
|
||||
+
|
||||
+/* Routines for saving integer registers, called by the compiler. */
|
||||
+/* Called with r11 pointing to the stack header word of the caller of the */
|
||||
+/* function, just beyond the end of the integer save area. */
|
||||
+
|
||||
+FUNC_START(_savegpr_14) stw 14,-72(11) /* save gp registers */
|
||||
+FUNC_START(_savegpr_15) stw 15,-68(11)
|
||||
+FUNC_START(_savegpr_16) stw 16,-64(11)
|
||||
+FUNC_START(_savegpr_17) stw 17,-60(11)
|
||||
+FUNC_START(_savegpr_18) stw 18,-56(11)
|
||||
+FUNC_START(_savegpr_19) stw 19,-52(11)
|
||||
+FUNC_START(_savegpr_20) stw 20,-48(11)
|
||||
+FUNC_START(_savegpr_21) stw 21,-44(11)
|
||||
+FUNC_START(_savegpr_22) stw 22,-40(11)
|
||||
+FUNC_START(_savegpr_23) stw 23,-36(11)
|
||||
+FUNC_START(_savegpr_24) stw 24,-32(11)
|
||||
+FUNC_START(_savegpr_25) stw 25,-28(11)
|
||||
+FUNC_START(_savegpr_26) stw 26,-24(11)
|
||||
+FUNC_START(_savegpr_27) stw 27,-20(11)
|
||||
+FUNC_START(_savegpr_28) stw 28,-16(11)
|
||||
+FUNC_START(_savegpr_29) stw 29,-12(11)
|
||||
+FUNC_START(_savegpr_30) stw 30,-8(11)
|
||||
+FUNC_START(_savegpr_31) stw 31,-4(11)
|
||||
+ blr
|
||||
+
|
||||
+/* Routines for restoring integer registers, called by the compiler. */
|
||||
+/* Called with r11 pointing to the stack header word of the caller of the */
|
||||
+/* function, just beyond the end of the integer restore area. */
|
||||
+
|
||||
+FUNC_START(_restgpr_14) lwz 14,-72(11) /* restore gp registers */
|
||||
+FUNC_START(_restgpr_15) lwz 15,-68(11)
|
||||
+FUNC_START(_restgpr_16) lwz 16,-64(11)
|
||||
+FUNC_START(_restgpr_17) lwz 17,-60(11)
|
||||
+FUNC_START(_restgpr_18) lwz 18,-56(11)
|
||||
+FUNC_START(_restgpr_19) lwz 19,-52(11)
|
||||
+FUNC_START(_restgpr_20) lwz 20,-48(11)
|
||||
+FUNC_START(_restgpr_21) lwz 21,-44(11)
|
||||
+FUNC_START(_restgpr_22) lwz 22,-40(11)
|
||||
+FUNC_START(_restgpr_23) lwz 23,-36(11)
|
||||
+FUNC_START(_restgpr_24) lwz 24,-32(11)
|
||||
+FUNC_START(_restgpr_25) lwz 25,-28(11)
|
||||
+FUNC_START(_restgpr_26) lwz 26,-24(11)
|
||||
+FUNC_START(_restgpr_27) lwz 27,-20(11)
|
||||
+FUNC_START(_restgpr_28) lwz 28,-16(11)
|
||||
+FUNC_START(_restgpr_29) lwz 29,-12(11)
|
||||
+FUNC_START(_restgpr_30) lwz 30,-8(11)
|
||||
+FUNC_START(_restgpr_31) lwz 31,-4(11)
|
||||
+ blr
|
||||
+
|
||||
+/* Routines for restoring integer registers, called by the compiler. */
|
||||
+/* Called with r11 pointing to the stack header word of the caller of the */
|
||||
+/* function, just beyond the end of the integer restore area. */
|
||||
+
|
||||
+FUNC_START(_restgpr_14_x) lwz 14,-72(11) /* restore gp registers */
|
||||
+FUNC_START(_restgpr_15_x) lwz 15,-68(11)
|
||||
+FUNC_START(_restgpr_16_x) lwz 16,-64(11)
|
||||
+FUNC_START(_restgpr_17_x) lwz 17,-60(11)
|
||||
+FUNC_START(_restgpr_18_x) lwz 18,-56(11)
|
||||
+FUNC_START(_restgpr_19_x) lwz 19,-52(11)
|
||||
+FUNC_START(_restgpr_20_x) lwz 20,-48(11)
|
||||
+FUNC_START(_restgpr_21_x) lwz 21,-44(11)
|
||||
+FUNC_START(_restgpr_22_x) lwz 22,-40(11)
|
||||
+FUNC_START(_restgpr_23_x) lwz 23,-36(11)
|
||||
+FUNC_START(_restgpr_24_x) lwz 24,-32(11)
|
||||
+FUNC_START(_restgpr_25_x) lwz 25,-28(11)
|
||||
+FUNC_START(_restgpr_26_x) lwz 26,-24(11)
|
||||
+FUNC_START(_restgpr_27_x) lwz 27,-20(11)
|
||||
+FUNC_START(_restgpr_28_x) lwz 28,-16(11)
|
||||
+FUNC_START(_restgpr_29_x) lwz 29,-12(11)
|
||||
+FUNC_START(_restgpr_30_x) lwz 30,-8(11)
|
||||
+FUNC_START(_restgpr_31_x) lwz 0,4(11)
|
||||
+ lwz 31,-4(11)
|
||||
+ mtlr 0
|
||||
+ mr 1,11
|
||||
+ blr
|
||||
+#endif
|
||||
Index: grub-2.02~beta2/grub-core/Makefile.core.def
|
||||
===================================================================
|
||||
--- grub-2.02~beta2.orig/grub-core/Makefile.core.def
|
||||
+++ grub-2.02~beta2/grub-core/Makefile.core.def
|
||||
@@ -250,6 +250,8 @@ kernel = {
|
||||
extra_dist = video/sis315_init.c;
|
||||
mips_loongson = commands/keylayouts.c;
|
||||
|
||||
+ powerpc_ieee1275 = kern/powerpc/crtsavres.S;
|
||||
+ powerpc_ieee1275 = disk/ieee1275/libgcc.c;
|
||||
powerpc_ieee1275 = kern/powerpc/cache.S;
|
||||
powerpc_ieee1275 = kern/powerpc/dl.c;
|
||||
|
||||
Index: grub-2.02~beta2/grub-core/disk/ieee1275/libgcc.c
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ grub-2.02~beta2/grub-core/disk/ieee1275/libgcc.c
|
||||
@@ -0,0 +1,106 @@
|
||||
+
|
||||
+typedef int int32 __attribute__ ((mode (SI)));
|
||||
+typedef unsigned int uint32 __attribute__ ((mode (SI)));
|
||||
+typedef int int64 __attribute__ ((mode (DI)));
|
||||
+typedef unsigned uint64 __attribute__ ((mode (DI)));
|
||||
+
|
||||
+typedef union {
|
||||
+ int64 ll;
|
||||
+ struct {
|
||||
+ int32 low, high;
|
||||
+ } u;
|
||||
+} DWunion;
|
||||
+extern int64 __ashldi3 (int64, int32);
|
||||
+int64 __ashldi3(int64 x, int32 count)
|
||||
+{
|
||||
+ if (!count)
|
||||
+ return x;
|
||||
+
|
||||
+ const DWunion uu = {.ll = x};
|
||||
+ const int32 bm = 4 * sizeof (int64) - count; /* 8 * size (int64) / 2 */
|
||||
+ DWunion w;
|
||||
+
|
||||
+ if (bm <= 0)
|
||||
+ {
|
||||
+ w.u.low = 0;
|
||||
+ w.u.high = (uint32) uu.u.low << -bm;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ const uint32 carries = (uint32) uu.u.low >> bm;
|
||||
+
|
||||
+ w.u.low = (uint32) uu.u.low << count;
|
||||
+ w.u.high = ((uint32) uu.u.high << count) | carries;
|
||||
+ }
|
||||
+
|
||||
+ return w.ll;
|
||||
+}
|
||||
+extern int64 __lshrdi3 (int64 , int32);
|
||||
+int64 __lshrdi3(int64 x, int32 count)
|
||||
+{
|
||||
+ if (!count)
|
||||
+ return x;
|
||||
+
|
||||
+ const DWunion uu = {.ll = x};
|
||||
+ const int32 bm = 4 * sizeof (int64) - count;
|
||||
+ DWunion w;
|
||||
+
|
||||
+ if (bm <= 0)
|
||||
+ {
|
||||
+ w.u.high = 0;
|
||||
+ w.u.low = (uint32) uu.u.high >> -bm;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ const uint32 carries = (uint32) uu.u.high << bm;
|
||||
+
|
||||
+ w.u.high = (uint32) uu.u.high >> count;
|
||||
+ w.u.low = ((uint32) uu.u.low >> count) | carries;
|
||||
+ }
|
||||
+
|
||||
+ return w.ll;
|
||||
+}
|
||||
+
|
||||
+extern int64 __ashrdi3 (int64, int32);
|
||||
+int64 __ashrdi3(int64 x, int32 count)
|
||||
+{
|
||||
+ if (!count)
|
||||
+ return x;
|
||||
+
|
||||
+ const DWunion uu = {.ll = x};
|
||||
+ const int32 bm = 4 * sizeof (int64) - count; /* 8 * size (int64) / 2 */
|
||||
+ DWunion w;
|
||||
+
|
||||
+ if (bm <= 0)
|
||||
+ {
|
||||
+ w.u.high =
|
||||
+ uu.u.high >> 31;
|
||||
+ w.u.low = uu.u.high >> -bm;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ const uint32 carries = (uint32) uu.u.high << bm;
|
||||
+
|
||||
+ w.u.high = (uint32) uu.u.high >> count;
|
||||
+ w.u.low = ((uint32) uu.u.low >> count) | carries;
|
||||
+ }
|
||||
+
|
||||
+ return w.ll;
|
||||
+}
|
||||
+extern int64 __ucmpdi2 (int64, int64);
|
||||
+int64 __ucmpdi2(int64 a, int64 b)
|
||||
+{
|
||||
+ const DWunion au = {.ll = a};
|
||||
+ const DWunion bu = {.ll = b};
|
||||
+
|
||||
+ if ((unsigned int) au.u.high < (unsigned int) bu.u.high)
|
||||
+ return 0;
|
||||
+ else if ((unsigned int) au.u.high > (unsigned int) bu.u.high)
|
||||
+ return 2;
|
||||
+ if ((unsigned int) au.u.low < (unsigned int) bu.u.low)
|
||||
+ return 0;
|
||||
+ else if ((unsigned int) au.u.low > (unsigned int) bu.u.low)
|
||||
+ return 2;
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
Index: grub-2.02~beta2/include/grub/libgcc.h
|
||||
===================================================================
|
||||
--- grub-2.02~beta2.orig/include/grub/libgcc.h
|
||||
+++ grub-2.02~beta2/include/grub/libgcc.h
|
||||
@@ -24,16 +24,16 @@
|
||||
|
||||
/* On x86 these functions aren't really needed. Save some space. */
|
||||
#if !defined (__i386__) && !defined (__x86_64__)
|
||||
-# ifdef HAVE___ASHLDI3
|
||||
+# if defined (HAVE___ASHLDI3) || defined (__powerpc__)
|
||||
void EXPORT_FUNC (__ashldi3) (void);
|
||||
# endif
|
||||
-# ifdef HAVE___ASHRDI3
|
||||
+# if defined (HAVE___ASHRDI3) || defined (__powerpc__)
|
||||
void EXPORT_FUNC (__ashrdi3) (void);
|
||||
# endif
|
||||
-# ifdef HAVE___LSHRDI3
|
||||
+# if defined (HAVE___LSHRDI3) || defined (__powerpc__)
|
||||
void EXPORT_FUNC (__lshrdi3) (void);
|
||||
# endif
|
||||
-# ifdef HAVE___UCMPDI2
|
||||
+# if defined (HAVE___UCMPDI2) || defined (__powerpc__)
|
||||
void EXPORT_FUNC (__ucmpdi2) (void);
|
||||
# endif
|
||||
# ifdef HAVE___BSWAPSI2
|
||||
@@ -50,7 +50,7 @@ void EXPORT_FUNC (__ctzsi2) (void);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
-#ifdef HAVE__RESTGPR_14_X
|
||||
+#if defined (HAVE__RESTGPR_14_X) || defined (__powerpc__)
|
||||
void EXPORT_FUNC (_restgpr_14_x) (void);
|
||||
void EXPORT_FUNC (_restgpr_15_x) (void);
|
||||
void EXPORT_FUNC (_restgpr_16_x) (void);
|
39
grub2-ppc64-build-ppc64-32bit.patch
Normal file
39
grub2-ppc64-build-ppc64-32bit.patch
Normal file
@ -0,0 +1,39 @@
|
||||
Index: grub-2.02~beta2/util/mkimage.c
|
||||
===================================================================
|
||||
--- grub-2.02~beta2.orig/util/mkimage.c
|
||||
+++ grub-2.02~beta2/util/mkimage.c
|
||||
@@ -354,13 +354,10 @@ static const struct grub_install_image_t
|
||||
{
|
||||
.dirname = "powerpc-ieee1275",
|
||||
.names = { "powerpc-ieee1275", NULL },
|
||||
-
|
||||
-#ifdef __powerpc64__
|
||||
+#ifdef __powerpc64le__
|
||||
.voidp_sizeof = 8,
|
||||
- .elf_target = EM_PPC64,
|
||||
#else
|
||||
.voidp_sizeof = 4,
|
||||
- .elf_target = EM_PPC,
|
||||
#endif
|
||||
|
||||
#ifdef __powerpc64le__
|
||||
@@ -368,7 +365,6 @@ static const struct grub_install_image_t
|
||||
#else
|
||||
.bigendian = 1,
|
||||
#endif
|
||||
-
|
||||
.id = IMAGE_PPC,
|
||||
.flags = PLATFORM_FLAGS_NONE,
|
||||
.total_module_size = TARGET_NO_FIELD,
|
||||
@@ -378,6 +374,11 @@ static const struct grub_install_image_t
|
||||
.section_align = 1,
|
||||
.vaddr_offset = 0,
|
||||
.link_addr = GRUB_KERNEL_POWERPC_IEEE1275_LINK_ADDR,
|
||||
+#ifdef __powerpc64le__
|
||||
+ .elf_target = EM_PPC64,
|
||||
+#else
|
||||
+ .elf_target = EM_PPC,
|
||||
+#endif
|
||||
.mod_gap = GRUB_KERNEL_POWERPC_IEEE1275_MOD_GAP,
|
||||
.mod_align = GRUB_KERNEL_POWERPC_IEEE1275_MOD_ALIGN,
|
||||
.link_align = 4
|
33
grub2-ppc64-qemu.patch
Normal file
33
grub2-ppc64-qemu.patch
Normal file
@ -0,0 +1,33 @@
|
||||
From 90f6eed0b4ffdfe361c2966e62fcb8ed11b528bc Mon Sep 17 00:00:00 2001
|
||||
From: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
||||
Date: Thu, 20 Mar 2014 16:39:29 +0530
|
||||
Subject: [PATCH] ieee1275: check for IBM pseries emulated machine
|
||||
|
||||
As there is no check for IBM pSeries qemu machine, is_qemu is not
|
||||
set. So feature like GRUB_IEEE1275_FLAG_HAS_CURSORONOFF is not
|
||||
enabled. This results in cursor not being displayed during the
|
||||
grub-menu.
|
||||
|
||||
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
|
||||
---
|
||||
grub-core/kern/ieee1275/cmain.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/grub-core/kern/ieee1275/cmain.c b/grub-core/kern/ieee1275/cmain.c
|
||||
index d92ae14..3e12e6b 100644
|
||||
--- a/grub-core/kern/ieee1275/cmain.c
|
||||
+++ b/grub-core/kern/ieee1275/cmain.c
|
||||
@@ -84,8 +84,10 @@ grub_ieee1275_find_options (void)
|
||||
|
||||
rc = grub_ieee1275_get_property (root, "model",
|
||||
tmp, sizeof (tmp), 0);
|
||||
- if (rc >= 0 && !grub_strcmp (tmp, "Emulated PC"))
|
||||
+ if (rc >= 0 && (!grub_strcmp (tmp, "Emulated PC")
|
||||
+ || !grub_strcmp (tmp, "IBM pSeries (emulated by qemu)"))) {
|
||||
is_qemu = 1;
|
||||
+ }
|
||||
|
||||
if (rc >= 0 && grub_strncmp (tmp, "IBM", 3) == 0)
|
||||
grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_NO_TREE_SCANNING_FOR_DISKS);
|
||||
--
|
||||
1.8.3.1
|
@ -0,0 +1,52 @@
|
||||
From aae96031c1d54796334d5e49f8fbf7144ead1883 Mon Sep 17 00:00:00 2001
|
||||
From: Ram Pai <linuxram@us.ibm.com>
|
||||
Date: Mon, 24 Feb 2014 22:26:14 +0000
|
||||
Subject: [PATCH 01/23] Add Little-Endian support for Power64 to the build
|
||||
|
||||
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
|
||||
Signed-off-by: Tomohiro B Berry <tbberry@us.ibm.com>
|
||||
Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
|
||||
---
|
||||
config.h.in | 4 ++++
|
||||
configure.ac | 6 ++++++
|
||||
2 files changed, 10 insertions(+)
|
||||
|
||||
Index: grub-2.02~beta2/config.h.in
|
||||
===================================================================
|
||||
--- grub-2.02~beta2.orig/config.h.in
|
||||
+++ grub-2.02~beta2/config.h.in
|
||||
@@ -6,6 +6,10 @@
|
||||
#define __powerpc__ 1
|
||||
#endif
|
||||
|
||||
+#if defined(__PPC64__) && defined(__LITTLE_ENDIAN__)
|
||||
+#define __powerpc64le__ 1
|
||||
+#endif
|
||||
+
|
||||
#define GCRYPT_NO_DEPRECATED 1
|
||||
|
||||
/* Define to 1 to enable disk cache statistics. */
|
||||
Index: grub-2.02~beta2/configure.ac
|
||||
===================================================================
|
||||
--- grub-2.02~beta2.orig/configure.ac
|
||||
+++ grub-2.02~beta2/configure.ac
|
||||
@@ -137,6 +137,7 @@ case "$target_cpu"-"$platform" in
|
||||
x86_64-xen) ;;
|
||||
x86_64-*) target_cpu=i386 ;;
|
||||
powerpc64-ieee1275) target_cpu=powerpc ;;
|
||||
+ powerpc64le-ieee1275) target_cpu=powerpc; do_bits=64 ;;
|
||||
esac
|
||||
|
||||
# Check if the platform is supported, make final adjustments.
|
||||
@@ -344,6 +345,11 @@ AC_SYS_LARGEFILE
|
||||
# Identify characteristics of the host architecture.
|
||||
unset ac_cv_c_bigendian
|
||||
|
||||
+if test -n "$do_bits" ; then
|
||||
+ target_m32=0;
|
||||
+ target_m64=1;
|
||||
+fi
|
||||
+
|
||||
if test x"$target_cpu-$platform" = xsparc64-emu ; then
|
||||
CFLAGS="$CFLAGS -m64"
|
||||
HOST_CFLAGS="$HOST_CFLAGS -m64"
|
@ -0,0 +1,32 @@
|
||||
e5d79c82de59b004d65399e Mon Sep 17 00:00:00 2001
|
||||
From: Ram Pai <linuxram@us.ibm.com>
|
||||
Date: Mon, 24 Feb 2014 23:01:07 +0000
|
||||
Subject: [PATCH 02/23] Build grub as O1 until we add savegpr and restgpr
|
||||
routines
|
||||
|
||||
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
---
|
||||
configure.ac | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index c9d2ce6..7b9d7ed 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -73,7 +73,12 @@ grub_TRANSFORM([grub-file])
|
||||
|
||||
# Optimization flag. Allow user to override.
|
||||
if test "x$TARGET_CFLAGS" = x; then
|
||||
- TARGET_CFLAGS="$TARGET_CFLAGS -Os"
|
||||
+ if test "x$target_cpu" = xpowerpc64le; then
|
||||
+ #HACK till savegpr/addgpr is supported
|
||||
+ TARGET_CFLAGS="$TARGET_CFLAGS -O1"
|
||||
+ else
|
||||
+ TARGET_CFLAGS="$TARGET_CFLAGS -Os"
|
||||
+ fi
|
||||
fi
|
||||
|
||||
# Default HOST_CPPFLAGS
|
||||
--
|
||||
1.8.3.1
|
@ -0,0 +1,27 @@
|
||||
From f3b10c3a7e098f22a6f3863c3b56a483e3fe96a7 Mon Sep 17 00:00:00 2001
|
||||
From: Ram Pai <linuxram@us.ibm.com>
|
||||
Date: Fri, 28 Feb 2014 20:17:34 +0000
|
||||
Subject: [PATCH 03/23] disable creation of vsx and altivec instructions.
|
||||
|
||||
These instructions fault on power7.
|
||||
|
||||
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
|
||||
---
|
||||
configure.ac | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 7b9d7ed..ded7dbc 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -75,7 +75,7 @@ grub_TRANSFORM([grub-file])
|
||||
if test "x$TARGET_CFLAGS" = x; then
|
||||
if test "x$target_cpu" = xpowerpc64le; then
|
||||
#HACK till savegpr/addgpr is supported
|
||||
- TARGET_CFLAGS="$TARGET_CFLAGS -O1"
|
||||
+ TARGET_CFLAGS="$TARGET_CFLAGS -O1 -mno-altivec -mno-vsx"
|
||||
else
|
||||
TARGET_CFLAGS="$TARGET_CFLAGS -Os"
|
||||
fi
|
||||
--
|
||||
1.8.3.1
|
@ -0,0 +1,30 @@
|
||||
From ccd71bef390c23fa2e513d6144d16d591279d0a2 Mon Sep 17 00:00:00 2001
|
||||
From: Ram Pai <linuxram@us.ibm.com>
|
||||
Date: Mon, 24 Feb 2014 23:41:41 +0000
|
||||
Subject: [PATCH 04/23] ignore .TOC. symbol during build
|
||||
|
||||
powerpc64 LE's linker knows how to handle the undefined
|
||||
symbol .TOC. in grub modules. So just ignore that symbol during build.
|
||||
|
||||
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
|
||||
---
|
||||
grub-core/gensyminfo.sh.in | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/grub-core/gensyminfo.sh.in b/grub-core/gensyminfo.sh.in
|
||||
index 2e8716b..7754dc9 100644
|
||||
--- a/grub-core/gensyminfo.sh.in
|
||||
+++ b/grub-core/gensyminfo.sh.in
|
||||
@@ -34,4 +34,9 @@ else
|
||||
fi
|
||||
|
||||
# Print all undefined symbols used by module
|
||||
-@TARGET_NM@ -u @TARGET_NMFLAGS_MINUS_P@ -p $module | sed "s@^\([^ ]*\).*@undefined $modname \1@g"
|
||||
+if test x"@GRUB_TARGET_CPU@" = xpowerpc; then
|
||||
+ #ignore the special .TOC. symbol on powerpc64le
|
||||
+ @TARGET_NM@ -u @TARGET_NMFLAGS_MINUS_P@ -p $module | grep -w -v '.TOC.'
|
||||
+else
|
||||
+ @TARGET_NM@ -u @TARGET_NMFLAGS_MINUS_P@ -p $module
|
||||
+fi | sed "s@^\([^ ]*\).*@undefined $modname \1@g"
|
||||
--
|
||||
1.8.3.1
|
@ -0,0 +1,48 @@
|
||||
From 36ac10e085ecf53e9c76685e05a1ebe7b5221ca3 Mon Sep 17 00:00:00 2001
|
||||
From: Ram Pai <linuxram@us.ibm.com>
|
||||
Date: Tue, 25 Feb 2014 00:07:43 +0000
|
||||
Subject: [PATCH 05/23] recognize and install a LE grub boot loader
|
||||
|
||||
grub-install can now recognize and install a LE grub boot loader
|
||||
|
||||
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
|
||||
---
|
||||
util/mkimage.c | 14 +++++++++++++-
|
||||
1 file changed, 13 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/util/mkimage.c b/util/mkimage.c
|
||||
index 26d9816..9374ccd 100644
|
||||
--- a/util/mkimage.c
|
||||
+++ b/util/mkimage.c
|
||||
@@ -354,8 +354,21 @@ static const struct grub_install_image_target_desc image_targets[] =
|
||||
{
|
||||
.dirname = "powerpc-ieee1275",
|
||||
.names = { "powerpc-ieee1275", NULL },
|
||||
+
|
||||
+#ifdef __powerpc64__
|
||||
+ .voidp_sizeof = 8,
|
||||
+ .elf_target = EM_PPC64,
|
||||
+#else
|
||||
.voidp_sizeof = 4,
|
||||
+ .elf_target = EM_PPC,
|
||||
+#endif
|
||||
+
|
||||
+#ifdef __powerpc64le__
|
||||
+ .bigendian = 0,
|
||||
+#else
|
||||
.bigendian = 1,
|
||||
+#endif
|
||||
+
|
||||
.id = IMAGE_PPC,
|
||||
.flags = PLATFORM_FLAGS_NONE,
|
||||
.total_module_size = TARGET_NO_FIELD,
|
||||
@@ -365,7 +378,6 @@ static const struct grub_install_image_target_desc image_targets[] =
|
||||
.section_align = 1,
|
||||
.vaddr_offset = 0,
|
||||
.link_addr = GRUB_KERNEL_POWERPC_IEEE1275_LINK_ADDR,
|
||||
- .elf_target = EM_PPC,
|
||||
.mod_gap = GRUB_KERNEL_POWERPC_IEEE1275_MOD_GAP,
|
||||
.mod_align = GRUB_KERNEL_POWERPC_IEEE1275_MOD_ALIGN,
|
||||
.link_align = 4
|
||||
--
|
||||
1.8.3.1
|
@ -0,0 +1,47 @@
|
||||
From 12d83a4bded734551415df888bd80b97fdb3d4ad Mon Sep 17 00:00:00 2001
|
||||
From: Ram Pai <linuxram@us.ibm.com>
|
||||
Date: Wed, 26 Feb 2014 10:28:13 +0000
|
||||
Subject: [PATCH 06/23] set the ABI version correctly
|
||||
|
||||
set the ABI version to 0x02 in the e_flag of the PPC64LE ELF image.
|
||||
|
||||
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
|
||||
---
|
||||
include/grub/elf.h | 1 +
|
||||
util/grub-mkimagexx.c | 4 ++++
|
||||
2 files changed, 5 insertions(+)
|
||||
|
||||
diff --git a/include/grub/elf.h b/include/grub/elf.h
|
||||
index caa7963..bee7583 100644
|
||||
--- a/include/grub/elf.h
|
||||
+++ b/include/grub/elf.h
|
||||
@@ -1851,6 +1851,7 @@ typedef Elf32_Addr Elf32_Conflict;
|
||||
|
||||
/* Values for Elf32/64_Ehdr.e_flags. */
|
||||
#define EF_PPC_EMB 0x80000000 /* PowerPC embedded flag */
|
||||
+#define EF_PPC64LE_ABIV2 0x00000002 /* PowerPC 64 LE flag */
|
||||
|
||||
/* Cygnus local bits below */
|
||||
#define EF_PPC_RELOCATABLE 0x00010000 /* PowerPC -mrelocatable flag*/
|
||||
diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c
|
||||
index 0a1ac9e..b1833a1 100644
|
||||
--- a/util/grub-mkimagexx.c
|
||||
+++ b/util/grub-mkimagexx.c
|
||||
@@ -141,11 +141,15 @@ SUFFIX (generate_elf) (const struct grub_install_image_target_desc *image_target
|
||||
phdr->p_vaddr = grub_host_to_target32 (target_addr);
|
||||
phdr->p_paddr = grub_host_to_target32 (target_addr);
|
||||
phdr->p_align = grub_host_to_target32 (align > image_target->link_align ? align : image_target->link_align);
|
||||
+
|
||||
if (image_target->id == IMAGE_LOONGSON_ELF)
|
||||
ehdr->e_flags = grub_host_to_target32 (0x1000 | EF_MIPS_NOREORDER
|
||||
| EF_MIPS_PIC | EF_MIPS_CPIC);
|
||||
+ else if (image_target->id == IMAGE_PPC && image_target->bigendian == 0)
|
||||
+ ehdr->e_flags = grub_host_to_target32 (EF_PPC64LE_ABIV2);
|
||||
else
|
||||
ehdr->e_flags = 0;
|
||||
+
|
||||
if (image_target->id == IMAGE_LOONGSON_ELF)
|
||||
{
|
||||
phdr->p_filesz = grub_host_to_target32 (*core_size);
|
||||
--
|
||||
1.8.3.1
|
236
grub2-ppc64le-07-Add-IEEE1275_ADDR-helper.patch
Normal file
236
grub2-ppc64le-07-Add-IEEE1275_ADDR-helper.patch
Normal file
@ -0,0 +1,236 @@
|
||||
From c3718600e10e985fe770d13e0110f086256b984f Mon Sep 17 00:00:00 2001
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
Date: Wed, 29 Jan 2014 10:29:32 +1100
|
||||
Subject: [PATCH 07/23] Add IEEE1275_ADDR helper
|
||||
|
||||
If the target pointer size doesn't match the IEEE1275 cell size, we
|
||||
need to cast twice to avoid a warning.
|
||||
|
||||
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
---
|
||||
grub-core/disk/ieee1275/ofdisk.c | 4 ++--
|
||||
grub-core/kern/ieee1275/ieee1275.c | 30 +++++++++++++++---------------
|
||||
grub-core/kern/ieee1275/openfw.c | 6 +++---
|
||||
grub-core/lib/ieee1275/datetime.c | 4 ++--
|
||||
grub-core/net/drivers/ieee1275/ofnet.c | 2 +-
|
||||
include/grub/ieee1275/ieee1275.h | 4 +++-
|
||||
6 files changed, 26 insertions(+), 24 deletions(-)
|
||||
|
||||
diff --git a/grub-core/disk/ieee1275/ofdisk.c b/grub-core/disk/ieee1275/ofdisk.c
|
||||
index 6870b39..1b72f06 100644
|
||||
--- a/grub-core/disk/ieee1275/ofdisk.c
|
||||
+++ b/grub-core/disk/ieee1275/ofdisk.c
|
||||
@@ -224,7 +224,7 @@ dev_iterate (const struct grub_ieee1275_devalias *alias)
|
||||
return;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "call-method", 2, 3);
|
||||
- args.method = (grub_ieee1275_cell_t) "vscsi-report-luns";
|
||||
+ args.method = IEEE1275_ADDR("vscsi-report-luns");
|
||||
args.ihandle = ihandle;
|
||||
args.table = 0;
|
||||
args.nentries = 0;
|
||||
@@ -613,7 +613,7 @@ grub_ofdisk_get_block_size (const char *device, grub_uint32_t *block_size)
|
||||
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't open device");
|
||||
|
||||
INIT_IEEE1275_COMMON (&args_ieee1275.common, "call-method", 2, 2);
|
||||
- args_ieee1275.method = (grub_ieee1275_cell_t) "block-size";
|
||||
+ args_ieee1275.method = IEEE1275_ADDR("block-size");
|
||||
args_ieee1275.ihandle = last_ihandle;
|
||||
args_ieee1275.result = 1;
|
||||
|
||||
diff --git a/grub-core/kern/ieee1275/ieee1275.c b/grub-core/kern/ieee1275/ieee1275.c
|
||||
index 9821702..f933c89 100644
|
||||
--- a/grub-core/kern/ieee1275/ieee1275.c
|
||||
+++ b/grub-core/kern/ieee1275/ieee1275.c
|
||||
@@ -38,7 +38,7 @@ grub_ieee1275_finddevice (const char *name, grub_ieee1275_phandle_t *phandlep)
|
||||
args;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "finddevice", 1, 1);
|
||||
- args.device = (grub_ieee1275_cell_t) name;
|
||||
+ args.device = IEEE1275_ADDR(name);
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
@@ -66,8 +66,8 @@ grub_ieee1275_get_property (grub_ieee1275_phandle_t phandle,
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "getprop", 4, 1);
|
||||
args.phandle = phandle;
|
||||
- args.prop = (grub_ieee1275_cell_t) property;
|
||||
- args.buf = (grub_ieee1275_cell_t) buf;
|
||||
+ args.prop = IEEE1275_ADDR(property);
|
||||
+ args.buf = IEEE1275_ADDR(buf);
|
||||
args.buflen = (grub_ieee1275_cell_t) size;
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
@@ -115,8 +115,8 @@ grub_ieee1275_next_property (grub_ieee1275_phandle_t phandle, char *prev_prop,
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "nextprop", 3, 1);
|
||||
args.phandle = phandle;
|
||||
- args.prev_prop = (grub_ieee1275_cell_t) prev_prop;
|
||||
- args.next_prop = (grub_ieee1275_cell_t) prop;
|
||||
+ args.prev_prop = IEEE1275_ADDR(prev_prop);
|
||||
+ args.next_prop = IEEE1275_ADDR(prop);
|
||||
args.flags = (grub_ieee1275_cell_t) -1;
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
@@ -139,7 +139,7 @@ grub_ieee1275_get_property_length (grub_ieee1275_phandle_t phandle,
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "getproplen", 2, 1);
|
||||
args.phandle = phandle;
|
||||
- args.prop = (grub_ieee1275_cell_t) prop;
|
||||
+ args.prop = IEEE1275_ADDR(prop);
|
||||
args.length = (grub_ieee1275_cell_t) -1;
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
@@ -190,7 +190,7 @@ grub_ieee1275_package_to_path (grub_ieee1275_phandle_t phandle,
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "package-to-path", 3, 1);
|
||||
args.phandle = phandle;
|
||||
- args.buf = (grub_ieee1275_cell_t) path;
|
||||
+ args.buf = IEEE1275_ADDR(path);
|
||||
args.buflen = (grub_ieee1275_cell_t) len;
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
@@ -219,7 +219,7 @@ grub_ieee1275_instance_to_path (grub_ieee1275_ihandle_t ihandle,
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "instance-to-path", 3, 1);
|
||||
args.ihandle = ihandle;
|
||||
- args.buf = (grub_ieee1275_cell_t) path;
|
||||
+ args.buf = IEEE1275_ADDR(path);
|
||||
args.buflen = (grub_ieee1275_cell_t) len;
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
@@ -247,7 +247,7 @@ grub_ieee1275_write (grub_ieee1275_ihandle_t ihandle, const void *buffer,
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "write", 3, 1);
|
||||
args.ihandle = ihandle;
|
||||
- args.buf = (grub_ieee1275_cell_t) buffer;
|
||||
+ args.buf = IEEE1275_ADDR(buffer);
|
||||
args.len = (grub_ieee1275_cell_t) len;
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
@@ -273,7 +273,7 @@ grub_ieee1275_read (grub_ieee1275_ihandle_t ihandle, void *buffer,
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "read", 3, 1);
|
||||
args.ihandle = ihandle;
|
||||
- args.buf = (grub_ieee1275_cell_t) buffer;
|
||||
+ args.buf = IEEE1275_ADDR(buffer);
|
||||
args.len = (grub_ieee1275_cell_t) len;
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
@@ -401,7 +401,7 @@ grub_ieee1275_interpret (const char *command, grub_ieee1275_cell_t *catch)
|
||||
return -1;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "interpret", 1, 1);
|
||||
- args.command = (grub_ieee1275_cell_t) command;
|
||||
+ args.command = IEEE1275_ADDR(command);
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
@@ -453,7 +453,7 @@ grub_ieee1275_open (const char *path, grub_ieee1275_ihandle_t *result)
|
||||
args;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "open", 1, 1);
|
||||
- args.path = (grub_ieee1275_cell_t) path;
|
||||
+ args.path = IEEE1275_ADDR(path);
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
@@ -548,8 +548,8 @@ grub_ieee1275_set_property (grub_ieee1275_phandle_t phandle,
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "setprop", 4, 1);
|
||||
args.size = (grub_ieee1275_cell_t) size;
|
||||
- args.buf = (grub_ieee1275_cell_t) buf;
|
||||
- args.propname = (grub_ieee1275_cell_t) propname;
|
||||
+ args.buf = IEEE1275_ADDR(buf);
|
||||
+ args.propname = IEEE1275_ADDR(propname);
|
||||
args.phandle = (grub_ieee1275_cell_t) phandle;
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
@@ -578,7 +578,7 @@ grub_ieee1275_set_color (grub_ieee1275_ihandle_t ihandle,
|
||||
args;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "call-method", 6, 1);
|
||||
- args.method = (grub_ieee1275_cell_t) "color!";
|
||||
+ args.method = IEEE1275_ADDR("color!");
|
||||
args.ihandle = ihandle;
|
||||
args.index = index;
|
||||
args.r = r;
|
||||
diff --git a/grub-core/kern/ieee1275/openfw.c b/grub-core/kern/ieee1275/openfw.c
|
||||
index ddb7783..a8bbc71 100644
|
||||
--- a/grub-core/kern/ieee1275/openfw.c
|
||||
+++ b/grub-core/kern/ieee1275/openfw.c
|
||||
@@ -285,7 +285,7 @@ grub_ieee1275_map (grub_addr_t phys, grub_addr_t virt, grub_size_t size,
|
||||
6,
|
||||
#endif
|
||||
1);
|
||||
- args.method = (grub_ieee1275_cell_t) "map";
|
||||
+ args.method = IEEE1275_ADDR("map");
|
||||
args.ihandle = grub_ieee1275_mmu;
|
||||
#ifdef __sparc__
|
||||
args.phys_high = 0;
|
||||
@@ -543,8 +543,8 @@ grub_ieee1275_canonicalise_devname (const char *path)
|
||||
return NULL;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "canon", 3, 1);
|
||||
- args.path = (grub_ieee1275_cell_t) path;
|
||||
- args.buf = (grub_ieee1275_cell_t) buf;
|
||||
+ args.path = IEEE1275_ADDR(path);
|
||||
+ args.buf = IEEE1275_ADDR(buf);
|
||||
args.inlen = (grub_ieee1275_cell_t) (bufsize - 1);
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
diff --git a/grub-core/lib/ieee1275/datetime.c b/grub-core/lib/ieee1275/datetime.c
|
||||
index 74578f1..fa0d3b6 100644
|
||||
--- a/grub-core/lib/ieee1275/datetime.c
|
||||
+++ b/grub-core/lib/ieee1275/datetime.c
|
||||
@@ -84,7 +84,7 @@ grub_get_datetime (struct grub_datetime *datetime)
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "call-method", 2, 7);
|
||||
args.device = (grub_ieee1275_cell_t) ihandle;
|
||||
- args.method = (grub_ieee1275_cell_t) "get-time";
|
||||
+ args.method = IEEE1275_ADDR("get-time");
|
||||
|
||||
status = IEEE1275_CALL_ENTRY_FN (&args);
|
||||
|
||||
@@ -136,7 +136,7 @@ grub_set_datetime (struct grub_datetime *datetime)
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "call-method", 8, 1);
|
||||
args.device = (grub_ieee1275_cell_t) ihandle;
|
||||
- args.method = (grub_ieee1275_cell_t) "set-time";
|
||||
+ args.method = IEEE1275_ADDR("set-time");
|
||||
|
||||
args.year = datetime->year;
|
||||
args.month = datetime->month;
|
||||
diff --git a/grub-core/net/drivers/ieee1275/ofnet.c b/grub-core/net/drivers/ieee1275/ofnet.c
|
||||
index eea8e71..ea6456f 100644
|
||||
--- a/grub-core/net/drivers/ieee1275/ofnet.c
|
||||
+++ b/grub-core/net/drivers/ieee1275/ofnet.c
|
||||
@@ -386,7 +386,7 @@ search_net_devices (struct grub_ieee1275_devalias *alias)
|
||||
args;
|
||||
INIT_IEEE1275_COMMON (&args.common, "interpret", 2, 2);
|
||||
args.len = card->txbufsize;
|
||||
- args.method = (grub_ieee1275_cell_t) "alloc-mem";
|
||||
+ args.method = IEEE1275_ADDR("alloc-mem");
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1
|
||||
|| args.catch)
|
||||
diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h
|
||||
index 8e42513..2e5270c 100644
|
||||
--- a/include/grub/ieee1275/ieee1275.h
|
||||
+++ b/include/grub/ieee1275/ieee1275.h
|
||||
@@ -49,8 +49,10 @@ struct grub_ieee1275_common_hdr
|
||||
grub_ieee1275_cell_t nr_outs;
|
||||
};
|
||||
|
||||
+#define IEEE1275_ADDR(x) (grub_uint32_t)(grub_addr_t)(x)
|
||||
+
|
||||
#define INIT_IEEE1275_COMMON(p, xname, xins, xouts) \
|
||||
- (p)->name = (grub_ieee1275_cell_t) xname; \
|
||||
+ (p)->name = (grub_ieee1275_cell_t) IEEE1275_ADDR(xname); \
|
||||
(p)->nr_ins = (grub_ieee1275_cell_t) xins; \
|
||||
(p)->nr_outs = (grub_ieee1275_cell_t) xouts
|
||||
|
||||
--
|
||||
1.8.3.1
|
67
grub2-ppc64le-08-Fix-some-more-warnings-when-casting.patch
Normal file
67
grub2-ppc64le-08-Fix-some-more-warnings-when-casting.patch
Normal file
@ -0,0 +1,67 @@
|
||||
From ab7a0d7323fd2f6eb4f55da50386378d6a7a7af0 Mon Sep 17 00:00:00 2001
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
Date: Wed, 29 Jan 2014 10:36:41 +1100
|
||||
Subject: [PATCH 08/23] Fix some more warnings when casting.
|
||||
|
||||
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
---
|
||||
grub-core/disk/ieee1275/ofdisk.c | 2 +-
|
||||
grub-core/lib/powerpc/relocator.c | 8 ++++----
|
||||
grub-core/net/drivers/ieee1275/ofnet.c | 2 +-
|
||||
3 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/grub-core/disk/ieee1275/ofdisk.c b/grub-core/disk/ieee1275/ofdisk.c
|
||||
index 1b72f06..d785d6a 100644
|
||||
--- a/grub-core/disk/ieee1275/ofdisk.c
|
||||
+++ b/grub-core/disk/ieee1275/ofdisk.c
|
||||
@@ -244,7 +244,7 @@ dev_iterate (const struct grub_ieee1275_devalias *alias)
|
||||
{
|
||||
grub_uint64_t *ptr;
|
||||
|
||||
- ptr = *(grub_uint64_t **) (args.table + 4 + 8 * i);
|
||||
+ ptr = *(grub_uint64_t **) ((grub_addr_t)args.table + 4 + 8 * i);
|
||||
while (*ptr)
|
||||
{
|
||||
grub_snprintf (bufptr, 32, "/disk@%" PRIxGRUB_UINT64_T, *ptr++);
|
||||
diff --git a/grub-core/lib/powerpc/relocator.c b/grub-core/lib/powerpc/relocator.c
|
||||
index bdf2b11..4bac96f 100644
|
||||
--- a/grub-core/lib/powerpc/relocator.c
|
||||
+++ b/grub-core/lib/powerpc/relocator.c
|
||||
@@ -84,8 +84,8 @@ grub_cpu_relocator_backward (void *ptr0, void *src, void *dest,
|
||||
grub_size_t size)
|
||||
{
|
||||
void *ptr = ptr0;
|
||||
- write_reg (8, (grub_uint32_t) src, &ptr);
|
||||
- write_reg (9, (grub_uint32_t) dest, &ptr);
|
||||
+ write_reg (8, (grub_uint32_t) (grub_addr_t) src, &ptr);
|
||||
+ write_reg (9, (grub_uint32_t) (grub_addr_t) dest, &ptr);
|
||||
write_reg (10, (grub_uint32_t) size, &ptr);
|
||||
grub_memcpy (ptr, &grub_relocator_backward_start,
|
||||
RELOCATOR_SRC_SIZEOF (backward));
|
||||
@@ -96,8 +96,8 @@ grub_cpu_relocator_forward (void *ptr0, void *src, void *dest,
|
||||
grub_size_t size)
|
||||
{
|
||||
void *ptr = ptr0;
|
||||
- write_reg (8, (grub_uint32_t) src, &ptr);
|
||||
- write_reg (9, (grub_uint32_t) dest, &ptr);
|
||||
+ write_reg (8, (grub_uint32_t) (grub_addr_t) src, &ptr);
|
||||
+ write_reg (9, (grub_uint32_t) (grub_addr_t) dest, &ptr);
|
||||
write_reg (10, (grub_uint32_t) size, &ptr);
|
||||
grub_memcpy (ptr, &grub_relocator_forward_start,
|
||||
RELOCATOR_SRC_SIZEOF (forward));
|
||||
diff --git a/grub-core/net/drivers/ieee1275/ofnet.c b/grub-core/net/drivers/ieee1275/ofnet.c
|
||||
index ea6456f..07c8446 100644
|
||||
--- a/grub-core/net/drivers/ieee1275/ofnet.c
|
||||
+++ b/grub-core/net/drivers/ieee1275/ofnet.c
|
||||
@@ -395,7 +395,7 @@ search_net_devices (struct grub_ieee1275_devalias *alias)
|
||||
grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory"));
|
||||
}
|
||||
else
|
||||
- card->txbuf = (void *) args.result;
|
||||
+ card->txbuf = (void *) (grub_addr_t) args.result;
|
||||
}
|
||||
else
|
||||
card->txbuf = grub_zalloc (card->txbufsize);
|
||||
--
|
||||
1.8.3.1
|
37
grub2-ppc64le-09-Add-powerpc64-types.patch
Normal file
37
grub2-ppc64le-09-Add-powerpc64-types.patch
Normal file
@ -0,0 +1,37 @@
|
||||
From 71a44537c3293d14184901a39f87e2b9d748c8ce Mon Sep 17 00:00:00 2001
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
Date: Wed, 29 Jan 2014 10:37:54 +1100
|
||||
Subject: [PATCH 09/23] Add powerpc64 types
|
||||
|
||||
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
---
|
||||
include/grub/powerpc/types.h | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/include/grub/powerpc/types.h b/include/grub/powerpc/types.h
|
||||
index a098ae6..7a2fc6b 100644
|
||||
--- a/include/grub/powerpc/types.h
|
||||
+++ b/include/grub/powerpc/types.h
|
||||
@@ -19,11 +19,19 @@
|
||||
#ifndef GRUB_TYPES_CPU_HEADER
|
||||
#define GRUB_TYPES_CPU_HEADER 1
|
||||
|
||||
+#ifdef __powerpc64le__
|
||||
+/* The size of void *. */
|
||||
+#define GRUB_TARGET_SIZEOF_VOID_P 8
|
||||
+
|
||||
+/* The size of long. */
|
||||
+#define GRUB_TARGET_SIZEOF_LONG 8
|
||||
+#else
|
||||
/* The size of void *. */
|
||||
#define GRUB_TARGET_SIZEOF_VOID_P 4
|
||||
|
||||
/* The size of long. */
|
||||
#define GRUB_TARGET_SIZEOF_LONG 4
|
||||
+#endif
|
||||
|
||||
/* powerpc is big-endian. */
|
||||
#define GRUB_TARGET_WORDS_BIGENDIAN 1
|
||||
--
|
||||
1.8.3.1
|
@ -0,0 +1,42 @@
|
||||
From 258ae455c8fdcee9884fa9e4cf432a4d22694ce2 Mon Sep 17 00:00:00 2001
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
Date: Wed, 29 Jan 2014 10:37:54 +1100
|
||||
Subject: [PATCH 10/23] powerpc64 is not necessarily BigEndian
|
||||
|
||||
powerpc64 is not necessarily BigEndian anymore! :)
|
||||
|
||||
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
|
||||
---
|
||||
include/grub/powerpc/types.h | 10 +++++++---
|
||||
1 file changed, 7 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/include/grub/powerpc/types.h b/include/grub/powerpc/types.h
|
||||
index 7a2fc6b..ab138d4 100644
|
||||
--- a/include/grub/powerpc/types.h
|
||||
+++ b/include/grub/powerpc/types.h
|
||||
@@ -19,7 +19,7 @@
|
||||
#ifndef GRUB_TYPES_CPU_HEADER
|
||||
#define GRUB_TYPES_CPU_HEADER 1
|
||||
|
||||
-#ifdef __powerpc64le__
|
||||
+#ifdef __powerpc64__
|
||||
/* The size of void *. */
|
||||
#define GRUB_TARGET_SIZEOF_VOID_P 8
|
||||
|
||||
@@ -33,8 +33,12 @@
|
||||
#define GRUB_TARGET_SIZEOF_LONG 4
|
||||
#endif
|
||||
|
||||
-/* powerpc is big-endian. */
|
||||
-#define GRUB_TARGET_WORDS_BIGENDIAN 1
|
||||
+#ifdef __powerpc64le__
|
||||
+#undef GRUB_TARGET_WORDS_BIGENDIAN
|
||||
+#else
|
||||
+#define GRUB_TARGET_WORDS_BIGENDIAN 1
|
||||
+#endif
|
||||
+
|
||||
|
||||
|
||||
#endif /* ! GRUB_TYPES_CPU_HEADER */
|
||||
--
|
||||
1.8.3.1
|
@ -0,0 +1,42 @@
|
||||
From 65dc046ba1f73ae2454ed6495145d645ad452596 Mon Sep 17 00:00:00 2001
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
Date: Wed, 29 Jan 2014 10:38:28 +1100
|
||||
Subject: [PATCH 11/23] Fix warnings when building powerpc linux loader 64bit
|
||||
|
||||
Fix warnings when building powerpc linux loader 64bit
|
||||
|
||||
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
---
|
||||
grub-core/loader/powerpc/ieee1275/linux.c | 9 +++++----
|
||||
1 file changed, 5 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/grub-core/loader/powerpc/ieee1275/linux.c b/grub-core/loader/powerpc/ieee1275/linux.c
|
||||
index 4a14f66..9dde053 100644
|
||||
--- a/grub-core/loader/powerpc/ieee1275/linux.c
|
||||
+++ b/grub-core/loader/powerpc/ieee1275/linux.c
|
||||
@@ -141,9 +141,9 @@ grub_linux_boot (void)
|
||||
grub_ieee1275_set_property (grub_ieee1275_chosen, "bootargs", linux_args,
|
||||
grub_strlen (linux_args) + 1, &actual);
|
||||
|
||||
- grub_dprintf ("loader", "Entry point: 0x%x\n", linux_entry);
|
||||
- grub_dprintf ("loader", "Initrd at: 0x%x, size 0x%x\n", initrd_addr,
|
||||
- initrd_size);
|
||||
+ grub_dprintf ("loader", "Entry point: 0x%lx\n", (unsigned long)linux_entry);
|
||||
+ grub_dprintf ("loader", "Initrd at: 0x%lx, size 0x%lx\n",
|
||||
+ (unsigned long)initrd_addr, (unsigned long)initrd_size);
|
||||
grub_dprintf ("loader", "Boot arguments: %s\n", linux_args);
|
||||
grub_dprintf ("loader", "Jumping to Linux...\n");
|
||||
|
||||
@@ -360,7 +360,8 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
||||
if (addr == (grub_addr_t) -1)
|
||||
goto fail;
|
||||
|
||||
- grub_dprintf ("loader", "Loading initrd at 0x%x, size 0x%x\n", addr, size);
|
||||
+ grub_dprintf ("loader", "Loading initrd at 0x%lx, size 0x%lx\n",
|
||||
+ (unsigned long)addr, (unsigned long)size);
|
||||
|
||||
if (grub_initrd_load (&initrd_ctx, argv, (void *) addr))
|
||||
goto fail;
|
||||
--
|
||||
1.8.3.1
|
@ -0,0 +1,45 @@
|
||||
From b94389e81084af714c6e6ad71d50e64174018c39 Mon Sep 17 00:00:00 2001
|
||||
From: Ram Pai <linuxram@us.ibm.com>
|
||||
Date: Tue, 25 Feb 2014 01:35:51 +0000
|
||||
Subject: [PATCH 12/23] GRUB_ELF_R_PPC_* processing fix
|
||||
|
||||
GRUB_ELF_R_PPC_* processing is applicable only for 32
|
||||
bit bootloader.
|
||||
|
||||
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
|
||||
---
|
||||
grub-core/kern/powerpc/dl.c | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/grub-core/kern/powerpc/dl.c b/grub-core/kern/powerpc/dl.c
|
||||
index 3a7fa3e..7677e5a 100644
|
||||
--- a/grub-core/kern/powerpc/dl.c
|
||||
+++ b/grub-core/kern/powerpc/dl.c
|
||||
@@ -94,6 +94,7 @@ grub_err_t
|
||||
grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
|
||||
Elf_Shdr *s, grub_dl_segment_t seg)
|
||||
{
|
||||
+#ifdef powerpc
|
||||
Elf_Rela *rel, *max;
|
||||
|
||||
for (rel = (Elf_Rela *) ((char *) ehdr + s->sh_offset),
|
||||
@@ -155,7 +156,6 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
|
||||
case GRUB_ELF_R_PPC_REL32:
|
||||
*addr = value - (Elf_Word) addr;
|
||||
break;
|
||||
-
|
||||
default:
|
||||
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
|
||||
N_("relocation 0x%x is not implemented yet"),
|
||||
@@ -164,4 +164,9 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
|
||||
}
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
+#else
|
||||
+ return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
|
||||
+ N_("relocation is not implemented yet for module=%llx ehdr=%llx Elf_Shdr=%llx seg=%llx"),
|
||||
+ mod, ehdr, s, seg);
|
||||
+#endif
|
||||
}
|
||||
--
|
||||
1.8.3.1
|
134
grub2-ppc64le-13-Fix-powerpc-setjmp-longjmp-64bit-issues.patch
Normal file
134
grub2-ppc64le-13-Fix-powerpc-setjmp-longjmp-64bit-issues.patch
Normal file
@ -0,0 +1,134 @@
|
||||
From 653e20ad39923aace0117fb7b51df27784587652 Mon Sep 17 00:00:00 2001
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
Date: Wed, 29 Jan 2014 10:39:32 +1100
|
||||
Subject: [PATCH 13/23] Fix powerpc setjmp/longjmp 64bit issues
|
||||
|
||||
Fix powerpc setjmp/longjmp 64bit issues
|
||||
|
||||
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
---
|
||||
grub-core/lib/powerpc/setjmp.S | 94 +++++++++++++++++++++++-------------------
|
||||
1 file changed, 52 insertions(+), 42 deletions(-)
|
||||
|
||||
diff --git a/grub-core/lib/powerpc/setjmp.S b/grub-core/lib/powerpc/setjmp.S
|
||||
index 716b563..51fcae9 100644
|
||||
--- a/grub-core/lib/powerpc/setjmp.S
|
||||
+++ b/grub-core/lib/powerpc/setjmp.S
|
||||
@@ -25,33 +25,43 @@ GRUB_MOD_LICENSE "GPLv3+"
|
||||
|
||||
.text
|
||||
|
||||
+#if defined( __powerpc64__ ) || defined( __powerpc64le__ )
|
||||
+#define LOAD ld
|
||||
+#define STORE std
|
||||
+#define SZ_LONG 8
|
||||
+#else
|
||||
+#define LOAD lwz
|
||||
+#define STORE stw
|
||||
+#define SZ_LONG 4
|
||||
+#endif
|
||||
+
|
||||
/*
|
||||
* int grub_setjmp (grub_jmp_buf env)
|
||||
*/
|
||||
FUNCTION(grub_setjmp)
|
||||
- stw 1, 0(3)
|
||||
- stw 14, 4(3)
|
||||
- stw 15, 8(3)
|
||||
- stw 16, 12(3)
|
||||
- stw 17, 16(3)
|
||||
- stw 18, 20(3)
|
||||
- stw 19, 24(3)
|
||||
- stw 20, 28(3)
|
||||
- stw 21, 32(3)
|
||||
- stw 22, 36(3)
|
||||
- stw 23, 40(3)
|
||||
- stw 24, 44(3)
|
||||
- stw 25, 48(3)
|
||||
- stw 26, 52(3)
|
||||
- stw 27, 56(3)
|
||||
- stw 28, 60(3)
|
||||
- stw 29, 64(3)
|
||||
- stw 30, 68(3)
|
||||
- stw 31, 72(3)
|
||||
+ STORE 1, 0(3)
|
||||
+ STORE 14, 1*SZ_LONG(3)
|
||||
+ STORE 15, 2*SZ_LONG(3)
|
||||
+ STORE 16, 3*SZ_LONG(3)
|
||||
+ STORE 17, 4*SZ_LONG(3)
|
||||
+ STORE 18, 5*SZ_LONG(3)
|
||||
+ STORE 19, 6*SZ_LONG(3)
|
||||
+ STORE 20, 7*SZ_LONG(3)
|
||||
+ STORE 21, 8*SZ_LONG(3)
|
||||
+ STORE 22, 9*SZ_LONG(3)
|
||||
+ STORE 23, 10*SZ_LONG(3)
|
||||
+ STORE 24, 11*SZ_LONG(3)
|
||||
+ STORE 25, 12*SZ_LONG(3)
|
||||
+ STORE 26, 13*SZ_LONG(3)
|
||||
+ STORE 27, 14*SZ_LONG(3)
|
||||
+ STORE 28, 15*SZ_LONG(3)
|
||||
+ STORE 29, 16*SZ_LONG(3)
|
||||
+ STORE 30, 17*SZ_LONG(3)
|
||||
+ STORE 31, 18*SZ_LONG(3)
|
||||
mflr 4
|
||||
- stw 4, 76(3)
|
||||
+ STORE 4, 19*SZ_LONG(3)
|
||||
mfcr 4
|
||||
- stw 4, 80(3)
|
||||
+ STORE 4, 20*SZ_LONG(3)
|
||||
li 3, 0
|
||||
blr
|
||||
|
||||
@@ -59,28 +69,28 @@ FUNCTION(grub_setjmp)
|
||||
* int grub_longjmp (grub_jmp_buf env, int val)
|
||||
*/
|
||||
FUNCTION(grub_longjmp)
|
||||
- lwz 1, 0(3)
|
||||
- lwz 14, 4(3)
|
||||
- lwz 15, 8(3)
|
||||
- lwz 16, 12(3)
|
||||
- lwz 17, 16(3)
|
||||
- lwz 18, 20(3)
|
||||
- lwz 19, 24(3)
|
||||
- lwz 20, 28(3)
|
||||
- lwz 21, 32(3)
|
||||
- lwz 22, 36(3)
|
||||
- lwz 23, 40(3)
|
||||
- lwz 24, 44(3)
|
||||
- lwz 25, 48(3)
|
||||
- lwz 26, 52(3)
|
||||
- lwz 27, 56(3)
|
||||
- lwz 28, 60(3)
|
||||
- lwz 29, 64(3)
|
||||
- lwz 30, 68(3)
|
||||
- lwz 31, 72(3)
|
||||
- lwz 5, 76(3)
|
||||
+ LOAD 1, 0(3)
|
||||
+ LOAD 14, 1*SZ_LONG(3)
|
||||
+ LOAD 15, 2*SZ_LONG(3)
|
||||
+ LOAD 16, 3*SZ_LONG(3)
|
||||
+ LOAD 17, 4*SZ_LONG(3)
|
||||
+ LOAD 18, 5*SZ_LONG(3)
|
||||
+ LOAD 19, 6*SZ_LONG(3)
|
||||
+ LOAD 20, 7*SZ_LONG(3)
|
||||
+ LOAD 21, 8*SZ_LONG(3)
|
||||
+ LOAD 22, 9*SZ_LONG(3)
|
||||
+ LOAD 23, 10*SZ_LONG(3)
|
||||
+ LOAD 24, 11*SZ_LONG(3)
|
||||
+ LOAD 25, 12*SZ_LONG(3)
|
||||
+ LOAD 26, 13*SZ_LONG(3)
|
||||
+ LOAD 27, 14*SZ_LONG(3)
|
||||
+ LOAD 28, 15*SZ_LONG(3)
|
||||
+ LOAD 29, 16*SZ_LONG(3)
|
||||
+ LOAD 30, 17*SZ_LONG(3)
|
||||
+ LOAD 31, 18*SZ_LONG(3)
|
||||
+ LOAD 5, 19*SZ_LONG(3)
|
||||
mtlr 5
|
||||
- lwz 5, 80(3)
|
||||
+ LOAD 5, 20*SZ_LONG(3)
|
||||
mtcr 5
|
||||
mr. 3, 4
|
||||
bne 1f
|
||||
--
|
||||
1.8.3.1
|
201
grub2-ppc64le-14-Add-powerpc64-ieee1275-trampoline.patch
Normal file
201
grub2-ppc64le-14-Add-powerpc64-ieee1275-trampoline.patch
Normal file
@ -0,0 +1,201 @@
|
||||
From dc0b31e8fe09b4143488e85a7aeb7c532e48f81d Mon Sep 17 00:00:00 2001
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
Date: Wed, 29 Jan 2014 10:40:17 +1100
|
||||
Subject: [PATCH 14/23] Add powerpc64 ieee1275 trampoline
|
||||
|
||||
Add a trampoline so a 64bit grub can call a 32 bit OF
|
||||
|
||||
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
---
|
||||
grub-core/Makefile.core.def | 1 +
|
||||
grub-core/kern/powerpc/ieee1275/entry.S | 150 +++++++++++++++++++++++++++++++
|
||||
include/grub/powerpc/ieee1275/ieee1275.h | 6 ++
|
||||
3 files changed, 157 insertions(+)
|
||||
create mode 100644 grub-core/kern/powerpc/ieee1275/entry.S
|
||||
|
||||
diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
|
||||
index 42443bc..9563eeb 100644
|
||||
--- a/grub-core/Makefile.core.def
|
||||
+++ b/grub-core/Makefile.core.def
|
||||
@@ -252,6 +252,7 @@ kernel = {
|
||||
|
||||
powerpc_ieee1275 = kern/powerpc/cache.S;
|
||||
powerpc_ieee1275 = kern/powerpc/dl.c;
|
||||
+ powerpc_ieee1275 = kern/powerpc/ieee1275/entry.S;
|
||||
|
||||
sparc64_ieee1275 = kern/sparc64/cache.S;
|
||||
sparc64_ieee1275 = kern/sparc64/dl.c;
|
||||
diff --git a/grub-core/kern/powerpc/ieee1275/entry.S b/grub-core/kern/powerpc/ieee1275/entry.S
|
||||
new file mode 100644
|
||||
index 0000000..5d58149
|
||||
--- /dev/null
|
||||
+++ b/grub-core/kern/powerpc/ieee1275/entry.S
|
||||
@@ -0,0 +1,150 @@
|
||||
+/* entry.S - open firmware call entry and return */
|
||||
+/*
|
||||
+ * GRUB -- GRand Unified Bootloader
|
||||
+ * Copyright (C) 2004,2007,2010,2014 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/>.
|
||||
+ */
|
||||
+
|
||||
+#include <ppc-asm.h>
|
||||
+
|
||||
+#define STACK_FRAME_SIZE (48 + 64 + 16 + 144)
|
||||
+#define MSR_OFFSET (48 + 64)
|
||||
+#define R13_OFFSET (MSR_OFFSET + 8)
|
||||
+#define NVREG_OFFSET(i) (STACK_FRAME_SIZE - (32-(i))*8)
|
||||
+#define SAVE_NVGPR(A) std (A),NVREG_OFFSET(A)(r1)
|
||||
+#define REST_NVGPR(A) ld (A),NVREG_OFFSET(A)(r1)
|
||||
+#define SPRN_SRR0 0x01A
|
||||
+#define SPRN_SRR1 0x01B
|
||||
+#define r1 sp
|
||||
+
|
||||
+
|
||||
+#if defined(_CALL_ELF) && _CALL_ELF == 1 /* BIG ENDIAN */
|
||||
+#define TOC_OFFSET 40
|
||||
+#define r2 toc
|
||||
+#endif
|
||||
+
|
||||
+/*
|
||||
+ * OF runs in 32 bit mode so it clobbers the high 32 bits of all registers
|
||||
+ * it saves. We save and restore all the non volatile registers to avoid
|
||||
+ * this issue.
|
||||
+ *
|
||||
+ * unsigned int ieee1275_call_entry_fn(void *args, unsigned long entry);
|
||||
+ */
|
||||
+FUNC_START(ieee1275_call_entry_fn)
|
||||
+ mflr r0
|
||||
+ std r0,16(r1)
|
||||
+ stdu r1,-STACK_FRAME_SIZE(r1)
|
||||
+
|
||||
+#if defined(_CALL_ELF) && _CALL_ELF == 1 /* BIG ENDIAN */
|
||||
+ std r2,TOC_OFFSET(r1)
|
||||
+#endif
|
||||
+ std r13,R13_OFFSET(r1)
|
||||
+
|
||||
+ SAVE_NVGPR(r14)
|
||||
+ SAVE_NVGPR(r15)
|
||||
+ SAVE_NVGPR(r16)
|
||||
+ SAVE_NVGPR(r17)
|
||||
+ SAVE_NVGPR(r18)
|
||||
+ SAVE_NVGPR(r19)
|
||||
+ SAVE_NVGPR(r20)
|
||||
+ SAVE_NVGPR(r21)
|
||||
+ SAVE_NVGPR(r22)
|
||||
+ SAVE_NVGPR(r23)
|
||||
+ SAVE_NVGPR(r24)
|
||||
+ SAVE_NVGPR(r25)
|
||||
+ SAVE_NVGPR(r26)
|
||||
+ SAVE_NVGPR(r27)
|
||||
+ SAVE_NVGPR(r28)
|
||||
+ SAVE_NVGPR(r29)
|
||||
+ SAVE_NVGPR(r30)
|
||||
+ SAVE_NVGPR(r31)
|
||||
+
|
||||
+ mfmsr r31
|
||||
+ std r31, MSR_OFFSET(r1)
|
||||
+
|
||||
+ /* Clear 64bit mode */
|
||||
+ rldicl r31,r31,0,1
|
||||
+
|
||||
+#if defined(_CALL_ELF) && _CALL_ELF == 2 /* LITTLE ENDIAN */
|
||||
+ /* Clear LE mode */
|
||||
+ rldicr r31,r31,0,62
|
||||
+#endif
|
||||
+
|
||||
+ mtspr SPRN_SRR0,r4
|
||||
+ mtspr SPRN_SRR1,r31
|
||||
+
|
||||
+ /* Point the LR at our return code */
|
||||
+ bl 1f
|
||||
+1: mflr r30
|
||||
+ addi r30,r30,(2f - 1b)
|
||||
+ mtlr r30
|
||||
+
|
||||
+ /* Call OF */
|
||||
+ rfid
|
||||
+
|
||||
+#if defined(_CALL_ELF) && _CALL_ELF == 2 /* LITTLE ENDIAN */
|
||||
+2: .long 0x05009f42 /* bcl 20,31,$+4 */
|
||||
+ .long 0xa602487d /* mflr r10 */
|
||||
+ .long 0x1c004a39 /* addi r10,r10,28 */
|
||||
+ .long 0xa6035a7d /* mtsrr0 r10 */
|
||||
+ .long 0xa600407d /* mfmsr r10 */
|
||||
+ .long 0x01004a69 /* xori r10,r10,1 */
|
||||
+ .long 0xa6035b7d /* mtsrr1 r10 */
|
||||
+ .long 0x2400004c /* rfid */
|
||||
+#endif
|
||||
+
|
||||
+ /* Clear the top 32 bits of r1, just in case */
|
||||
+2: rldicl r1,r1,0,32
|
||||
+
|
||||
+ /* Reset our MSR */
|
||||
+ ld r31,MSR_OFFSET(r1)
|
||||
+ mtspr SPRN_SRR1,r31
|
||||
+
|
||||
+ bl 3f
|
||||
+3: mflr r30
|
||||
+ addi r30,r30,(4f - 3b)
|
||||
+ mtspr SPRN_SRR0,r30
|
||||
+
|
||||
+ rfid
|
||||
+
|
||||
+#if defined(_CALL_ELF) && _CALL_ELF == 1 /* BIG ENDIAN */
|
||||
+4: ld r2,TOC_OFFSET(r1)
|
||||
+#endif
|
||||
+4: ld r13,R13_OFFSET(r1)
|
||||
+
|
||||
+ REST_NVGPR(r14)
|
||||
+ REST_NVGPR(r15)
|
||||
+ REST_NVGPR(r16)
|
||||
+ REST_NVGPR(r17)
|
||||
+ REST_NVGPR(r18)
|
||||
+ REST_NVGPR(r19)
|
||||
+ REST_NVGPR(r20)
|
||||
+ REST_NVGPR(r21)
|
||||
+ REST_NVGPR(r22)
|
||||
+ REST_NVGPR(r23)
|
||||
+ REST_NVGPR(r24)
|
||||
+ REST_NVGPR(r25)
|
||||
+ REST_NVGPR(r26)
|
||||
+ REST_NVGPR(r27)
|
||||
+ REST_NVGPR(r28)
|
||||
+ REST_NVGPR(r29)
|
||||
+ REST_NVGPR(r30)
|
||||
+ REST_NVGPR(r31)
|
||||
+
|
||||
+ addi r1,r1,STACK_FRAME_SIZE
|
||||
+ ld r0,16(r1)
|
||||
+ mtlr r0
|
||||
+ blr
|
||||
+FUNC_END(ieee1275_call_entry_fn)
|
||||
diff --git a/include/grub/powerpc/ieee1275/ieee1275.h b/include/grub/powerpc/ieee1275/ieee1275.h
|
||||
index 3c7683f..14bdc43 100644
|
||||
--- a/include/grub/powerpc/ieee1275/ieee1275.h
|
||||
+++ b/include/grub/powerpc/ieee1275/ieee1275.h
|
||||
@@ -25,4 +25,10 @@
|
||||
#define GRUB_IEEE1275_CELL_SIZEOF 4
|
||||
typedef grub_uint32_t grub_ieee1275_cell_t;
|
||||
|
||||
+#ifdef __powerpc64__
|
||||
+int EXPORT_FUNC(ieee1275_call_entry_fn)(void *args, void *entry);
|
||||
+#define IEEE1275_CALL_ENTRY_FN(args) \
|
||||
+ ieee1275_call_entry_fn((args), grub_ieee1275_entry_fn)
|
||||
+#endif
|
||||
+
|
||||
#endif /* ! GRUB_IEEE1275_MACHINE_HEADER */
|
||||
--
|
||||
1.8.3.1
|
@ -0,0 +1,72 @@
|
||||
From 303109b36a45f53400cbcdaf2ad90ca5790ce1d6 Mon Sep 17 00:00:00 2001
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
Date: Wed, 29 Jan 2014 10:41:29 +1100
|
||||
Subject: [PATCH 15/23] Add 64bit support to powerpc startup code
|
||||
|
||||
Add 64bit support to powerpc startup code
|
||||
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
|
||||
---
|
||||
grub-core/kern/powerpc/ieee1275/startup.S | 33 +++++++++++++++++++++++++++----
|
||||
1 file changed, 29 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/grub-core/kern/powerpc/ieee1275/startup.S b/grub-core/kern/powerpc/ieee1275/startup.S
|
||||
index 21c884b..03f80d8 100644
|
||||
--- a/grub-core/kern/powerpc/ieee1275/startup.S
|
||||
+++ b/grub-core/kern/powerpc/ieee1275/startup.S
|
||||
@@ -19,15 +19,28 @@
|
||||
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/offsets.h>
|
||||
+#include <ppc-asm.h>
|
||||
|
||||
.extern __bss_start
|
||||
.extern _end
|
||||
|
||||
.text
|
||||
- .align 2
|
||||
- .globl start, _start
|
||||
-start:
|
||||
-_start:
|
||||
+
|
||||
+FUNC_START(_start)
|
||||
+
|
||||
+#if defined(_CALL_ELF) && _CALL_ELF == 2 /* LITTLE ENDIAN */
|
||||
+ tdi 0,0,0x48 /* Reverse endian of b . + 8 */
|
||||
+ b $+36 /* Skip trampoline if already LE mode */
|
||||
+ .long 0x05009f42 /* bcl 20,31,$+4 */
|
||||
+ .long 0xa602487d /* mflr r10 */
|
||||
+ .long 0x1c004a39 /* addi r10,r10,28 */
|
||||
+ .long 0xa600607d /* mfmsr r11 */
|
||||
+ .long 0x01006b69 /* xori r11,r11,1 */
|
||||
+ .long 0xa6035a7d /* mtsrr0 r10 */
|
||||
+ .long 0xa6037b7d /* mtsrr1 r11 */
|
||||
+ .long 0x2400004c /* rfid */
|
||||
+#endif
|
||||
+
|
||||
li 2, 0
|
||||
li 13, 0
|
||||
|
||||
@@ -61,7 +74,19 @@ _start:
|
||||
|
||||
/* Store r5 in grub_ieee1275_entry_fn. */
|
||||
lis 9, grub_ieee1275_entry_fn@ha
|
||||
+#if defined(_CALL_ELF) && _CALL_ELF == 1 /* BIG ENDIAN */
|
||||
+ std 5, grub_ieee1275_entry_fn@l(9)
|
||||
+#else
|
||||
stw 5, grub_ieee1275_entry_fn@l(9)
|
||||
+#endif
|
||||
+
|
||||
+#if defined(_CALL_ELF) && _CALL_ELF == 2 /* LITTLE ENDIAN */
|
||||
+ bl 3f
|
||||
+3: mflr 9
|
||||
+ addis 2,9,.TOC.-3b@ha
|
||||
+ addi 2,2,.TOC.-3b@l
|
||||
+#endif
|
||||
|
||||
bl grub_main
|
||||
1: b 1b
|
||||
+FUNC_END(_start)
|
||||
--
|
||||
1.8.3.1
|
77
grub2-ppc64le-16-Add-grub_dl_find_section_addr.patch
Normal file
77
grub2-ppc64le-16-Add-grub_dl_find_section_addr.patch
Normal file
@ -0,0 +1,77 @@
|
||||
From ca7d011e65c6dc1b633c85b7105c807b929598f1 Mon Sep 17 00:00:00 2001
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
Date: Wed, 29 Jan 2014 10:42:12 +1100
|
||||
Subject: [PATCH 16/23] Add grub_dl_find_section_addr
|
||||
|
||||
ppc64 needs to find the address of the toc section.
|
||||
Create grub_dl_find_section_addr to do this.
|
||||
|
||||
We also need grub_dl_find_section, so make it global.
|
||||
|
||||
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
---
|
||||
grub-core/kern/dl.c | 27 ++++++++++++++++++++++++++-
|
||||
include/grub/dl.h | 2 ++
|
||||
2 files changed, 28 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c
|
||||
index 6850e04..de2d0ed 100644
|
||||
--- a/grub-core/kern/dl.c
|
||||
+++ b/grub-core/kern/dl.c
|
||||
@@ -191,6 +191,31 @@ grub_dl_get_section_addr (grub_dl_t mod, unsigned n)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+void *grub_dl_find_section_addr (grub_dl_t mod, Elf_Ehdr *e, const char *name)
|
||||
+{
|
||||
+ Elf_Shdr *s;
|
||||
+ const char *str;
|
||||
+ unsigned i;
|
||||
+ grub_dl_segment_t seg;
|
||||
+
|
||||
+ s = (Elf_Shdr *) ((char *) e + e->e_shoff + e->e_shstrndx * e->e_shentsize);
|
||||
+ str = (char *) e + s->sh_offset;
|
||||
+
|
||||
+ for (i = 0, s = (Elf_Shdr *) ((char *) e + e->e_shoff);
|
||||
+ i < e->e_shnum;
|
||||
+ i++, s = (Elf_Shdr *) ((char *) s + e->e_shentsize))
|
||||
+ {
|
||||
+ if (grub_strcmp (str + s->sh_name, name) == 0)
|
||||
+ {
|
||||
+ for (seg = mod->segment; seg; seg = seg->next)
|
||||
+ if (seg->section == i)
|
||||
+ return seg->addr;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
/* Check if EHDR is a valid ELF header. */
|
||||
static grub_err_t
|
||||
grub_dl_check_header (void *ehdr, grub_size_t size)
|
||||
@@ -427,7 +452,7 @@ grub_dl_resolve_symbols (grub_dl_t mod, Elf_Ehdr *e)
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
-static Elf_Shdr *
|
||||
+Elf_Shdr *
|
||||
grub_dl_find_section (Elf_Ehdr *e, const char *name)
|
||||
{
|
||||
Elf_Shdr *s;
|
||||
diff --git a/include/grub/dl.h b/include/grub/dl.h
|
||||
index 9562fa6..39c73a7 100644
|
||||
--- a/include/grub/dl.h
|
||||
+++ b/include/grub/dl.h
|
||||
@@ -250,6 +250,8 @@ grub_err_t grub_arch_dl_check_header (void *ehdr);
|
||||
grub_err_t
|
||||
grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
|
||||
Elf_Shdr *s, grub_dl_segment_t seg);
|
||||
+Elf_Shdr * grub_dl_find_section (Elf_Ehdr *e, const char *name);
|
||||
+void *grub_dl_find_section_addr (grub_dl_t mod, Elf_Ehdr *e, const char *name);
|
||||
#endif
|
||||
|
||||
#if defined (_mips)
|
||||
--
|
||||
1.8.3.1
|
310
grub2-ppc64le-17-Add-ppc64-relocations.patch
Normal file
310
grub2-ppc64le-17-Add-ppc64-relocations.patch
Normal file
@ -0,0 +1,310 @@
|
||||
From 96d6b8d370e653386982b808f10a2a67849f73f1 Mon Sep 17 00:00:00 2001
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
Date: Wed, 29 Jan 2014 10:44:46 +1100
|
||||
Subject: [PATCH 17/23] Add ppc64 relocations
|
||||
|
||||
Add ppc64 relocations
|
||||
|
||||
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
---
|
||||
grub-core/kern/powerpc/dl.c | 185 ++++++++++++++++++++++++++++++++++++++++----
|
||||
include/grub/elf.h | 3 +
|
||||
2 files changed, 174 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/grub-core/kern/powerpc/dl.c b/grub-core/kern/powerpc/dl.c
|
||||
index 7677e5a..cc496d3 100644
|
||||
--- a/grub-core/kern/powerpc/dl.c
|
||||
+++ b/grub-core/kern/powerpc/dl.c
|
||||
@@ -23,6 +23,20 @@
|
||||
#include <grub/err.h>
|
||||
#include <grub/i18n.h>
|
||||
|
||||
+#if defined( __powerpc64__ ) || defined( __powerpc64le__ )
|
||||
+#define ELFCLASSXX ELFCLASS64
|
||||
+#define ELFMACHINEXX EM_PPC64
|
||||
+#else
|
||||
+#define ELFCLASSXX ELFCLASS32
|
||||
+#define ELFMACHINEXX EM_PPC
|
||||
+#endif
|
||||
+
|
||||
+#if defined( __powerpc64le__ )
|
||||
+#define ELFDATA2XSB ELFDATA2LSB
|
||||
+#else
|
||||
+#define ELFDATA2XSB ELFDATA2MSB
|
||||
+#endif
|
||||
+
|
||||
/* Check if EHDR is a valid ELF header. */
|
||||
grub_err_t
|
||||
grub_arch_dl_check_header (void *ehdr)
|
||||
@@ -30,14 +44,86 @@ grub_arch_dl_check_header (void *ehdr)
|
||||
Elf_Ehdr *e = ehdr;
|
||||
|
||||
/* Check the magic numbers. */
|
||||
- if (e->e_ident[EI_CLASS] != ELFCLASS32
|
||||
- || e->e_ident[EI_DATA] != ELFDATA2MSB
|
||||
- || e->e_machine != EM_PPC)
|
||||
+ if (e->e_ident[EI_CLASS] != ELFCLASSXX
|
||||
+ || e->e_ident[EI_DATA] != ELFDATA2XSB
|
||||
+ || e->e_machine != ELFMACHINEXX)
|
||||
return grub_error (GRUB_ERR_BAD_OS, N_("invalid arch-dependent ELF magic"));
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
+
|
||||
+
|
||||
+
|
||||
+#if defined( __powerpc64le__ )
|
||||
+struct trampoline
|
||||
+{
|
||||
+ grub_uint32_t std;
|
||||
+ grub_uint32_t addis;
|
||||
+ grub_uint32_t addi;
|
||||
+ grub_uint32_t mtctr;
|
||||
+ grub_uint32_t bctr;
|
||||
+};
|
||||
+
|
||||
+static const struct trampoline trampoline_template =
|
||||
+ {
|
||||
+ 0xf8410018, /* std r2,24(r1) */
|
||||
+ 0x3d800000, /* addis r12,0,0 */
|
||||
+ 0x398c0000, /* addi r12,r12,0 */
|
||||
+ 0x7d8903a6, /* mtctr r12 */
|
||||
+ 0x4e800420, /* bctr */
|
||||
+ };
|
||||
+
|
||||
+#define PPC_NOP 0x60000000
|
||||
+#define RESTORE_TOC 0xe8410018 /* ld r2,24(r1) */
|
||||
+
|
||||
+#define STO_PPC64_LOCAL_BIT 5
|
||||
+#define STO_PPC64_LOCAL_MASK (7 << STO_PPC64_LOCAL_BIT)
|
||||
+
|
||||
+static unsigned long grub_arch_dl_get_toc (grub_dl_t mod, void *ehdr)
|
||||
+{
|
||||
+ unsigned long i = (unsigned long)grub_dl_find_section_addr(mod, ehdr, ".toc");
|
||||
+ if (!i)
|
||||
+ return 0;
|
||||
+
|
||||
+ return i;
|
||||
+}
|
||||
+
|
||||
+static inline unsigned int
|
||||
+ppc64_decode_local_entry(unsigned int other)
|
||||
+{
|
||||
+ return ((1 << other) >> 2) << 2;
|
||||
+}
|
||||
+
|
||||
+#define PPC64_LOCAL_ENTRY_OFFSET(other) \
|
||||
+ ppc64_decode_local_entry (((other) & STO_PPC64_LOCAL_MASK) \
|
||||
+ >> STO_PPC64_LOCAL_BIT)
|
||||
+
|
||||
+
|
||||
+
|
||||
+#elif defined( __powerpc64__ )
|
||||
+
|
||||
+#error "NOT IMPLEMENTED YET"
|
||||
+
|
||||
+static int grub_arch_dl_is_in_opd (grub_dl_t mod, void *ehdr, unsigned long addr)
|
||||
+{
|
||||
+ unsigned long start, end;
|
||||
+ Elf_Shdr *s = grub_dl_find_section(ehdr, ".opd");
|
||||
+
|
||||
+ if (!s)
|
||||
+ return 0;
|
||||
+
|
||||
+ start = (unsigned long)grub_dl_find_section_addr(mod, ehdr, ".opd");
|
||||
+ end = start + s->sh_size;
|
||||
+
|
||||
+ if ((start <= addr) && (addr < end))
|
||||
+ return 1;
|
||||
+ else
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+#else
|
||||
+
|
||||
/* For low-endian reverse lis and addr_high as well as ori and addr_low. */
|
||||
struct trampoline
|
||||
{
|
||||
@@ -47,7 +133,7 @@ struct trampoline
|
||||
grub_uint32_t bctr;
|
||||
};
|
||||
|
||||
-static const struct trampoline trampoline_template =
|
||||
+static const struct trampoline trampoline_template =
|
||||
{
|
||||
0x3d800000,
|
||||
0x618c0000,
|
||||
@@ -55,6 +141,8 @@ static const struct trampoline trampoline_template =
|
||||
0x4e800420,
|
||||
};
|
||||
|
||||
+#endif
|
||||
+
|
||||
#pragma GCC diagnostic ignored "-Wcast-align"
|
||||
|
||||
grub_err_t
|
||||
@@ -74,14 +162,13 @@ grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
|
||||
if (s->sh_type == SHT_RELA)
|
||||
{
|
||||
const Elf_Rela *rel, *max;
|
||||
-
|
||||
+
|
||||
for (rel = (const Elf_Rela *) ((const char *) e + s->sh_offset),
|
||||
max = rel + s->sh_size / s->sh_entsize;
|
||||
rel < max;
|
||||
rel++)
|
||||
if (ELF_R_TYPE (rel->r_info) == GRUB_ELF_R_PPC_REL24)
|
||||
(*tramp)++;
|
||||
-
|
||||
}
|
||||
|
||||
*tramp *= sizeof (struct trampoline);
|
||||
@@ -89,12 +176,15 @@ grub_arch_dl_get_tramp_got_size (const void *ehdr, grub_size_t *tramp,
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
+#define PPC_LO(v) ((v) & 0xffff)
|
||||
+#define PPC_HI(v) (((v) >> 16) & 0xffff)
|
||||
+#define PPC_HA(v) PPC_HI ((v) + 0x8000)
|
||||
+
|
||||
/* Relocate symbols. */
|
||||
grub_err_t
|
||||
grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
|
||||
Elf_Shdr *s, grub_dl_segment_t seg)
|
||||
{
|
||||
-#ifdef powerpc
|
||||
Elf_Rela *rel, *max;
|
||||
|
||||
for (rel = (Elf_Rela *) ((char *) ehdr + s->sh_offset),
|
||||
@@ -104,7 +194,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
|
||||
{
|
||||
Elf_Word *addr;
|
||||
Elf_Sym *sym;
|
||||
- grub_uint32_t value;
|
||||
+ Elf_Addr value;
|
||||
|
||||
if (seg->size < rel->r_offset)
|
||||
return grub_error (GRUB_ERR_BAD_MODULE,
|
||||
@@ -119,6 +209,76 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
|
||||
value = sym->st_value + rel->r_addend;
|
||||
switch (ELF_R_TYPE (rel->r_info))
|
||||
{
|
||||
+#ifdef __powerpc64le__
|
||||
+ case GRUB_ELF_R_PPC_REL24:
|
||||
+ {
|
||||
+ struct trampoline *tptr = mod->trampptr;
|
||||
+ Elf_Sword delta;
|
||||
+ if (sym->st_shndx == SHN_UNDEF)
|
||||
+ {
|
||||
+ grub_memcpy (tptr, &trampoline_template, sizeof (*tptr));
|
||||
+
|
||||
+ tptr->addis |= PPC_HA(value);
|
||||
+ tptr->addi |= PPC_LO(value);
|
||||
+
|
||||
+ mod->trampptr = tptr + 1;
|
||||
+ delta = (grub_uint8_t *) tptr - (grub_uint8_t *) addr;
|
||||
+
|
||||
+ if (*(addr+1) != PPC_NOP)
|
||||
+ return grub_error (GRUB_ERR_BAD_MODULE,
|
||||
+ "Missing NOP after PPC_REL24 got %x", *(addr+1));
|
||||
+ *(addr+1) = RESTORE_TOC;
|
||||
+ } else
|
||||
+ delta = (grub_uint8_t *)value - (grub_uint8_t *) addr +
|
||||
+ PPC64_LOCAL_ENTRY_OFFSET(sym->st_other);
|
||||
+
|
||||
+
|
||||
+ if (delta << 6 >> 6 != delta)
|
||||
+ return grub_error (GRUB_ERR_BAD_MODULE,
|
||||
+ "relocation overflow");
|
||||
+
|
||||
+ *(Elf_Word *) (addr) = (*addr & ~0x03fffffc) | (delta & 0x03fffffc);
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ case GRUB_ELF_R_PPC64_ADDR64:
|
||||
+ *(Elf_Xword *) addr = value;
|
||||
+ break;
|
||||
+
|
||||
+ case GRUB_ELF_R_PPC64_TOC:
|
||||
+ *(Elf_Xword *) addr = grub_arch_dl_get_toc(mod, ehdr);
|
||||
+ break;
|
||||
+
|
||||
+ case GRUB_ELF_R_PPC64_TOC16_HA:
|
||||
+ value -= grub_arch_dl_get_toc(mod, ehdr);
|
||||
+ *(Elf_Half *) addr = PPC_HA(value);
|
||||
+ break;
|
||||
+
|
||||
+ case GRUB_ELF_R_PPC64_TOC16_LO:
|
||||
+ value -= grub_arch_dl_get_toc(mod, ehdr);
|
||||
+ *(Elf_Half *) addr = PPC_LO(value);
|
||||
+ break;
|
||||
+
|
||||
+ case GRUB_ELF_R_PPC64_TOC16_LO_DS:
|
||||
+ value -= grub_arch_dl_get_toc(mod, ehdr);
|
||||
+ if (value & 3)
|
||||
+ return grub_error (GRUB_ERR_BAD_MODULE,
|
||||
+ "bad TOC16_LO_DS relocation");
|
||||
+
|
||||
+ *(Elf_Half *) addr = ((*(Elf_Half *) addr) & ~0xfffc) | (value & 0xfffc);
|
||||
+ break;
|
||||
+
|
||||
+ case GRUB_ELF_R_PPC64_REL16_HA:
|
||||
+ value -= (unsigned long) addr;
|
||||
+ *(Elf_Half *) addr = PPC_HA(value);
|
||||
+ break;
|
||||
+
|
||||
+ case GRUB_ELF_R_PPC64_REL16_LO:
|
||||
+ value -= (unsigned long) addr;
|
||||
+ *(Elf_Half *) addr = PPC_LO(value);
|
||||
+ break;
|
||||
+#else
|
||||
+
|
||||
case GRUB_ELF_R_PPC_ADDR16_LO:
|
||||
*(Elf_Half *) addr = value;
|
||||
break;
|
||||
@@ -137,7 +297,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
|
||||
tptr->ori |= ((value) & 0xffff);
|
||||
mod->trampptr = tptr + 1;
|
||||
}
|
||||
-
|
||||
+
|
||||
if (delta << 6 >> 6 != delta)
|
||||
return grub_error (GRUB_ERR_BAD_MODULE,
|
||||
"relocation overflow");
|
||||
@@ -156,6 +316,8 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
|
||||
case GRUB_ELF_R_PPC_REL32:
|
||||
*addr = value - (Elf_Word) addr;
|
||||
break;
|
||||
+#endif
|
||||
+
|
||||
default:
|
||||
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
|
||||
N_("relocation 0x%x is not implemented yet"),
|
||||
@@ -164,9 +326,4 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
|
||||
}
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
-#else
|
||||
- return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
|
||||
- N_("relocation is not implemented yet for module=%llx ehdr=%llx Elf_Shdr=%llx seg=%llx"),
|
||||
- mod, ehdr, s, seg);
|
||||
-#endif
|
||||
}
|
||||
diff --git a/include/grub/elf.h b/include/grub/elf.h
|
||||
index bee7583..224d164 100644
|
||||
--- a/include/grub/elf.h
|
||||
+++ b/include/grub/elf.h
|
||||
@@ -1998,6 +1998,9 @@ typedef Elf32_Addr Elf32_Conflict;
|
||||
#define GRUB_ELF_R_PPC_DIAB_RELSDA_HI 184 /* like EMB_RELSDA, but high 16 bit */
|
||||
#define GRUB_ELF_R_PPC_DIAB_RELSDA_HA 185 /* like EMB_RELSDA, adjusted high 16 */
|
||||
|
||||
+#define GRUB_ELF_R_PPC64_REL16_LO 250
|
||||
+#define GRUB_ELF_R_PPC64_REL16_HA 252
|
||||
+
|
||||
/* This is a phony reloc to handle any old fashioned TOC16 references
|
||||
that may still be in object files. */
|
||||
#define GRUB_ELF_R_PPC_TOC16 255
|
||||
--
|
||||
1.8.3.1
|
28
grub2-ppc64le-18-ppc64-doesn-t-need-libgcc-routines.patch
Normal file
28
grub2-ppc64le-18-ppc64-doesn-t-need-libgcc-routines.patch
Normal file
@ -0,0 +1,28 @@
|
||||
From 8dc2290890dc8e1cf534b6e44ab44bab4d694da5 Mon Sep 17 00:00:00 2001
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
Date: Wed, 29 Jan 2014 10:49:12 +1100
|
||||
Subject: [PATCH 18/23] ppc64 doesn't need libgcc routines
|
||||
|
||||
ppc64 doesn't need libgcc routines
|
||||
|
||||
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
---
|
||||
include/grub/libgcc.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/grub/libgcc.h b/include/grub/libgcc.h
|
||||
index fdc6611..69a95bc 100644
|
||||
--- a/include/grub/libgcc.h
|
||||
+++ b/include/grub/libgcc.h
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <config-util.h>
|
||||
|
||||
/* On x86 these functions aren't really needed. Save some space. */
|
||||
-#if !defined (__i386__) && !defined (__x86_64__)
|
||||
+#if !defined (__i386__) && !defined (__x86_64__) && !defined (__powerpc64le__)
|
||||
# ifdef HAVE___ASHLDI3
|
||||
void EXPORT_FUNC (__ashldi3) (void);
|
||||
# endif
|
||||
--
|
||||
1.8.3.1
|
@ -0,0 +1,76 @@
|
||||
From d63aa12f89bfd5e0cc11983601323694e9a24be7 Mon Sep 17 00:00:00 2001
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
Date: Wed, 29 Jan 2014 10:52:28 +1100
|
||||
Subject: [PATCH 19/23] Use FUNC_START/FUNC_END
|
||||
|
||||
Use FUNC_START/FUNC_END for powerpc function definitions
|
||||
|
||||
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
|
||||
From: Anton Blanchard <anton@samba.org>
|
||||
---
|
||||
grub-core/kern/powerpc/cache.S | 6 ++++--
|
||||
grub-core/lib/powerpc/setjmp.S | 8 +++++---
|
||||
2 files changed, 9 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/grub-core/kern/powerpc/cache.S b/grub-core/kern/powerpc/cache.S
|
||||
index d85e68d..82f10f8 100644
|
||||
--- a/grub-core/kern/powerpc/cache.S
|
||||
+++ b/grub-core/kern/powerpc/cache.S
|
||||
@@ -17,10 +17,12 @@
|
||||
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
+#include <ppc-asm.h>
|
||||
+
|
||||
.text
|
||||
|
||||
.align 2
|
||||
- .globl grub_arch_sync_caches
|
||||
-grub_arch_sync_caches:
|
||||
+FUNC_START(grub_arch_sync_caches)
|
||||
#include "cache_flush.S"
|
||||
blr
|
||||
+FUNC_END(grub_arch_sync_caches)
|
||||
diff --git a/grub-core/lib/powerpc/setjmp.S b/grub-core/lib/powerpc/setjmp.S
|
||||
index 51fcae9..6fdd60e 100644
|
||||
--- a/grub-core/lib/powerpc/setjmp.S
|
||||
+++ b/grub-core/lib/powerpc/setjmp.S
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include <grub/symbol.h>
|
||||
#include <grub/dl.h>
|
||||
+#include <ppc-asm.h>
|
||||
|
||||
.file "setjmp.S"
|
||||
|
||||
@@ -38,7 +39,7 @@ GRUB_MOD_LICENSE "GPLv3+"
|
||||
/*
|
||||
* int grub_setjmp (grub_jmp_buf env)
|
||||
*/
|
||||
-FUNCTION(grub_setjmp)
|
||||
+FUNC_START(grub_setjmp)
|
||||
STORE 1, 0(3)
|
||||
STORE 14, 1*SZ_LONG(3)
|
||||
STORE 15, 2*SZ_LONG(3)
|
||||
@@ -64,11 +65,12 @@ FUNCTION(grub_setjmp)
|
||||
STORE 4, 20*SZ_LONG(3)
|
||||
li 3, 0
|
||||
blr
|
||||
+FUNC_END(grub_setjmp)
|
||||
|
||||
/*
|
||||
* int grub_longjmp (grub_jmp_buf env, int val)
|
||||
*/
|
||||
-FUNCTION(grub_longjmp)
|
||||
+FUNC_START(grub_longjmp)
|
||||
LOAD 1, 0(3)
|
||||
LOAD 14, 1*SZ_LONG(3)
|
||||
LOAD 15, 2*SZ_LONG(3)
|
||||
@@ -96,4 +98,4 @@ FUNCTION(grub_longjmp)
|
||||
bne 1f
|
||||
li 3, 1
|
||||
1: blr
|
||||
-
|
||||
+FUNC_END(grub_longjmp)
|
||||
--
|
||||
1.8.3.1
|
@ -0,0 +1,67 @@
|
||||
From 8212195e18301ed18a060722e2b5933d2052b2c1 Mon Sep 17 00:00:00 2001
|
||||
From: Ram Pai <linuxram@us.ibm.com>
|
||||
Date: Tue, 25 Feb 2014 18:59:13 +0000
|
||||
Subject: [PATCH 20/23] handle .TOC. symbol while loading
|
||||
|
||||
.TOC. symbol is special in ppc64le . It maps to the
|
||||
address of the .toc section.
|
||||
|
||||
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
|
||||
---
|
||||
grub-core/kern/dl.c | 34 +++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 33 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c
|
||||
index de2d0ed..ce2ff38 100644
|
||||
--- a/grub-core/kern/dl.c
|
||||
+++ b/grub-core/kern/dl.c
|
||||
@@ -343,6 +343,26 @@ grub_dl_load_segments (grub_dl_t mod, const Elf_Ehdr *e)
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
||||
+#ifdef __powerpc64le__
|
||||
+static int
|
||||
+grub_dl_find_section_index (Elf_Ehdr *e, const char *name)
|
||||
+{
|
||||
+ Elf_Shdr *s;
|
||||
+ const char *str;
|
||||
+ unsigned i;
|
||||
+
|
||||
+ s = (Elf_Shdr *) ((char *) e + e->e_shoff + e->e_shstrndx * e->e_shentsize);
|
||||
+ str = (char *) e + s->sh_offset;
|
||||
+
|
||||
+ for (i = 0, s = (Elf_Shdr *) ((char *) e + e->e_shoff);
|
||||
+ i < e->e_shnum;
|
||||
+ i++, s = (Elf_Shdr *) ((char *) s + e->e_shentsize))
|
||||
+ if (grub_strcmp (str + s->sh_name, name) == 0)
|
||||
+ return i;
|
||||
+ return -1;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
static grub_err_t
|
||||
grub_dl_resolve_symbols (grub_dl_t mod, Elf_Ehdr *e)
|
||||
{
|
||||
@@ -392,7 +412,19 @@ grub_dl_resolve_symbols (grub_dl_t mod, Elf_Ehdr *e)
|
||||
/* Resolve a global symbol. */
|
||||
if (sym->st_name != 0 && sym->st_shndx == 0)
|
||||
{
|
||||
- grub_symbol_t nsym = grub_dl_resolve_symbol (name);
|
||||
+ grub_symbol_t nsym;
|
||||
+
|
||||
+#ifdef __powerpc64le__
|
||||
+ if (grub_strcmp(name, ".TOC.") == 0) {
|
||||
+ int j = grub_dl_find_section_index (e, ".toc");
|
||||
+ if (j < 0)
|
||||
+ return grub_error (GRUB_ERR_BAD_MODULE,
|
||||
+ N_("section '.toc' not found"), name);
|
||||
+ sym->st_value = (Elf_Addr) grub_dl_get_section_addr (mod, j);
|
||||
+ break;
|
||||
+ }
|
||||
+#endif
|
||||
+ nsym = grub_dl_resolve_symbol (name);
|
||||
if (! nsym)
|
||||
return grub_error (GRUB_ERR_BAD_MODULE,
|
||||
N_("symbol `%s' not found"), name);
|
||||
--
|
||||
1.8.3.1
|
@ -0,0 +1,35 @@
|
||||
From 584206ed234f18aab8c9e41e869b539003c56c44 Mon Sep 17 00:00:00 2001
|
||||
From: Ram Pai <linuxram@us.ibm.com>
|
||||
Date: Tue, 25 Feb 2014 20:49:28 +0000
|
||||
Subject: [PATCH 21/23] fix the .toc section alignment
|
||||
|
||||
|
||||
the .toc section in powerpc64le modules are sometimes
|
||||
not aligned on a four byte boundary. This fails the module linker especially
|
||||
when processing R_PPC64_TOC16_LO_DS, since the addresses are expected to be
|
||||
aligned on 4byte boundary.
|
||||
|
||||
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
|
||||
---
|
||||
grub-core/kern/dl.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c
|
||||
index ce2ff38..ee69c3c 100644
|
||||
--- a/grub-core/kern/dl.c
|
||||
+++ b/grub-core/kern/dl.c
|
||||
@@ -304,7 +304,12 @@ grub_dl_load_segments (grub_dl_t mod, const Elf_Ehdr *e)
|
||||
{
|
||||
void *addr;
|
||||
|
||||
+#ifdef __powerpc64le__
|
||||
+ ptr = (char *) ALIGN_UP ((grub_addr_t) ptr,
|
||||
+ (s->sh_addralign < 4 ? 4 : s->sh_addralign));
|
||||
+#else
|
||||
ptr = (char *) ALIGN_UP ((grub_addr_t) ptr, s->sh_addralign);
|
||||
+#endif
|
||||
addr = ptr;
|
||||
ptr += s->sh_size;
|
||||
|
||||
--
|
||||
1.8.3.1
|
@ -0,0 +1,704 @@
|
||||
From 4d0c5500be3cb776345e417c542d6d1fea1a3314 Mon Sep 17 00:00:00 2001
|
||||
From: Ram Pai <linuxram@us.ibm.com>
|
||||
Date: Tue, 25 Feb 2014 22:43:25 +0000
|
||||
Subject: [PATCH 22/23] fix parameter to firmware calls
|
||||
|
||||
all parameter to firmware calls should be BigEndian
|
||||
and the results should be CPU endian.
|
||||
|
||||
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
|
||||
---
|
||||
grub-core/disk/ieee1275/nand.c | 41 +++++-----
|
||||
grub-core/disk/ieee1275/ofdisk.c | 22 ++++--
|
||||
grub-core/kern/ieee1275/ieee1275.c | 134 +++++++++++++++++++--------------
|
||||
grub-core/kern/ieee1275/openfw.c | 19 ++---
|
||||
grub-core/lib/ieee1275/datetime.c | 32 ++++----
|
||||
grub-core/net/drivers/ieee1275/ofnet.c | 6 +-
|
||||
include/grub/ieee1275/ieee1275.h | 8 +-
|
||||
7 files changed, 148 insertions(+), 114 deletions(-)
|
||||
|
||||
diff --git a/grub-core/disk/ieee1275/nand.c b/grub-core/disk/ieee1275/nand.c
|
||||
index 576e9cc..1846c23 100644
|
||||
--- a/grub-core/disk/ieee1275/nand.c
|
||||
+++ b/grub-core/disk/ieee1275/nand.c
|
||||
@@ -102,32 +102,33 @@ grub_nand_open (const char *name, grub_disk_t disk)
|
||||
data->handle = dev_ihandle;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "call-method", 2, 2);
|
||||
- args.method = (grub_ieee1275_cell_t) "block-size";
|
||||
- args.ihandle = dev_ihandle;
|
||||
- args.result = 1;
|
||||
+ args.method = IEEE1275_ADDR("block-size");
|
||||
+ args.ihandle = IEEE1275_VALUE(dev_ihandle);
|
||||
+ args.result = IEEE1275_VALUE(1);
|
||||
|
||||
- if ((IEEE1275_CALL_ENTRY_FN (&args) == -1) || (args.result))
|
||||
+ if ((IEEE1275_CALL_ENTRY_FN (&args) == -1) || IEEE1275_VALUE(args.result))
|
||||
{
|
||||
grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't get block size");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
+ args.size1 = IEEE1275_VALUE(args.size1);
|
||||
data->block_size = (args.size1 >> GRUB_DISK_SECTOR_BITS);
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "call-method", 2, 3);
|
||||
- args.method = (grub_ieee1275_cell_t) "size";
|
||||
- args.ihandle = dev_ihandle;
|
||||
- args.result = 1;
|
||||
+ args.method = IEEE1275_ADDR( "size");
|
||||
+ args.ihandle = IEEE1275_VALUE(dev_ihandle);
|
||||
+ args.result = IEEE1275_VALUE(1);
|
||||
|
||||
- if ((IEEE1275_CALL_ENTRY_FN (&args) == -1) || (args.result))
|
||||
+ if ((IEEE1275_CALL_ENTRY_FN (&args) == -1) || IEEE1275_VALUE(args.result))
|
||||
{
|
||||
grub_error (GRUB_ERR_UNKNOWN_DEVICE, "can't get disk size");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
- disk->total_sectors = args.size1;
|
||||
+ disk->total_sectors = IEEE1275_VALUE(args.size1);
|
||||
disk->total_sectors <<= 32;
|
||||
- disk->total_sectors += args.size2;
|
||||
+ disk->total_sectors += IEEE1275_VALUE(args.size2);
|
||||
disk->total_sectors >>= GRUB_DISK_SECTOR_BITS;
|
||||
|
||||
disk->id = dev_ihandle;
|
||||
@@ -170,10 +171,10 @@ grub_nand_read (grub_disk_t disk, grub_disk_addr_t sector,
|
||||
} args;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "call-method", 6, 1);
|
||||
- args.method = (grub_ieee1275_cell_t) "pio-read";
|
||||
- args.ihandle = data->handle;
|
||||
- args.buf = (grub_ieee1275_cell_t) buf;
|
||||
- args.page = (grub_ieee1275_cell_t) ((grub_size_t) sector / data->block_size);
|
||||
+ args.method = IEEE1275_ADDR("pio-read");
|
||||
+ args.ihandle = IEEE1275_VALUE(data->handle);
|
||||
+ args.buf = buf;
|
||||
+ args.page = (grub_size_t) sector / data->block_size;
|
||||
|
||||
ofs = ((grub_size_t) sector % data->block_size) << GRUB_DISK_SECTOR_BITS;
|
||||
size <<= GRUB_DISK_SECTOR_BITS;
|
||||
@@ -185,16 +186,20 @@ grub_nand_read (grub_disk_t disk, grub_disk_addr_t sector,
|
||||
|
||||
len = (ofs + size > bsize) ? (bsize - ofs) : size;
|
||||
|
||||
- args.len = (grub_ieee1275_cell_t) len;
|
||||
- args.ofs = (grub_ieee1275_cell_t) ofs;
|
||||
- args.result = 1;
|
||||
+ args.len = IEEE1275_VALUE(len);
|
||||
+ args.ofs = IEEE1275_VALUE(ofs);
|
||||
+ args.result = IEEE1275_VALUE(1);
|
||||
+ args.buf = IEEE1275_ADDR(args.buf);
|
||||
+ args.page = IEEE1275_VALUE(args.page);
|
||||
|
||||
- if ((IEEE1275_CALL_ENTRY_FN (&args) == -1) || (args.result))
|
||||
+ if ((IEEE1275_CALL_ENTRY_FN (&args) == -1) || IEEE1275_VALUE(args.result))
|
||||
return grub_error (GRUB_ERR_READ_ERROR, N_("failure reading sector 0x%llx "
|
||||
"from `%s'"),
|
||||
(unsigned long long) sector,
|
||||
disk->name);
|
||||
|
||||
+ args.buf = IEEE1275_ADDR(args.buf);
|
||||
+ args.page = IEEE1275_VALUE(args.page);
|
||||
ofs = 0;
|
||||
size -= len;
|
||||
args.buf += len;
|
||||
diff --git a/grub-core/disk/ieee1275/ofdisk.c b/grub-core/disk/ieee1275/ofdisk.c
|
||||
index d785d6a..72b36c5 100644
|
||||
--- a/grub-core/disk/ieee1275/ofdisk.c
|
||||
+++ b/grub-core/disk/ieee1275/ofdisk.c
|
||||
@@ -225,16 +225,19 @@ dev_iterate (const struct grub_ieee1275_devalias *alias)
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "call-method", 2, 3);
|
||||
args.method = IEEE1275_ADDR("vscsi-report-luns");
|
||||
- args.ihandle = ihandle;
|
||||
- args.table = 0;
|
||||
- args.nentries = 0;
|
||||
+ args.ihandle = IEEE1275_VALUE(ihandle);
|
||||
+ args.table = IEEE1275_ADDR(0);
|
||||
+ args.nentries = IEEE1275_VALUE(0);
|
||||
|
||||
- if (IEEE1275_CALL_ENTRY_FN (&args) == -1 || args.catch_result)
|
||||
+ if (IEEE1275_CALL_ENTRY_FN (&args) == -1 || IEEE1275_VALUE(args.catch_result))
|
||||
{
|
||||
grub_ieee1275_close (ihandle);
|
||||
return;
|
||||
}
|
||||
|
||||
+ args.table = IEEE1275_ADDR(args.table);
|
||||
+ args.nentries = IEEE1275_VALUE(args.nentries);
|
||||
+
|
||||
buf = grub_malloc (grub_strlen (alias->path) + 32);
|
||||
if (!buf)
|
||||
return;
|
||||
@@ -245,6 +248,7 @@ dev_iterate (const struct grub_ieee1275_devalias *alias)
|
||||
grub_uint64_t *ptr;
|
||||
|
||||
ptr = *(grub_uint64_t **) ((grub_addr_t)args.table + 4 + 8 * i);
|
||||
+ ptr = (grub_uint64_t *) (grub_addr_t) IEEE1275_ADDR(ptr);
|
||||
while (*ptr)
|
||||
{
|
||||
grub_snprintf (bufptr, 32, "/disk@%" PRIxGRUB_UINT64_T, *ptr++);
|
||||
@@ -614,18 +618,20 @@ grub_ofdisk_get_block_size (const char *device, grub_uint32_t *block_size)
|
||||
|
||||
INIT_IEEE1275_COMMON (&args_ieee1275.common, "call-method", 2, 2);
|
||||
args_ieee1275.method = IEEE1275_ADDR("block-size");
|
||||
- args_ieee1275.ihandle = last_ihandle;
|
||||
- args_ieee1275.result = 1;
|
||||
+ args_ieee1275.ihandle = IEEE1275_VALUE(last_ihandle);
|
||||
+ args_ieee1275.result = IEEE1275_VALUE(1);
|
||||
|
||||
*block_size = GRUB_DISK_SECTOR_SIZE;
|
||||
|
||||
- if ((IEEE1275_CALL_ENTRY_FN (&args_ieee1275) == -1) || (args_ieee1275.result))
|
||||
+ if ((IEEE1275_CALL_ENTRY_FN (&args_ieee1275) == -1) || IEEE1275_VALUE(args_ieee1275.result))
|
||||
grub_dprintf ("disk", "can't get block size\n");
|
||||
- else
|
||||
+ else {
|
||||
+ args_ieee1275.size1 = IEEE1275_VALUE(args_ieee1275.size1);
|
||||
if (args_ieee1275.size1
|
||||
&& !(args_ieee1275.size1 & (args_ieee1275.size1 - 1))
|
||||
&& args_ieee1275.size1 >= 512 && args_ieee1275.size1 <= 16384)
|
||||
*block_size = args_ieee1275.size1;
|
||||
+ }
|
||||
|
||||
return 0;
|
||||
}
|
||||
diff --git a/grub-core/kern/ieee1275/ieee1275.c b/grub-core/kern/ieee1275/ieee1275.c
|
||||
index f933c89..df8943c 100644
|
||||
--- a/grub-core/kern/ieee1275/ieee1275.c
|
||||
+++ b/grub-core/kern/ieee1275/ieee1275.c
|
||||
@@ -42,7 +42,7 @@ grub_ieee1275_finddevice (const char *name, grub_ieee1275_phandle_t *phandlep)
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
- *phandlep = args.phandle;
|
||||
+ *phandlep = args.phandle = IEEE1275_VALUE(args.phandle);
|
||||
if (args.phandle == IEEE1275_PHANDLE_INVALID)
|
||||
return -1;
|
||||
return 0;
|
||||
@@ -65,13 +65,15 @@ grub_ieee1275_get_property (grub_ieee1275_phandle_t phandle,
|
||||
args;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "getprop", 4, 1);
|
||||
- args.phandle = phandle;
|
||||
+ args.phandle = IEEE1275_VALUE(phandle);
|
||||
args.prop = IEEE1275_ADDR(property);
|
||||
args.buf = IEEE1275_ADDR(buf);
|
||||
- args.buflen = (grub_ieee1275_cell_t) size;
|
||||
+ args.buflen = IEEE1275_VALUE(size);
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
+
|
||||
+ args.size = IEEE1275_VALUE(args.size);
|
||||
if (actual)
|
||||
*actual = (grub_ssize_t) args.size;
|
||||
if (args.size == IEEE1275_CELL_INVALID)
|
||||
@@ -79,6 +81,18 @@ grub_ieee1275_get_property (grub_ieee1275_phandle_t phandle,
|
||||
return 0;
|
||||
}
|
||||
|
||||
+#ifdef __powerpc64le__
|
||||
+static void
|
||||
+grub_swap_bytes(grub_uint32_t *buf, grub_size_t len)
|
||||
+{
|
||||
+ /* Integer properties are always in big endian. */
|
||||
+ unsigned int i;
|
||||
+ len /= sizeof (grub_uint32_t);
|
||||
+ for (i = 0; i < len; i++)
|
||||
+ buf[i] = IEEE1275_VALUE(buf[i]);
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
int
|
||||
grub_ieee1275_get_integer_property (grub_ieee1275_phandle_t phandle,
|
||||
const char *property, grub_uint32_t *buf,
|
||||
@@ -86,16 +100,13 @@ grub_ieee1275_get_integer_property (grub_ieee1275_phandle_t phandle,
|
||||
{
|
||||
int ret;
|
||||
ret = grub_ieee1275_get_property (phandle, property, (void *) buf, size, actual);
|
||||
-#ifndef GRUB_CPU_WORDS_BIGENDIAN
|
||||
+
|
||||
+#ifdef __powerpc64le__
|
||||
/* Integer properties are always in big endian. */
|
||||
if (ret == 0)
|
||||
- {
|
||||
- unsigned int i;
|
||||
- size /= sizeof (grub_uint32_t);
|
||||
- for (i = 0; i < size; i++)
|
||||
- buf[i] = grub_be_to_cpu32 (buf[i]);
|
||||
- }
|
||||
+ grub_swap_bytes(buf, size);
|
||||
#endif
|
||||
+
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -114,14 +125,14 @@ grub_ieee1275_next_property (grub_ieee1275_phandle_t phandle, char *prev_prop,
|
||||
args;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "nextprop", 3, 1);
|
||||
- args.phandle = phandle;
|
||||
+ args.phandle = IEEE1275_VALUE(phandle);
|
||||
args.prev_prop = IEEE1275_ADDR(prev_prop);
|
||||
args.next_prop = IEEE1275_ADDR(prop);
|
||||
- args.flags = (grub_ieee1275_cell_t) -1;
|
||||
+ args.flags = IEEE1275_VALUE(-1);
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
- return (int) args.flags;
|
||||
+ return (int) IEEE1275_VALUE(args.flags);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -138,13 +149,13 @@ grub_ieee1275_get_property_length (grub_ieee1275_phandle_t phandle,
|
||||
args;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "getproplen", 2, 1);
|
||||
- args.phandle = phandle;
|
||||
+ args.phandle = IEEE1275_VALUE(phandle);
|
||||
args.prop = IEEE1275_ADDR(prop);
|
||||
- args.length = (grub_ieee1275_cell_t) -1;
|
||||
+ args.length = IEEE1275_VALUE(-1);
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
- *length = args.length;
|
||||
+ *length = args.length = IEEE1275_VALUE(args.length);
|
||||
if (args.length == IEEE1275_CELL_INVALID)
|
||||
return -1;
|
||||
return 0;
|
||||
@@ -163,11 +174,11 @@ grub_ieee1275_instance_to_package (grub_ieee1275_ihandle_t ihandle,
|
||||
args;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "instance-to-package", 1, 1);
|
||||
- args.ihandle = ihandle;
|
||||
+ args.ihandle = IEEE1275_VALUE(ihandle);
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
- *phandlep = args.phandle;
|
||||
+ *phandlep = args.phandle = IEEE1275_VALUE(args.phandle);
|
||||
if (args.phandle == IEEE1275_PHANDLE_INVALID)
|
||||
return -1;
|
||||
return 0;
|
||||
@@ -189,12 +200,14 @@ grub_ieee1275_package_to_path (grub_ieee1275_phandle_t phandle,
|
||||
args;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "package-to-path", 3, 1);
|
||||
- args.phandle = phandle;
|
||||
+ args.phandle = IEEE1275_VALUE(phandle);
|
||||
args.buf = IEEE1275_ADDR(path);
|
||||
- args.buflen = (grub_ieee1275_cell_t) len;
|
||||
+ args.buflen = IEEE1275_VALUE(len);
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
+
|
||||
+ args.actual = IEEE1275_VALUE(args.actual);
|
||||
if (actual)
|
||||
*actual = args.actual;
|
||||
if (args.actual == IEEE1275_CELL_INVALID)
|
||||
@@ -218,12 +231,14 @@ grub_ieee1275_instance_to_path (grub_ieee1275_ihandle_t ihandle,
|
||||
args;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "instance-to-path", 3, 1);
|
||||
- args.ihandle = ihandle;
|
||||
+ args.ihandle = IEEE1275_VALUE(ihandle);
|
||||
args.buf = IEEE1275_ADDR(path);
|
||||
- args.buflen = (grub_ieee1275_cell_t) len;
|
||||
+ args.buflen = IEEE1275_VALUE(len);
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
+
|
||||
+ args.actual = IEEE1275_VALUE(args.actual);
|
||||
if (actual)
|
||||
*actual = args.actual;
|
||||
if (args.actual == IEEE1275_CELL_INVALID)
|
||||
@@ -231,6 +246,7 @@ grub_ieee1275_instance_to_path (grub_ieee1275_ihandle_t ihandle,
|
||||
return 0;
|
||||
}
|
||||
|
||||
+
|
||||
int
|
||||
grub_ieee1275_write (grub_ieee1275_ihandle_t ihandle, const void *buffer,
|
||||
grub_size_t len, grub_ssize_t *actualp)
|
||||
@@ -246,12 +262,13 @@ grub_ieee1275_write (grub_ieee1275_ihandle_t ihandle, const void *buffer,
|
||||
args;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "write", 3, 1);
|
||||
- args.ihandle = ihandle;
|
||||
+ args.ihandle = IEEE1275_VALUE(ihandle);
|
||||
args.buf = IEEE1275_ADDR(buffer);
|
||||
- args.len = (grub_ieee1275_cell_t) len;
|
||||
+ args.len = IEEE1275_VALUE(len);
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
+ args.actual = IEEE1275_VALUE(args.actual);
|
||||
if (actualp)
|
||||
*actualp = args.actual;
|
||||
return 0;
|
||||
@@ -272,14 +289,16 @@ grub_ieee1275_read (grub_ieee1275_ihandle_t ihandle, void *buffer,
|
||||
args;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "read", 3, 1);
|
||||
- args.ihandle = ihandle;
|
||||
+ args.ihandle = IEEE1275_VALUE(ihandle);
|
||||
args.buf = IEEE1275_ADDR(buffer);
|
||||
- args.len = (grub_ieee1275_cell_t) len;
|
||||
+ args.len = IEEE1275_VALUE(len);
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
+ args.actual = IEEE1275_VALUE(args.actual);
|
||||
if (actualp)
|
||||
*actualp = args.actual;
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -298,20 +317,20 @@ grub_ieee1275_seek (grub_ieee1275_ihandle_t ihandle, grub_disk_addr_t pos,
|
||||
args;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "seek", 3, 1);
|
||||
- args.ihandle = ihandle;
|
||||
+ args.ihandle = IEEE1275_VALUE(ihandle);
|
||||
/* To prevent stupid gcc warning. */
|
||||
#if GRUB_IEEE1275_CELL_SIZEOF >= 8
|
||||
args.pos_hi = 0;
|
||||
- args.pos_lo = pos;
|
||||
+ args.pos_lo = IEEE1275_VALUE(pos);
|
||||
#else
|
||||
- args.pos_hi = (grub_ieee1275_cell_t) (pos >> (8 * GRUB_IEEE1275_CELL_SIZEOF));
|
||||
- args.pos_lo = (grub_ieee1275_cell_t)
|
||||
- (pos & ((1ULL << (8 * GRUB_IEEE1275_CELL_SIZEOF)) - 1));
|
||||
+ args.pos_hi = IEEE1275_VALUE((pos >> (8 * GRUB_IEEE1275_CELL_SIZEOF)));
|
||||
+ args.pos_lo = IEEE1275_VALUE((pos & ((1ULL << (8 * GRUB_IEEE1275_CELL_SIZEOF)) - 1)));
|
||||
#endif
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
|
||||
+ args.result = IEEE1275_VALUE(args.result);
|
||||
if (result)
|
||||
*result = args.result;
|
||||
return 0;
|
||||
@@ -330,11 +349,11 @@ grub_ieee1275_peer (grub_ieee1275_phandle_t node,
|
||||
args;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "peer", 1, 1);
|
||||
- args.node = node;
|
||||
+ args.node = IEEE1275_VALUE(node);
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
- *result = args.result;
|
||||
+ *result = args.result = IEEE1275_VALUE(args.result);
|
||||
if (args.result == 0)
|
||||
return -1;
|
||||
return 0;
|
||||
@@ -353,12 +372,12 @@ grub_ieee1275_child (grub_ieee1275_phandle_t node,
|
||||
args;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "child", 1, 1);
|
||||
- args.node = node;
|
||||
- args.result = IEEE1275_PHANDLE_INVALID;
|
||||
+ args.node = IEEE1275_VALUE(node);
|
||||
+ args.result = IEEE1275_VALUE(IEEE1275_PHANDLE_INVALID);
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
- *result = args.result;
|
||||
+ *result = args.result = IEEE1275_VALUE(args.result);
|
||||
if (args.result == 0)
|
||||
return -1;
|
||||
return 0;
|
||||
@@ -377,12 +396,12 @@ grub_ieee1275_parent (grub_ieee1275_phandle_t node,
|
||||
args;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "parent", 1, 1);
|
||||
- args.node = node;
|
||||
- args.result = IEEE1275_PHANDLE_INVALID;
|
||||
+ args.node = IEEE1275_VALUE(node);
|
||||
+ args.result = IEEE1275_VALUE(IEEE1275_PHANDLE_INVALID);
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
- *result = args.result;
|
||||
+ *result = IEEE1275_VALUE(args.result);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -405,6 +424,7 @@ grub_ieee1275_interpret (const char *command, grub_ieee1275_cell_t *catch)
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
+ args.catch = IEEE1275_VALUE(args.catch);
|
||||
if (catch)
|
||||
*catch = args.catch;
|
||||
return 0;
|
||||
@@ -457,7 +477,7 @@ grub_ieee1275_open (const char *path, grub_ieee1275_ihandle_t *result)
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
- *result = args.result;
|
||||
+ *result = args.result = IEEE1275_VALUE(args.result);
|
||||
if (args.result == IEEE1275_IHANDLE_INVALID)
|
||||
return -1;
|
||||
return 0;
|
||||
@@ -474,7 +494,7 @@ grub_ieee1275_close (grub_ieee1275_ihandle_t ihandle)
|
||||
args;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "close", 1, 0);
|
||||
- args.ihandle = ihandle;
|
||||
+ args.ihandle = IEEE1275_VALUE(ihandle);
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
@@ -497,12 +517,14 @@ grub_ieee1275_claim (grub_addr_t addr, grub_size_t size, unsigned int align,
|
||||
args;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "claim", 3, 1);
|
||||
- args.addr = (grub_ieee1275_cell_t) addr;
|
||||
- args.size = (grub_ieee1275_cell_t) size;
|
||||
- args.align = (grub_ieee1275_cell_t) align;
|
||||
+ args.addr = IEEE1275_VALUE(addr);
|
||||
+ args.size = IEEE1275_VALUE(size);
|
||||
+ args.align = IEEE1275_VALUE(align);
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
+
|
||||
+ args.base = IEEE1275_VALUE(args.base);
|
||||
if (result)
|
||||
*result = args.base;
|
||||
if (args.base == IEEE1275_CELL_INVALID)
|
||||
@@ -522,8 +544,8 @@ grub_ieee1275_release (grub_addr_t addr, grub_size_t size)
|
||||
args;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "release", 2, 0);
|
||||
- args.addr = addr;
|
||||
- args.size = size;
|
||||
+ args.addr = IEEE1275_VALUE(addr);
|
||||
+ args.size = IEEE1275_VALUE(size);
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
@@ -547,14 +569,14 @@ grub_ieee1275_set_property (grub_ieee1275_phandle_t phandle,
|
||||
args;
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "setprop", 4, 1);
|
||||
- args.size = (grub_ieee1275_cell_t) size;
|
||||
+ args.size = IEEE1275_VALUE(size);
|
||||
args.buf = IEEE1275_ADDR(buf);
|
||||
args.propname = IEEE1275_ADDR(propname);
|
||||
- args.phandle = (grub_ieee1275_cell_t) phandle;
|
||||
+ args.phandle = IEEE1275_VALUE(phandle);
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
- *actual = args.actual;
|
||||
+ *actual = args.actual = IEEE1275_VALUE(args.actual);
|
||||
if ((args.actual == IEEE1275_CELL_INVALID) || (args.actual != args.size))
|
||||
return -1;
|
||||
return 0;
|
||||
@@ -579,15 +601,15 @@ grub_ieee1275_set_color (grub_ieee1275_ihandle_t ihandle,
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "call-method", 6, 1);
|
||||
args.method = IEEE1275_ADDR("color!");
|
||||
- args.ihandle = ihandle;
|
||||
- args.index = index;
|
||||
- args.r = r;
|
||||
- args.g = g;
|
||||
- args.b = b;
|
||||
+ args.ihandle = IEEE1275_VALUE(ihandle);
|
||||
+ args.index = IEEE1275_VALUE(index);
|
||||
+ args.r = IEEE1275_VALUE(r);
|
||||
+ args.g = IEEE1275_VALUE(g);
|
||||
+ args.b = IEEE1275_VALUE(b);
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
- return args.catch_result;
|
||||
+ return IEEE1275_VALUE(args.catch_result);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -604,6 +626,6 @@ grub_ieee1275_milliseconds (grub_uint32_t *msecs)
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
- *msecs = args.msecs;
|
||||
+ *msecs = IEEE1275_VALUE(args.msecs);
|
||||
return 0;
|
||||
}
|
||||
diff --git a/grub-core/kern/ieee1275/openfw.c b/grub-core/kern/ieee1275/openfw.c
|
||||
index a8bbc71..ced8e3f 100644
|
||||
--- a/grub-core/kern/ieee1275/openfw.c
|
||||
+++ b/grub-core/kern/ieee1275/openfw.c
|
||||
@@ -286,20 +286,20 @@ grub_ieee1275_map (grub_addr_t phys, grub_addr_t virt, grub_size_t size,
|
||||
#endif
|
||||
1);
|
||||
args.method = IEEE1275_ADDR("map");
|
||||
- args.ihandle = grub_ieee1275_mmu;
|
||||
+ args.ihandle = IEEE1275_VALUE(grub_ieee1275_mmu);
|
||||
#ifdef __sparc__
|
||||
args.phys_high = 0;
|
||||
#endif
|
||||
- args.phys_low = phys;
|
||||
- args.virt = virt;
|
||||
- args.size = size;
|
||||
- args.mode = mode; /* Format is WIMG0PP. */
|
||||
- args.catch_result = (grub_ieee1275_cell_t) -1;
|
||||
+ args.phys_low = IEEE1275_ADDR(phys);
|
||||
+ args.virt = IEEE1275_ADDR(virt);
|
||||
+ args.size = IEEE1275_VALUE(size);
|
||||
+ args.mode = IEEE1275_VALUE(mode); /* Format is WIMG0PP. */
|
||||
+ args.catch_result = IEEE1275_VALUE((grub_ieee1275_cell_t) -1);
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
|
||||
- return args.catch_result;
|
||||
+ return IEEE1275_VALUE(args.catch_result);
|
||||
}
|
||||
|
||||
grub_err_t
|
||||
@@ -545,10 +545,12 @@ grub_ieee1275_canonicalise_devname (const char *path)
|
||||
INIT_IEEE1275_COMMON (&args.common, "canon", 3, 1);
|
||||
args.path = IEEE1275_ADDR(path);
|
||||
args.buf = IEEE1275_ADDR(buf);
|
||||
- args.inlen = (grub_ieee1275_cell_t) (bufsize - 1);
|
||||
+ args.inlen = IEEE1275_VALUE(bufsize - 1);
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return 0;
|
||||
+
|
||||
+ args.outlen = IEEE1275_VALUE(args.outlen);
|
||||
if (args.outlen > bufsize - 1)
|
||||
{
|
||||
bufsize = args.outlen + 2;
|
||||
@@ -560,4 +562,3 @@ grub_ieee1275_canonicalise_devname (const char *path)
|
||||
grub_free (buf);
|
||||
return NULL;
|
||||
}
|
||||
-
|
||||
diff --git a/grub-core/lib/ieee1275/datetime.c b/grub-core/lib/ieee1275/datetime.c
|
||||
index fa0d3b6..7ee1ae2 100644
|
||||
--- a/grub-core/lib/ieee1275/datetime.c
|
||||
+++ b/grub-core/lib/ieee1275/datetime.c
|
||||
@@ -83,22 +83,22 @@ grub_get_datetime (struct grub_datetime *datetime)
|
||||
return grub_error (GRUB_ERR_IO, "couldn't open RTC");
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "call-method", 2, 7);
|
||||
- args.device = (grub_ieee1275_cell_t) ihandle;
|
||||
+ args.device = IEEE1275_VALUE((grub_ieee1275_cell_t) ihandle);
|
||||
args.method = IEEE1275_ADDR("get-time");
|
||||
|
||||
status = IEEE1275_CALL_ENTRY_FN (&args);
|
||||
|
||||
grub_ieee1275_close (ihandle);
|
||||
|
||||
- if (status == -1 || args.catch_result)
|
||||
+ if (status == -1 || IEEE1275_VALUE(args.catch_result))
|
||||
return grub_error (GRUB_ERR_IO, "get-time failed");
|
||||
|
||||
- datetime->year = args.year;
|
||||
- datetime->month = args.month;
|
||||
- datetime->day = args.day;
|
||||
- datetime->hour = args.hour;
|
||||
- datetime->minute = args.minute;
|
||||
- datetime->second = args.second;
|
||||
+ datetime->year = IEEE1275_VALUE(args.year);
|
||||
+ datetime->month = IEEE1275_VALUE(args.month);
|
||||
+ datetime->day = IEEE1275_VALUE(args.day);
|
||||
+ datetime->hour = IEEE1275_VALUE(args.hour);
|
||||
+ datetime->minute = IEEE1275_VALUE(args.minute);
|
||||
+ datetime->second = IEEE1275_VALUE(args.second);
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
@@ -135,21 +135,21 @@ grub_set_datetime (struct grub_datetime *datetime)
|
||||
return grub_error (GRUB_ERR_IO, "couldn't open RTC");
|
||||
|
||||
INIT_IEEE1275_COMMON (&args.common, "call-method", 8, 1);
|
||||
- args.device = (grub_ieee1275_cell_t) ihandle;
|
||||
+ args.device = IEEE1275_VALUE(ihandle);
|
||||
args.method = IEEE1275_ADDR("set-time");
|
||||
|
||||
- args.year = datetime->year;
|
||||
- args.month = datetime->month;
|
||||
- args.day = datetime->day;
|
||||
- args.hour = datetime->hour;
|
||||
- args.minute = datetime->minute;
|
||||
- args.second = datetime->second;
|
||||
+ args.year = IEEE1275_VALUE(datetime->year);
|
||||
+ args.month = IEEE1275_VALUE(datetime->month);
|
||||
+ args.day = IEEE1275_VALUE(datetime->day);
|
||||
+ args.hour = IEEE1275_VALUE(datetime->hour);
|
||||
+ args.minute = IEEE1275_VALUE(datetime->minute);
|
||||
+ args.second = IEEE1275_VALUE(datetime->second);
|
||||
|
||||
status = IEEE1275_CALL_ENTRY_FN (&args);
|
||||
|
||||
grub_ieee1275_close (ihandle);
|
||||
|
||||
- if (status == -1 || args.catch_result)
|
||||
+ if (status == -1 || IEEE1275_VALUE(args.catch_result))
|
||||
return grub_error (GRUB_ERR_IO, "set-time failed");
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
diff --git a/grub-core/net/drivers/ieee1275/ofnet.c b/grub-core/net/drivers/ieee1275/ofnet.c
|
||||
index 07c8446..01dfe85 100644
|
||||
--- a/grub-core/net/drivers/ieee1275/ofnet.c
|
||||
+++ b/grub-core/net/drivers/ieee1275/ofnet.c
|
||||
@@ -385,17 +385,17 @@ search_net_devices (struct grub_ieee1275_devalias *alias)
|
||||
}
|
||||
args;
|
||||
INIT_IEEE1275_COMMON (&args.common, "interpret", 2, 2);
|
||||
- args.len = card->txbufsize;
|
||||
+ args.len = IEEE1275_VALUE(card->txbufsize);
|
||||
args.method = IEEE1275_ADDR("alloc-mem");
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1
|
||||
- || args.catch)
|
||||
+ || IEEE1275_VALUE(args.catch))
|
||||
{
|
||||
card->txbuf = 0;
|
||||
grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory"));
|
||||
}
|
||||
else
|
||||
- card->txbuf = (void *) (grub_addr_t) args.result;
|
||||
+ card->txbuf = (void *) (grub_addr_t) IEEE1275_VALUE(args.result);
|
||||
}
|
||||
else
|
||||
card->txbuf = grub_zalloc (card->txbufsize);
|
||||
diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h
|
||||
index 2e5270c..be0c235 100644
|
||||
--- a/include/grub/ieee1275/ieee1275.h
|
||||
+++ b/include/grub/ieee1275/ieee1275.h
|
||||
@@ -49,12 +49,12 @@ struct grub_ieee1275_common_hdr
|
||||
grub_ieee1275_cell_t nr_outs;
|
||||
};
|
||||
|
||||
-#define IEEE1275_ADDR(x) (grub_uint32_t)(grub_addr_t)(x)
|
||||
-
|
||||
+#define IEEE1275_ADDR(x) (grub_uint32_t)grub_cpu_to_be32((grub_addr_t)(x))
|
||||
+#define IEEE1275_VALUE(x) (grub_uint32_t)grub_cpu_to_be32(x)
|
||||
#define INIT_IEEE1275_COMMON(p, xname, xins, xouts) \
|
||||
(p)->name = (grub_ieee1275_cell_t) IEEE1275_ADDR(xname); \
|
||||
- (p)->nr_ins = (grub_ieee1275_cell_t) xins; \
|
||||
- (p)->nr_outs = (grub_ieee1275_cell_t) xouts
|
||||
+ (p)->nr_ins = (grub_ieee1275_cell_t) IEEE1275_VALUE(xins); \
|
||||
+ (p)->nr_outs = (grub_ieee1275_cell_t) IEEE1275_VALUE(xouts)
|
||||
|
||||
typedef grub_uint32_t grub_ieee1275_ihandle_t;
|
||||
typedef grub_uint32_t grub_ieee1275_phandle_t;
|
||||
--
|
||||
1.8.3.1
|
@ -0,0 +1,35 @@
|
||||
From c7fbe6c1ae22ac9853b03a3d4d742712f31e69b9 Mon Sep 17 00:00:00 2001
|
||||
From: Ram Pai <linuxram@us.ibm.com>
|
||||
Date: Tue, 25 Feb 2014 23:31:06 +0000
|
||||
Subject: [PATCH 23/23] grub segfaults if initrd is specified before specifying
|
||||
|
||||
grub segfaults if initrd is specified before specifying
|
||||
the kernel. The problem is the initrd module sees that kernel is not
|
||||
specified and takes the fail path. In the fail path it checks if anything has
|
||||
be malloc'ed. Unfortunately the variable that it looks to check for is a
|
||||
uninitialized stack variable. The stack variable can incorrectly indicate
|
||||
something is malloced, which leads the module to free some unallocated
|
||||
memory. This patch fixes the problem by initializing the stack variable.
|
||||
|
||||
Signed-off-by: Ram Pai <linuxram@us.ibm.com>
|
||||
---
|
||||
grub-core/loader/powerpc/ieee1275/linux.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/grub-core/loader/powerpc/ieee1275/linux.c b/grub-core/loader/powerpc/ieee1275/linux.c
|
||||
index 9dde053..0d94433 100644
|
||||
--- a/grub-core/loader/powerpc/ieee1275/linux.c
|
||||
+++ b/grub-core/loader/powerpc/ieee1275/linux.c
|
||||
@@ -335,6 +335,10 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
|
||||
grub_addr_t addr;
|
||||
struct grub_linux_initrd_context initrd_ctx;
|
||||
|
||||
+ // initialize, otherwise the fail path will try to
|
||||
+ // free up data and segfault
|
||||
+ initrd_ctx.components = NULL;
|
||||
+
|
||||
if (argc == 0)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
|
||||
--
|
||||
1.8.3.1
|
@ -1,31 +0,0 @@
|
||||
Index: grub-2.02~beta2/conf/Makefile.common
|
||||
===================================================================
|
||||
--- grub-2.02~beta2.orig/conf/Makefile.common
|
||||
+++ grub-2.02~beta2/conf/Makefile.common
|
||||
@@ -41,20 +41,20 @@ BUILD_CPPFLAGS += $(CPPFLAGS_DEFAULT)
|
||||
|
||||
LDADD_KERNEL = $(TARGET_LIBGCC)
|
||||
|
||||
-CFLAGS_KERNEL = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding
|
||||
+CFLAGS_KERNEL = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding -mbig-endian
|
||||
LDFLAGS_KERNEL = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) $(TARGET_LDFLAGS_STATIC_LIBGCC)
|
||||
-CPPFLAGS_KERNEL = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM) -DGRUB_KERNEL=1
|
||||
+CPPFLAGS_KERNEL = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM) -DGRUB_KERNEL=1 -mbig-endian
|
||||
CCASFLAGS_KERNEL = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM)
|
||||
STRIPFLAGS_KERNEL = -R .rel.dyn -R .reginfo -R .note -R .comment -R .drectve -R .note.gnu.gold-version
|
||||
|
||||
-CFLAGS_MODULE = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding
|
||||
+CFLAGS_MODULE = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding -mbig-endian
|
||||
LDFLAGS_MODULE = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) -Wl,-r,-d
|
||||
-CPPFLAGS_MODULE = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM)
|
||||
+CPPFLAGS_MODULE = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM) -mbig-endian
|
||||
CCASFLAGS_MODULE = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM)
|
||||
|
||||
-CFLAGS_IMAGE = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -fno-builtin
|
||||
+CFLAGS_IMAGE = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -fno-builtin -mbig-endian
|
||||
LDFLAGS_IMAGE = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib $(TARGET_LDFLAGS_OLDMAGIC) -Wl,-S
|
||||
-CPPFLAGS_IMAGE = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM)
|
||||
+CPPFLAGS_IMAGE = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM) -mbig-endian
|
||||
CCASFLAGS_IMAGE = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM)
|
||||
|
||||
CFLAGS_PROGRAM =
|
@ -1,13 +0,0 @@
|
||||
Index: grub-2.02~beta2/configure.ac
|
||||
===================================================================
|
||||
--- grub-2.02~beta2.orig/configure.ac
|
||||
+++ grub-2.02~beta2/configure.ac
|
||||
@@ -137,6 +137,7 @@ case "$target_cpu"-"$platform" in
|
||||
x86_64-xen) ;;
|
||||
x86_64-*) target_cpu=i386 ;;
|
||||
powerpc64-ieee1275) target_cpu=powerpc ;;
|
||||
+ powerpc64le-ieee1275) target_cpu=powerpc ;;
|
||||
esac
|
||||
|
||||
# Check if the platform is supported, make final adjustments.
|
||||
|
129
grub2-ppc64le-timeout.patch
Normal file
129
grub2-ppc64le-timeout.patch
Normal file
@ -0,0 +1,129 @@
|
||||
diff --git a/grub-core/kern/ieee1275/ieee1275.c b/grub-core/kern/ieee1275/ieee1275.c
|
||||
index df8943c..896b728 100644
|
||||
--- a/grub-core/kern/ieee1275/ieee1275.c
|
||||
+++ b/grub-core/kern/ieee1275/ieee1275.c
|
||||
@@ -24,7 +24,15 @@
|
||||
#define IEEE1275_IHANDLE_INVALID ((grub_ieee1275_cell_t) 0)
|
||||
#define IEEE1275_CELL_INVALID ((grub_ieee1275_cell_t) -1)
|
||||
|
||||
-
|
||||
+static grub_ssize_t
|
||||
+grub_ieee1275_cell2ssize(grub_ieee1275_cell_t value)
|
||||
+{
|
||||
+#if GRUB_IEEE1275_CELL_SIZEOF == 4
|
||||
+ return (grub_ssize_t)(int) value;
|
||||
+#else
|
||||
+ return (grub_ssize_t)(long) value;
|
||||
+#endif
|
||||
+}
|
||||
|
||||
int
|
||||
grub_ieee1275_finddevice (const char *name, grub_ieee1275_phandle_t *phandlep)
|
||||
@@ -75,7 +83,7 @@ grub_ieee1275_get_property (grub_ieee1275_phandle_t phandle,
|
||||
|
||||
args.size = IEEE1275_VALUE(args.size);
|
||||
if (actual)
|
||||
- *actual = (grub_ssize_t) args.size;
|
||||
+ *actual = grub_ieee1275_cell2ssize(args.size);
|
||||
if (args.size == IEEE1275_CELL_INVALID)
|
||||
return -1;
|
||||
return 0;
|
||||
@@ -155,7 +163,9 @@ grub_ieee1275_get_property_length (grub_ieee1275_phandle_t phandle,
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
- *length = args.length = IEEE1275_VALUE(args.length);
|
||||
+
|
||||
+ args.length = IEEE1275_VALUE(args.length);
|
||||
+ *length = grub_ieee1275_cell2ssize(args.length);
|
||||
if (args.length == IEEE1275_CELL_INVALID)
|
||||
return -1;
|
||||
return 0;
|
||||
@@ -209,7 +219,7 @@ grub_ieee1275_package_to_path (grub_ieee1275_phandle_t phandle,
|
||||
|
||||
args.actual = IEEE1275_VALUE(args.actual);
|
||||
if (actual)
|
||||
- *actual = args.actual;
|
||||
+ *actual = grub_ieee1275_cell2ssize(args.actual);
|
||||
if (args.actual == IEEE1275_CELL_INVALID)
|
||||
return -1;
|
||||
return 0;
|
||||
@@ -240,7 +250,7 @@ grub_ieee1275_instance_to_path (grub_ieee1275_ihandle_t ihandle,
|
||||
|
||||
args.actual = IEEE1275_VALUE(args.actual);
|
||||
if (actual)
|
||||
- *actual = args.actual;
|
||||
+ *actual = grub_ieee1275_cell2ssize(args.actual);
|
||||
if (args.actual == IEEE1275_CELL_INVALID)
|
||||
return -1;
|
||||
return 0;
|
||||
@@ -270,10 +280,11 @@ grub_ieee1275_write (grub_ieee1275_ihandle_t ihandle, const void *buffer,
|
||||
return -1;
|
||||
args.actual = IEEE1275_VALUE(args.actual);
|
||||
if (actualp)
|
||||
- *actualp = args.actual;
|
||||
+ *actualp = grub_ieee1275_cell2ssize(args.actual);
|
||||
return 0;
|
||||
}
|
||||
|
||||
+
|
||||
int
|
||||
grub_ieee1275_read (grub_ieee1275_ihandle_t ihandle, void *buffer,
|
||||
grub_size_t len, grub_ssize_t *actualp)
|
||||
@@ -297,8 +308,7 @@ grub_ieee1275_read (grub_ieee1275_ihandle_t ihandle, void *buffer,
|
||||
return -1;
|
||||
args.actual = IEEE1275_VALUE(args.actual);
|
||||
if (actualp)
|
||||
- *actualp = args.actual;
|
||||
-
|
||||
+ *actualp = grub_ieee1275_cell2ssize(args.actual);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -332,7 +342,7 @@ grub_ieee1275_seek (grub_ieee1275_ihandle_t ihandle, grub_disk_addr_t pos,
|
||||
|
||||
args.result = IEEE1275_VALUE(args.result);
|
||||
if (result)
|
||||
- *result = args.result;
|
||||
+ *result = grub_ieee1275_cell2ssize(args.result);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -353,7 +363,8 @@ grub_ieee1275_peer (grub_ieee1275_phandle_t node,
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
- *result = args.result = IEEE1275_VALUE(args.result);
|
||||
+ args.result = IEEE1275_VALUE(args.result);
|
||||
+ *result = grub_ieee1275_cell2ssize(args.result);
|
||||
if (args.result == 0)
|
||||
return -1;
|
||||
return 0;
|
||||
@@ -426,7 +437,7 @@ grub_ieee1275_interpret (const char *command, grub_ieee1275_cell_t *catch)
|
||||
return -1;
|
||||
args.catch = IEEE1275_VALUE(args.catch);
|
||||
if (catch)
|
||||
- *catch = args.catch;
|
||||
+ *catch = grub_ieee1275_cell2ssize(args.catch);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -576,7 +587,8 @@ grub_ieee1275_set_property (grub_ieee1275_phandle_t phandle,
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
- *actual = args.actual = IEEE1275_VALUE(args.actual);
|
||||
+ args.actual = IEEE1275_VALUE(args.actual);
|
||||
+ *actual = grub_ieee1275_cell2ssize(args.actual);
|
||||
if ((args.actual == IEEE1275_CELL_INVALID) || (args.actual != args.size))
|
||||
return -1;
|
||||
return 0;
|
||||
@@ -609,7 +621,7 @@ grub_ieee1275_set_color (grub_ieee1275_ihandle_t ihandle,
|
||||
|
||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||
return -1;
|
||||
- return IEEE1275_VALUE(args.catch_result);
|
||||
+ return (int) IEEE1275_VALUE(args.catch_result);
|
||||
}
|
||||
|
||||
int
|
@ -1,4 +1,42 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 10 16:35:08 UTC 2014 - dvaleev@suse.com
|
||||
|
||||
- Build GRUB2 for ppc64le as LittleEndian and 64bit
|
||||
- Fix timeout issue on ppc64le (bnc#869166)
|
||||
- Add powerpc-utils requires to grub2-powerpc-ieee1275
|
||||
|
||||
- added patches:
|
||||
* grub2-ppc64-build-ppc64-32bit.patch
|
||||
* grub2-ppc64-qemu.patch
|
||||
* grub2-ppc64le-01-Add-Little-Endian-support-for-Power64-to-the-build.patch
|
||||
* grub2-ppc64le-02-Build-grub-as-O1-until-we-add-savegpr-and-restgpr-ro.patch
|
||||
* grub2-ppc64le-03-disable-creation-of-vsx-and-altivec-instructions.patch
|
||||
* grub2-ppc64le-04-powerpc64-LE-s-linker-knows-how-to-handle-the-undefi.patch
|
||||
* grub2-ppc64le-05-grub-install-can-now-recognize-and-install-a-LE-grub.patch
|
||||
* grub2-ppc64le-06-set-the-ABI-version-to-0x02-in-the-e_flag-of-the-PPC.patch
|
||||
* grub2-ppc64le-07-Add-IEEE1275_ADDR-helper.patch
|
||||
* grub2-ppc64le-08-Fix-some-more-warnings-when-casting.patch
|
||||
* grub2-ppc64le-09-Add-powerpc64-types.patch
|
||||
* grub2-ppc64le-10-powerpc64-is-not-necessarily-BigEndian-anymore.patch
|
||||
* grub2-ppc64le-11-Fix-warnings-when-building-powerpc-linux-loader-64bi.patch
|
||||
* grub2-ppc64le-12-GRUB_ELF_R_PPC_-processing-is-applicable-only-for-32.patch
|
||||
* grub2-ppc64le-13-Fix-powerpc-setjmp-longjmp-64bit-issues.patch
|
||||
* grub2-ppc64le-14-Add-powerpc64-ieee1275-trampoline.patch
|
||||
* grub2-ppc64le-15-Add-64bit-support-to-powerpc-startup-code.patch
|
||||
* grub2-ppc64le-16-Add-grub_dl_find_section_addr.patch
|
||||
* grub2-ppc64le-17-Add-ppc64-relocations.patch
|
||||
* grub2-ppc64le-18-ppc64-doesn-t-need-libgcc-routines.patch
|
||||
* grub2-ppc64le-19-Use-FUNC_START-FUNC_END-for-powerpc-function-definit.patch
|
||||
* grub2-ppc64le-20-.TOC.-symbol-is-special-in-ppc64le-.-It-maps-to-the-.patch
|
||||
* grub2-ppc64le-21-the-.toc-section-in-powerpc64le-modules-are-sometime.patch
|
||||
* grub2-ppc64le-22-all-parameter-to-firmware-calls-should-to-be-BigEndi.patch
|
||||
* grub2-ppc64le-23-grub-segfaults-if-initrd-is-specified-before-specify.patch
|
||||
* grub2-ppc64le-timeout.patch
|
||||
- removed patches:
|
||||
* grub2-powerpc-libgcc.patch
|
||||
* grub2-ppc64le-core-bigendian.patch
|
||||
* grub2-ppc64le-platform.patch
|
||||
-------------------------------------------------------------------
|
||||
Thu Apr 10 07:39:30 UTC 2014 - mchang@suse.com
|
||||
|
||||
- add grub2-x86_64-xen subpackage (bnc#863821)
|
||||
|
62
grub2.spec
62
grub2.spec
@ -145,9 +145,34 @@ Patch102: 0003-cmdline-add-envvar-loader_cmdline_append.patch
|
||||
Patch103: 0004-btrfs-export-subvolume-envvars.patch
|
||||
Patch110: 0001-script-provide-overridable-root-by-subvol.patch
|
||||
Patch111: 0002-script-create-menus-for-btrfs-snapshot.patch
|
||||
Patch200: grub2-ppc64le-platform.patch
|
||||
Patch201: grub2-powerpc-libgcc.patch
|
||||
Patch202: grub2-ppc64le-core-bigendian.patch
|
||||
# PowerPC LE support
|
||||
Patch201: grub2-ppc64le-01-Add-Little-Endian-support-for-Power64-to-the-build.patch
|
||||
Patch202: grub2-ppc64le-02-Build-grub-as-O1-until-we-add-savegpr-and-restgpr-ro.patch
|
||||
Patch203: grub2-ppc64le-03-disable-creation-of-vsx-and-altivec-instructions.patch
|
||||
Patch204: grub2-ppc64le-04-powerpc64-LE-s-linker-knows-how-to-handle-the-undefi.patch
|
||||
Patch205: grub2-ppc64le-05-grub-install-can-now-recognize-and-install-a-LE-grub.patch
|
||||
Patch206: grub2-ppc64le-06-set-the-ABI-version-to-0x02-in-the-e_flag-of-the-PPC.patch
|
||||
Patch207: grub2-ppc64le-07-Add-IEEE1275_ADDR-helper.patch
|
||||
Patch208: grub2-ppc64le-08-Fix-some-more-warnings-when-casting.patch
|
||||
Patch209: grub2-ppc64le-09-Add-powerpc64-types.patch
|
||||
Patch210: grub2-ppc64le-10-powerpc64-is-not-necessarily-BigEndian-anymore.patch
|
||||
Patch211: grub2-ppc64le-11-Fix-warnings-when-building-powerpc-linux-loader-64bi.patch
|
||||
Patch212: grub2-ppc64le-12-GRUB_ELF_R_PPC_-processing-is-applicable-only-for-32.patch
|
||||
Patch213: grub2-ppc64le-13-Fix-powerpc-setjmp-longjmp-64bit-issues.patch
|
||||
Patch214: grub2-ppc64le-14-Add-powerpc64-ieee1275-trampoline.patch
|
||||
Patch215: grub2-ppc64le-15-Add-64bit-support-to-powerpc-startup-code.patch
|
||||
Patch216: grub2-ppc64le-16-Add-grub_dl_find_section_addr.patch
|
||||
Patch217: grub2-ppc64le-17-Add-ppc64-relocations.patch
|
||||
Patch218: grub2-ppc64le-18-ppc64-doesn-t-need-libgcc-routines.patch
|
||||
Patch219: grub2-ppc64le-19-Use-FUNC_START-FUNC_END-for-powerpc-function-definit.patch
|
||||
Patch220: grub2-ppc64le-20-.TOC.-symbol-is-special-in-ppc64le-.-It-maps-to-the-.patch
|
||||
Patch221: grub2-ppc64le-21-the-.toc-section-in-powerpc64le-modules-are-sometime.patch
|
||||
Patch222: grub2-ppc64le-22-all-parameter-to-firmware-calls-should-to-be-BigEndi.patch
|
||||
Patch223: grub2-ppc64le-23-grub-segfaults-if-initrd-is-specified-before-specify.patch
|
||||
Patch224: grub2-ppc64-build-ppc64-32bit.patch
|
||||
Patch225: grub2-ppc64-qemu.patch
|
||||
Patch226: grub2-ppc64le-timeout.patch
|
||||
|
||||
Requires: gettext-runtime
|
||||
%if 0%{?suse_version} >= 1140
|
||||
Requires: os-prober
|
||||
@ -202,6 +227,9 @@ Requires: %{name} = %{version}-%{release}
|
||||
Requires(post): %{name} = %{version}-%{release}
|
||||
Requires: perl-Bootloader
|
||||
Requires(post): perl-Bootloader
|
||||
%ifarch ppc64 ppc64le
|
||||
Requires: powerpc-utils
|
||||
%endif
|
||||
|
||||
%description %{grubarch}
|
||||
The GRand Unified Bootloader (GRUB) is a highly configurable and customizable
|
||||
@ -306,12 +334,32 @@ mv po/grub.pot po/%{name}.pot
|
||||
%patch103 -p1
|
||||
%patch110 -p1
|
||||
%patch111 -p1
|
||||
%patch200 -p1
|
||||
%patch201 -p1
|
||||
#We want to override endianess on Power LE only
|
||||
%ifarch ppc64le
|
||||
%patch202 -p1
|
||||
%endif
|
||||
%patch203 -p1
|
||||
%patch204 -p1
|
||||
%patch205 -p1
|
||||
%patch206 -p1
|
||||
%patch207 -p1
|
||||
%patch208 -p1
|
||||
%patch209 -p1
|
||||
%patch210 -p1
|
||||
%patch211 -p1
|
||||
%patch212 -p1
|
||||
%patch213 -p1
|
||||
%patch214 -p1
|
||||
%patch215 -p1
|
||||
%patch216 -p1
|
||||
%patch217 -p1
|
||||
%patch218 -p1
|
||||
%patch219 -p1
|
||||
%patch220 -p1
|
||||
%patch221 -p1
|
||||
%patch222 -p1
|
||||
%patch223 -p1
|
||||
%patch224 -p1
|
||||
%patch225 -p1
|
||||
%patch226 -p1
|
||||
|
||||
# Generate po/LINGUAS for message catalogs ...
|
||||
./linguas.sh
|
||||
|
Loading…
Reference in New Issue
Block a user