Only fix up powerpc key repeat on IEEE1275 machines. Fixes powerpc-emu

compilation.
This commit is contained in:
Colin Watson 2012-09-14 11:27:05 +01:00
parent 262c94c0e7
commit e3a69c7dc5
5 changed files with 59 additions and 4 deletions

2
debian/changelog vendored
View File

@ -1,6 +1,8 @@
grub2 (2.00-4) UNRELEASED; urgency=low
* Fix platform postinsts to handle new core.img location.
* Only fix up powerpc key repeat on IEEE1275 machines. Fixes powerpc-emu
compilation.
-- Colin Watson <cjwatson@debian.org> Fri, 14 Sep 2012 10:28:00 +0100

52
debian/patches/fix_powerpc_emu.patch vendored Normal file
View File

@ -0,0 +1,52 @@
Description: Only fix up powerpc key repeat on IEEE1275 machines.
Fixes powerpc-emu compilation.
Author: Colin Watson <cjwatson@ubuntu.com>
Origin: upstream, http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/4580
Forwarded: not-needed
Applied-Upstream: http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/4580
Last-Update: 2012-09-14
Index: b/grub-core/term/terminfo.c
===================================================================
--- a/grub-core/term/terminfo.c
+++ b/grub-core/term/terminfo.c
@@ -33,7 +33,7 @@
#include <grub/extcmd.h>
#include <grub/i18n.h>
#include <grub/time.h>
-#ifdef __powerpc__
+#if defined(__powerpc__) && defined(GRUB_MACHINE_IEEE1275)
#include <grub/ieee1275/ieee1275.h>
#endif
@@ -563,7 +563,7 @@
grub_terminfo_readkey (termi, data->input_buf,
&data->npending, data->readkey);
-#ifdef __powerpc__
+#if defined(__powerpc__) && defined(GRUB_MACHINE_IEEE1275)
if (data->npending == 1 && data->input_buf[0] == '\e'
&& grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_BROKEN_REPEAT)
&& grub_get_time_ms () - data->last_key_time < 1000
@@ -580,7 +580,7 @@
int ret;
data->npending--;
ret = data->input_buf[0];
-#ifdef __powerpc__
+#if defined(__powerpc__) && defined(GRUB_MACHINE_IEEE1275)
if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_BROKEN_REPEAT))
{
data->last_key = ret;
Index: b/include/grub/terminfo.h
===================================================================
--- a/include/grub/terminfo.h
+++ b/include/grub/terminfo.h
@@ -32,7 +32,7 @@
{
int input_buf[GRUB_TERMINFO_READKEY_MAX_LEN];
int npending;
-#ifdef __powerpc__
+#if defined(__powerpc__) && defined(GRUB_MACHINE_IEEE1275)
int last_key;
grub_uint64_t last_key_time;
#endif

View File

@ -16,3 +16,4 @@ restore_mkdevicemap.patch
efi_mmap_size.patch
gettext_quiet.patch
mkconfig_mid_upgrade.patch
fix_powerpc_emu.patch

View File

@ -33,7 +33,7 @@
#include <grub/extcmd.h>
#include <grub/i18n.h>
#include <grub/time.h>
#ifdef __powerpc__
#if defined(__powerpc__) && defined(GRUB_MACHINE_IEEE1275)
#include <grub/ieee1275/ieee1275.h>
#endif
@ -563,7 +563,7 @@ grub_terminfo_getkey (struct grub_term_input *termi)
grub_terminfo_readkey (termi, data->input_buf,
&data->npending, data->readkey);
#ifdef __powerpc__
#if defined(__powerpc__) && defined(GRUB_MACHINE_IEEE1275)
if (data->npending == 1 && data->input_buf[0] == '\e'
&& grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_BROKEN_REPEAT)
&& grub_get_time_ms () - data->last_key_time < 1000
@ -580,7 +580,7 @@ grub_terminfo_getkey (struct grub_term_input *termi)
int ret;
data->npending--;
ret = data->input_buf[0];
#ifdef __powerpc__
#if defined(__powerpc__) && defined(GRUB_MACHINE_IEEE1275)
if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_BROKEN_REPEAT))
{
data->last_key = ret;

View File

@ -32,7 +32,7 @@ struct grub_terminfo_input_state
{
int input_buf[GRUB_TERMINFO_READKEY_MAX_LEN];
int npending;
#ifdef __powerpc__
#if defined(__powerpc__) && defined(GRUB_MACHINE_IEEE1275)
int last_key;
grub_uint64_t last_key_time;
#endif