]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Simplify terminal check in loader/i386/efi/linux.c and loader/i386/linux.c
authorRobert Millan <rmh@aybabtu.com>
Thu, 7 Jan 2010 01:21:32 +0000 (01:21 +0000)
committerRobert Millan <rmh@aybabtu.com>
Thu, 7 Jan 2010 01:21:32 +0000 (01:21 +0000)
Revert loader/i386/ieee1275/linux.c change

loader/i386/efi/linux.c
loader/i386/ieee1275/linux.c
loader/i386/linux.c

index c6acab641d3a60543873932929866532629ea206..a1d08b3d7472aaa21e5aa9cc829c411a53f83b71 100644 (file)
@@ -697,7 +697,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
     grub_term_output_t term;
     int found = 0;
     FOR_ACTIVE_TERM_OUTPUTS(term)
-      if (grub_strcmp (term->name, "vga_text") == 0)
+      if (grub_strcmp (term->name, "vga_text") == 0
+         || grub_strcmp (term->name, "console") == 0)
        {
          grub_uint16_t pos = grub_term_getxy (term);
          params->video_cursor_x = pos >> 8;
@@ -705,18 +706,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
          params->video_width = grub_term_width (term);
          params->video_height = grub_term_height (term);
          found = 1;
+         break;
        }
-    if (!found)
-      FOR_ACTIVE_TERM_OUTPUTS(term)
-       if (grub_strcmp (term->name, "console") == 0)
-         {
-           grub_uint16_t pos = grub_term_getxy (term);
-           params->video_cursor_x = pos >> 8;
-           params->video_cursor_y = pos & 0xff;
-           params->video_width = grub_term_width (term);
-           params->video_height = grub_term_height (term);
-           found = 1;
-         }
     if (!found)
       {
        params->video_cursor_x = 0;
index 33076ea5bbd9073ca105b5187cdefa32447aeb14..e8a6f1a52036bd18ba46e1ebe9ac2f6d7b8feb08 100644 (file)
@@ -109,38 +109,8 @@ grub_linux_boot (void)
   params->cl_magic = GRUB_LINUX_CL_MAGIC;
   params->cl_offset = GRUB_OFW_LINUX_CL_OFFSET;
 
-  {
-    grub_term_output_t term;
-    int found = 0;
-    FOR_ACTIVE_TERM_OUTPUTS(term)
-      if (grub_strcmp (term->name, "vga_text") == 0)
-       {
-         grub_uint16_t pos = grub_term_getxy (term);
-         params->video_cursor_x = pos >> 8;
-         params->video_cursor_y = pos & 0xff;
-         params->video_width = grub_term_width (term);
-         params->video_height = grub_term_height (term);
-         found = 1;
-       }
-    if (!found)
-      FOR_ACTIVE_TERM_OUTPUTS(term)
-       if (grub_strcmp (term->name, "console") == 0)
-         {
-           grub_uint16_t pos = grub_term_getxy (term);
-           params->video_cursor_x = pos >> 8;
-           params->video_cursor_y = pos & 0xff;
-           params->video_width = grub_term_width (term);
-           params->video_height = grub_term_height (term);
-           found = 1;
-         }
-    if (!found)
-      {
-       params->video_cursor_x = 0;
-       params->video_cursor_y = 0;
-       params->video_width = 80;
-       params->video_height = 25;
-      }
-  }
+  params->video_width = (grub_getwh () >> 8);
+  params->video_height = (grub_getwh () & 0xff);
   params->font_size = 16;
 
   params->ofw_signature = GRUB_LINUX_OFW_SIGNATURE;
index c1649e9e6677be6c7be27d7a1a422ee38e253c5c..863090025eceda48dd7f062230741fab5baf11db 100644 (file)
@@ -551,21 +551,14 @@ grub_linux_boot (void)
       grub_term_output_t term;
       int found = 0;
       FOR_ACTIVE_TERM_OUTPUTS(term)
-       if (grub_strcmp (term->name, "vga_text") == 0)
-         {
-           grub_uint16_t pos = grub_term_getxy (term);
-           params->video_cursor_x = pos >> 8;
-           params->video_cursor_y = pos & 0xff;
-           found = 1;
-         }
-      if (!found)
-       FOR_ACTIVE_TERM_OUTPUTS(term)
-         if (grub_strcmp (term->name, "console") == 0)
+       if (grub_strcmp (term->name, "vga_text") == 0
+           || grub_strcmp (term->name, "console") == 0)
          {
            grub_uint16_t pos = grub_term_getxy (term);
            params->video_cursor_x = pos >> 8;
            params->video_cursor_y = pos & 0xff;
            found = 1;
+           break;
          }
       if (!found)
        {