]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Eliminate grub_term_register_{input,output}_active. Default terminals are
authorRobert Millan <rmh@aybabtu.com>
Sat, 9 Jan 2010 22:42:17 +0000 (23:42 +0100)
committerRobert Millan <rmh@aybabtu.com>
Sat, 9 Jan 2010 22:42:17 +0000 (23:42 +0100)
automatically activated because they're the only terminal that has been loaded.

This solution is temporary.  In the future, all terminals should auto-enable,
but this is non-trivial due to resource conflict, and it shouldn't prevent
merge in trunk.

ChangeLog.multiterm
genterminallist.sh
include/grub/term.h
term/efi/console.c
term/gfxterm.c
term/i386/pc/at_keyboard.c
term/i386/pc/console.c
term/i386/pc/vga_text.c
term/ieee1275/ofconsole.c
util/console.c

index 3228f902aef44495ec909e2f82cb0b9971f7dc75..d16bb222263c7e8d7a820d8c83955e0e60445d50 100644 (file)
@@ -1,5 +1,5 @@
 2010-01-07  Vladimir Serbinenko  <phcoder@gmail.com>
-2010-01-07  Robert Millan  <rmh.grub@aybabtu.com>
+2010-01-09  Robert Millan  <rmh.grub@aybabtu.com>
 
        Support for multiple terminals.
 
@@ -58,8 +58,6 @@
        (grub_term_inputs_disabled): Likewise.
        (grub_term_outputs): Likewise.
        (grub_term_inputs): Likewise.
-       (grub_term_register_input_active): New function.
-       (grub_term_register_output_active): Likewise.
        (grub_term_register_input): Rewritten.
        (grub_term_register_output): Likewise.
        (grub_term_unregister_input): Likewise.
        * normal/menu_text.c: Likewise.
        * normal/menu_viewer.c: Removed. All users updated.
        * normal/term.c: New file.
-       * term/efi/console.c (grub_console_init): Use
-       grub_term_register_input_active and grub_term_register_output_active.
-       * term/gfxterm.c (GRUB_MOD_INIT) [GRUB_MACHINE_MIPS_YEELOONG]: Likewise.
-       * term/i386/pc/at_keyboard.c (GRUB_MOD_INIT)
-       [GRUB_MACHINE_MIPS_YEELOONG] || [GRUB_MACHINE_COREBOOT]
-       || [GRUB_MACHINE_QEMU]: Likewise.
-       * term/i386/pc/vga_text.c (GRUB_MOD_INIT) [GRUB_MACHINE_COREBOOT]
-       || [GRUB_MACHINE_QEMU]: Likewise.
-       * term/i386/pc/console.c (grub_console_init): Likewise.
-       * term/ieee1275/ofconsole.c (grub_console_init): Likewise.
        * util/console.c: Change order of includes to workaround a bug in
        ncurses headers.
-       (grub_console_init): Use
-       grub_term_register_input_active and grub_term_register_output_active.
        * term/terminfo.c: New argument oterm on all exported functions.
        All users updated.
        * util/grub-editenv.c (grub_term_input_class): Removed.
index eb0de0c32818339fae88cac70e4151f3d7b46b10..60f5b910538c08b7325c29e00af78ac818561fb9 100644 (file)
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-# Copyright (C) 2009  Free Software Foundation, Inc.
+# Copyright (C) 2009,2010  Free Software Foundation, Inc.
 #
 # This script is free software; the author
 # gives unlimited permission to copy and/or distribute it,
@@ -17,6 +17,4 @@ module=$1
 
 grep -v "^#" | sed -n \
  -e "/grub_term_register_input *( *\"/{s/.*( *\"\([^\"]*\)\".*/i\1: $module/;p;}" \
- -e "/grub_term_register_input_active *( *\"/{s/.*( *\"\([^\"]*\)\".*/i\1: $module/;p;}" \
  -e "/grub_term_register_output *( *\"/{s/.*( *\"\([^\"]*\)\".*/o\1: $module/;p;}" \
- -e "/grub_term_register_output_active *( *\"/{s/.*( *\"\([^\"]*\)\".*/o\1: $module/;p;}"
index 1c57a4ede4b608ab0584564235806f98a07b537f..3d644b84826baf34e95ed4fd7a2933f450c95276 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2002,2003,2005,2007,2008,2009  Free Software Foundation, Inc.
+ *  Copyright (C) 2002,2003,2005,2007,2008,2009,2010  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
@@ -198,38 +198,37 @@ extern struct grub_term_input *EXPORT_VAR(grub_term_inputs_disabled);
 extern struct grub_term_output *EXPORT_VAR(grub_term_outputs);
 extern struct grub_term_input *EXPORT_VAR(grub_term_inputs);
 
