SHA256
1
0
forked from pool/grub2
grub2/grub2-ppc64le-timeout.patch

130 lines
4.0 KiB
Diff
Raw Normal View History

Accepting request 229673 from 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 (forwarded request 229655 from k0da) OBS-URL: https://build.opensuse.org/request/show/229673 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/grub2?expand=0&rev=89
2014-04-12 21:28:53 +02:00
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