-static inline void
-grub_term_register_input_active (const char *name __attribute__ ((unused)),
-                                grub_term_input_t term)
-{
-  if (term->init)
-    term->init ();
-  grub_list_push (GRUB_AS_LIST_P (&grub_term_inputs), GRUB_AS_LIST (term));
-}
-
 static inline void
 grub_term_register_input (const char *name __attribute__ ((unused)),
                          grub_term_input_t term)
 {
-  grub_list_push (GRUB_AS_LIST_P (&grub_term_inputs_disabled),
-                 GRUB_AS_LIST (term));
-}
-
-static inline void
-grub_term_register_output_active (const char *name __attribute__ ((unused)),
-                                 grub_term_output_t term)
-{
-  if (term->init)
-    term->init ();
-  grub_list_push (GRUB_AS_LIST_P (&grub_term_outputs), GRUB_AS_LIST (term));
+  if (grub_term_inputs)
+    grub_list_push (GRUB_AS_LIST_P (&grub_term_inputs_disabled),
+                   GRUB_AS_LIST (term));
+  else
+    {
+      /* If this is the first terminal, enable automatically.  */
+      if (term->init)
+        term->init ();
+      grub_list_push (GRUB_AS_LIST_P (&grub_term_inputs), GRUB_AS_LIST (term));
+    }
 }
 
 static inline void
 grub_term_register_output (const char *name __attribute__ ((unused)),
                           grub_term_output_t term)
 {
-  grub_list_push (GRUB_AS_LIST_P (&grub_term_outputs_disabled),
-                 GRUB_AS_LIST (term));
+  if (grub_term_outputs)
+    grub_list_push (GRUB_AS_LIST_P (&grub_term_outputs_disabled),
+                   GRUB_AS_LIST (term));
+  else
+    {
+      /* If this is the first terminal, enable automatically.  */
+      if (term->init)
+       term->init ();
+      grub_list_push (GRUB_AS_LIST_P (&grub_term_outputs),
+                     GRUB_AS_LIST (term));
+    }
 }
 
 static inline void
index dc07c401e644f891352e4cac90fc76f0bc7a541d..264770cae41d52852e9a4e7bef0832bc0c331853 100644 (file)
@@ -365,8 +365,8 @@ grub_console_init (void)
       return;
     }
 
-  grub_term_register_input_active ("console", &grub_console_term_input);
-  grub_term_register_output_active ("console", &grub_console_term_output);
+  grub_term_register_input ("console", &grub_console_term_input);
+  grub_term_register_output ("console", &grub_console_term_output);
 }
 
 void
index 2a7886aa094ec13e62d4119974f5a9be67b02f30..fa19a5d85e2e09182a4aa2852202a0e62dbc65ac 100644 (file)
@@ -953,11 +953,7 @@ static grub_command_t cmd;
 
 GRUB_MOD_INIT(term_gfxterm)
 {
-#ifdef GRUB_MACHINE_MIPS_YEELOONG
-  grub_term_register_output_active ("gfxterm", &grub_video_term);
-#else
   grub_term_register_output ("gfxterm", &grub_video_term);
-#endif
   cmd = grub_register_command ("background_image",
                               grub_gfxterm_background_image_cmd,
                               0, "Load background image for active terminal.");
index 594ed678730c11cda406a3bcb7537c87fe69162b..6382c954a5976d20a9123db23a07f55b8bbc2984 100644 (file)
@@ -278,11 +278,7 @@ static struct grub_term_input grub_at_keyboard_term =
 
 GRUB_MOD_INIT(at_keyboard)
 {
-#if defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_QEMU) || defined (GRUB_MACHINE_MIPS_YEELOONG)
-  grub_term_register_input_active ("at_keyboard", &grub_at_keyboard_term);
-#else
   grub_term_register_input ("at_keyboard", &grub_at_keyboard_term);
-#endif
 }
 
 GRUB_MOD_FINI(at_keyboard)
index 3c0fcccad6141745a4bfcd4ed2a775f1ab9245ed..43cfe2f2a764c56de0e6647f1d8fb17a4d66423e 100644 (file)
@@ -71,8 +71,8 @@ static struct grub_term_output grub_console_term_output =
 void
 grub_console_init (void)
 {
-  grub_term_register_output_active ("console", &grub_console_term_output);
-  grub_term_register_input_active ("console", &grub_console_term_input);
+  grub_term_register_output ("console", &grub_console_term_output);
+  grub_term_register_input ("console", &grub_console_term_input);
 }
 
 void
index 01191cef0da80b598e731c714c978ccc348907e3..170f74de8eaf58a56a6beb1e709d66beb8649b4a 100644 (file)
@@ -163,16 +163,12 @@ static struct grub_term_output grub_vga_text_term =
     .setcolorstate = grub_console_setcolorstate,
     .setcolor = grub_console_setcolor,
     .getcolor = grub_console_getcolor,
-    .setcursor = grub_vga_text_setcursor
+    .setcursor = grub_vga_text_setcursor,
   };
 
 GRUB_MOD_INIT(vga_text)
 {
-#if defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_QEMU)
-  grub_term_register_output_active ("vga_text", &grub_vga_text_term);
-#else
   grub_term_register_output ("vga_text", &grub_vga_text_term);
-#endif
 }
 
 GRUB_MOD_FINI(vga_text)
index 44cbb763d7acf30ad72d94800a9546f616dd4829..3977c6286da9a7bbe600ae0e025b6350fc3774fb 100644 (file)
@@ -420,8 +420,8 @@ static struct grub_term_output grub_ofconsole_term_output =
 void
 grub_console_init (void)
 {
-  grub_term_register_input_active ("ofconsole", &grub_ofconsole_term_input);
-  grub_term_register_output_active ("ofconsole", &grub_ofconsole_term_output);
+  grub_term_register_input ("ofconsole", &grub_ofconsole_term_input);
+  grub_term_register_output ("ofconsole", &grub_ofconsole_term_output);
 }
 
 void
index 73195765e4a8ef9b8acb56f0d66bcc3ddfee6165..382fd7f891ae9b91ae7c397d2da9808b1647bea8 100644 (file)
@@ -373,8 +373,8 @@ static struct grub_term_output grub_ncurses_term_output =
 void
 grub_console_init (void)
 {
-  grub_term_register_output_active ("console", &grub_ncurses_term_output);
-  grub_term_register_input_active ("console", &grub_ncurses_term_input);
+  grub_term_register_output ("console", &grub_ncurses_term_output);
+  grub_term_register_input ("console", &grub_ncurses_term_input);
 }
 
 void