Blame SOURCES/0133-Make-color-variables-global-instead-of-it-being-per-.patch

f96e0b
From 4313186239f13535bbf6c7b7a2a80cd1b8a832d2 Mon Sep 17 00:00:00 2001
f96e0b
From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
f96e0b
Date: Mon, 21 Jan 2013 17:53:41 +0100
f96e0b
Subject: [PATCH 133/482] 	Make color variables global instead of it
f96e0b
 being per-terminal.
f96e0b
f96e0b
---
f96e0b
 ChangeLog                         |  6 +++---
f96e0b
 docs/grub.texi                    | 33 +++++++++++++++++++++++++++++++++
f96e0b
 grub-core/kern/term.c             |  4 ++++
f96e0b
 grub-core/normal/color.c          |  9 ++-------
f96e0b
 grub-core/normal/menu_text.c      | 24 +++++++++++++++---------
f96e0b
 grub-core/term/arc/console.c      |  2 --
f96e0b
 grub-core/term/efi/console.c      |  9 ++++-----
f96e0b
 grub-core/term/emu/console.c      |  4 ++--
f96e0b
 grub-core/term/gfxterm.c          |  8 +++-----
f96e0b
 grub-core/term/i386/pc/console.c  |  9 ++++-----
f96e0b
 grub-core/term/i386/pc/vga_text.c | 10 ++++------
f96e0b
 grub-core/term/ieee1275/console.c |  2 --
f96e0b
 grub-core/term/morse.c            |  2 --
f96e0b
 grub-core/term/serial.c           |  2 --
f96e0b
 grub-core/term/spkmodem.c         |  2 --
f96e0b
 grub-core/term/terminfo.c         |  8 ++++----
f96e0b
 include/grub/term.h               | 26 ++++----------------------
f96e0b
 17 files changed, 82 insertions(+), 78 deletions(-)
f96e0b
f96e0b
diff --git a/ChangeLog b/ChangeLog
f96e0b
index 35267f5..32b891a 100644
f96e0b
--- a/ChangeLog
f96e0b
+++ b/ChangeLog
f96e0b
@@ -1,11 +1,11 @@
f96e0b
 2013-01-21  Vladimir Serbinenko  <phcoder@gmail.com>
f96e0b
 
f96e0b
-	* grub-core/commands/ls.c (grub_ls_print_devices): Add missing
f96e0b
-	asterisk.
f96e0b
+	Make color variables global instead of it being per-terminal.
f96e0b
 
f96e0b
 2013-01-21  Vladimir Serbinenko  <phcoder@gmail.com>
f96e0b
 
f96e0b
-	Make color variables global instead of it being per-terminal.
f96e0b
+	* grub-core/commands/ls.c (grub_ls_print_devices): Add missing
f96e0b
+	asterisk.
f96e0b
 
f96e0b
 2013-01-21  Colin Watson  <cjwatson@ubuntu.com>
f96e0b
 
f96e0b
diff --git a/docs/grub.texi b/docs/grub.texi
f96e0b
index b177111..9941b47 100644
f96e0b
--- a/docs/grub.texi
f96e0b
+++ b/docs/grub.texi
f96e0b
@@ -2776,6 +2776,33 @@ those colors.  Each color must be a name from the following list:
f96e0b
 
f96e0b
 The default is @samp{white/black}.
f96e0b
 
f96e0b
+The color support support varies from terminal to terminal.
f96e0b
+
f96e0b
+@samp{morse} has no color support at all.
f96e0b
+
f96e0b
+@samp{mda_text} color support is limited to highlighting by
f96e0b
+black/white reversal.
f96e0b
+
f96e0b
+@samp{console} on ARC and IEEE1275, @samp{serial_*} and
f96e0b
+@samp{spkmodem} are governed by terminfo and support
f96e0b
+only 8 colors if in modes @samp{vt100-color}, @samp{arc}
f96e0b
+(default for console on ARC), @samp{ieee1275} (default
f96e0b
+for console on IEEE1275). When in mode @samp{vt100}
f96e0b
+then the color support is limited to highlighting by black/white
f96e0b
+reversal. When in mode @samp{dumb} there is no color support.
f96e0b
+
f96e0b
+@samp{console} on EMU supports 8 colors.
f96e0b
+
f96e0b
+When console supports no colors this setting is ignored.
f96e0b
+When console supports 8 colors, then the colors from the
f96e0b
+second half of the previous list are mapped to the
f96e0b
+matching colors of first half.
f96e0b
+
f96e0b
+@samp{console} on EFI and BIOS and @samp{vga_text} support all 16 colors.
f96e0b
+
f96e0b
+@samp{gfxterm} supports all 16 colors and would be theoretically extendable
f96e0b
+to support whole rgb24 palette but currently there is no compelling reason
f96e0b
+to go beyond the current 16 colors.
f96e0b
 
f96e0b
 @node debug
f96e0b
 @subsection debug
f96e0b
@@ -4355,6 +4382,8 @@ AT keyboard support allows keyboard layout remapping and support for keys not
f96e0b
 available through firmware. It isn't needed for normal operation except
f96e0b
 baremetal ports.
f96e0b
 
f96e0b
+Speaker allows morse and spkmodem communication.
f96e0b
+
f96e0b
 USB support provides benefits similar to ATA (for USB disks) or AT (for USB
f96e0b
 keyboards). In addition it allows USBserial.
f96e0b
 
f96e0b
@@ -4376,6 +4405,7 @@ and mips-qemu_mips can use only memory up to first hole.
f96e0b
 @item network            @tab yes (*) @tab no       @tab no           @tab no
f96e0b
 @item ATA/AHCI           @tab yes     @tab yes      @tab yes          @tab yes
f96e0b
 @item AT keyboard        @tab yes     @tab yes      @tab yes          @tab yes
f96e0b
+@item Speaker            @tab yes     @tab yes      @tab yes          @tab yes
f96e0b
 @item USB                @tab yes     @tab yes      @tab yes          @tab yes
f96e0b
 @item chainloader        @tab local   @tab yes      @tab yes          @tab no
f96e0b
 @item cpuid              @tab partial @tab partial  @tab partial      @tab partial
f96e0b
@@ -4393,6 +4423,7 @@ and mips-qemu_mips can use only memory up to first hole.
f96e0b
 @item network            @tab yes         @tab yes       @tab yes           @tab yes
f96e0b
 @item ATA/AHCI           @tab yes         @tab yes       @tab yes           @tab no
f96e0b
 @item AT keyboard        @tab yes         @tab yes       @tab yes           @tab no
f96e0b
+@item Speaker            @tab yes         @tab yes       @tab yes           @tab no
f96e0b
 @item USB                @tab yes         @tab yes       @tab yes           @tab no
f96e0b
 @item chainloader        @tab local       @tab local     @tab no            @tab local
f96e0b
 @item cpuid              @tab partial     @tab partial   @tab partial       @tab no
f96e0b
@@ -4410,6 +4441,7 @@ and mips-qemu_mips can use only memory up to first hole.
f96e0b
 @item network            @tab no          @tab yes (*) @tab yes     @tab no
f96e0b
 @item ATA/AHCI           @tab yes         @tab no      @tab no      @tab no
f96e0b
 @item AT keyboard        @tab yes         @tab no      @tab no      @tab no
f96e0b
+@item Speaker            @tab no          @tab no      @tab no      @tab no
f96e0b
 @item USB                @tab yes         @tab no      @tab no      @tab no
f96e0b
 @item chainloader        @tab yes         @tab no      @tab no      @tab no
f96e0b
 @item cpuid              @tab no          @tab no      @tab no      @tab no
f96e0b
@@ -4427,6 +4459,7 @@ and mips-qemu_mips can use only memory up to first hole.
f96e0b
 @item network            @tab no        @tab yes
f96e0b
 @item ATA/AHCI           @tab yes       @tab no
f96e0b
 @item AT keyboard        @tab yes       @tab no
f96e0b
+@item Speaker            @tab no        @tab no
f96e0b
 @item USB                @tab N/A       @tab yes
f96e0b
 @item chainloader        @tab yes       @tab no
f96e0b
 @item cpuid              @tab no        @tab no
f96e0b
diff --git a/grub-core/kern/term.c b/grub-core/kern/term.c
f96e0b
index 5014caf..34096bc 100644
f96e0b
--- a/grub-core/kern/term.c
f96e0b
+++ b/grub-core/kern/term.c
f96e0b
@@ -28,6 +28,10 @@ struct grub_term_input *grub_term_inputs_disabled;
f96e0b
 struct grub_term_output *grub_term_outputs;
f96e0b
 struct grub_term_input *grub_term_inputs;
f96e0b
 
f96e0b
+/* Current color state.  */
f96e0b
+grub_uint8_t grub_term_normal_color;
f96e0b
+grub_uint8_t grub_term_highlight_color;
f96e0b
+
f96e0b
 void (*grub_term_poll_usb) (void) = NULL;
f96e0b
 void (*grub_net_poll_cards_idle) (void) = NULL;
f96e0b
 
f96e0b
diff --git a/grub-core/normal/color.c b/grub-core/normal/color.c
f96e0b
index 06f1a87..c265423 100644
f96e0b
--- a/grub-core/normal/color.c
f96e0b
+++ b/grub-core/normal/color.c
f96e0b
@@ -106,8 +106,6 @@ free_and_return:
f96e0b
   return result;
f96e0b
 }
f96e0b
 
f96e0b
-static grub_uint8_t color_normal, color_highlight;
f96e0b
-
f96e0b
 static void
f96e0b
 set_colors (void)
f96e0b
 {
f96e0b
@@ -115,9 +113,6 @@ set_colors (void)
f96e0b
 
f96e0b
   FOR_ACTIVE_TERM_OUTPUTS(term)
f96e0b
   {
f96e0b
-    /* Reloads terminal `normal' and `highlight' colors.  */
f96e0b
-    grub_term_setcolor (term, color_normal, color_highlight);
f96e0b
-
f96e0b
     /* Propagates `normal' color to terminal current color.  */
f96e0b
     grub_term_setcolorstate (term, GRUB_TERM_COLOR_NORMAL);
f96e0b
   }
f96e0b
@@ -128,7 +123,7 @@ char *
f96e0b
 grub_env_write_color_normal (struct grub_env_var *var __attribute__ ((unused)),
f96e0b
 			     const char *val)
f96e0b
 {
f96e0b
-  if (grub_parse_color_name_pair (&color_normal, val))
f96e0b
+  if (grub_parse_color_name_pair (&grub_term_normal_color, val))
f96e0b
     return NULL;
f96e0b
 
f96e0b
   set_colors ();
f96e0b
@@ -141,7 +136,7 @@ char *
f96e0b
 grub_env_write_color_highlight (struct grub_env_var *var __attribute__ ((unused)),
f96e0b
 				const char *val)
f96e0b
 {
f96e0b
-  if (grub_parse_color_name_pair (&color_highlight, val))
f96e0b
+  if (grub_parse_color_name_pair (&grub_term_highlight_color, val))
f96e0b
     return NULL;
f96e0b
 
f96e0b
   set_colors ();
f96e0b
diff --git a/grub-core/normal/menu_text.c b/grub-core/normal/menu_text.c
f96e0b
index 1687c28..80a7cd9 100644
f96e0b
--- a/grub-core/normal/menu_text.c
f96e0b
+++ b/grub-core/normal/menu_text.c
f96e0b
@@ -225,8 +225,10 @@ print_entry (int y, int highlight, grub_menu_entry_t entry,
f96e0b
       return;
f96e0b
     }
f96e0b
 
f96e0b
-  grub_term_getcolor (term, &old_color_normal, &old_color_highlight);
f96e0b
-  grub_term_setcolor (term, grub_color_menu_normal, grub_color_menu_highlight);
f96e0b
+  old_color_normal = grub_term_normal_color;
f96e0b
+  old_color_highlight = grub_term_highlight_color;
f96e0b
+  grub_term_normal_color = grub_color_menu_normal;
f96e0b
+  grub_term_highlight_color = grub_color_menu_highlight;
f96e0b
   grub_term_setcolorstate (term, highlight
f96e0b
 			   ? GRUB_TERM_COLOR_HIGHLIGHT
f96e0b
 			   : GRUB_TERM_COLOR_NORMAL);
f96e0b
@@ -293,7 +295,9 @@ print_entry (int y, int highlight, grub_menu_entry_t entry,
f96e0b
 
f96e0b
   grub_term_gotoxy (term, grub_term_cursor_x (term), y);
f96e0b
 
f96e0b
-  grub_term_setcolor (term, old_color_normal, old_color_highlight);
f96e0b
+  grub_term_normal_color = old_color_normal;
f96e0b
+  grub_term_highlight_color = old_color_highlight;
f96e0b
+
f96e0b
   grub_term_setcolorstate (term, GRUB_TERM_COLOR_NORMAL);
f96e0b
   grub_free (unicode_title);
f96e0b
 }
f96e0b
@@ -349,11 +353,11 @@ grub_menu_init_page (int nested, int edit, int *num_entries,
f96e0b
   *num_entries = grub_term_height (term) - GRUB_TERM_TOP_BORDER_Y
f96e0b
     - (print_message (nested, edit, term, 1) + 3) - 2;
f96e0b
 
f96e0b
-  grub_term_getcolor (term, &old_color_normal, &old_color_highlight);
f96e0b
-
f96e0b
   /* By default, use the same colors for the menu.  */
f96e0b
-  grub_color_menu_normal = old_color_normal;
f96e0b
-  grub_color_menu_highlight = old_color_highlight;
f96e0b
+  old_color_normal = grub_term_normal_color;
f96e0b
+  old_color_highlight = grub_term_highlight_color;
f96e0b
+  grub_color_menu_normal = grub_term_normal_color;
f96e0b
+  grub_color_menu_highlight = grub_color_menu_highlight;
f96e0b
 
f96e0b
   /* Then give user a chance to replace them.  */
f96e0b
   grub_parse_color_name_pair (&grub_color_menu_normal,
f96e0b
@@ -362,9 +366,11 @@ grub_menu_init_page (int nested, int edit, int *num_entries,
f96e0b
 			      grub_env_get ("menu_color_highlight"));
f96e0b
 
f96e0b
   grub_normal_init_page (term);
f96e0b
-  grub_term_setcolor (term, grub_color_menu_normal, grub_color_menu_highlight);
f96e0b
+  grub_term_normal_color = grub_color_menu_normal;
f96e0b
+  grub_term_highlight_color = grub_color_menu_highlight;
f96e0b
   draw_border (term, *num_entries);
f96e0b
-  grub_term_setcolor (term, old_color_normal, old_color_highlight);
f96e0b
+  grub_term_normal_color = old_color_normal;
f96e0b
+  grub_term_highlight_color = old_color_highlight;
f96e0b
   print_message (nested, edit, term, 0);
f96e0b
 }
f96e0b
 
f96e0b
diff --git a/grub-core/term/arc/console.c b/grub-core/term/arc/console.c
f96e0b
index 45ff267..0ccaebe 100644
f96e0b
--- a/grub-core/term/arc/console.c
f96e0b
+++ b/grub-core/term/arc/console.c
f96e0b
@@ -102,8 +102,6 @@ static struct grub_term_output grub_console_term_output =
f96e0b
     .setcursor = grub_terminfo_setcursor,
f96e0b
     .flags = GRUB_TERM_CODE_TYPE_ASCII,
f96e0b
     .data = &grub_console_terminfo_output,
f96e0b
-    .normal_color = GRUB_TERM_DEFAULT_NORMAL_COLOR,
f96e0b
-    .highlight_color = GRUB_TERM_DEFAULT_HIGHLIGHT_COLOR,
f96e0b
   };
f96e0b
 
f96e0b
 void
f96e0b
diff --git a/grub-core/term/efi/console.c b/grub-core/term/efi/console.c
f96e0b
index e57a815..2d6c6f9 100644
f96e0b
--- a/grub-core/term/efi/console.c
f96e0b
+++ b/grub-core/term/efi/console.c
f96e0b
@@ -192,7 +192,8 @@ grub_console_cls (struct grub_term_output *term __attribute__ ((unused)))
f96e0b
 }
f96e0b
 
f96e0b
 static void
f96e0b
-grub_console_setcolorstate (struct grub_term_output *term,
f96e0b
+grub_console_setcolorstate (struct grub_term_output *term
f96e0b
+			    __attribute__ ((unused)),
f96e0b
 			    grub_term_color_state state)
f96e0b
 {
f96e0b
   grub_efi_simple_text_output_interface_t *o;
f96e0b
@@ -208,10 +209,10 @@ grub_console_setcolorstate (struct grub_term_output *term,
f96e0b
 		  & 0x7f);
f96e0b
       break;
f96e0b
     case GRUB_TERM_COLOR_NORMAL:
f96e0b
-      efi_call_2 (o->set_attributes, o, term->normal_color & 0x7f);
f96e0b
+      efi_call_2 (o->set_attributes, o, grub_term_normal_color & 0x7f);
f96e0b
       break;
f96e0b
     case GRUB_TERM_COLOR_HIGHLIGHT:
f96e0b
-      efi_call_2 (o->set_attributes, o, term->highlight_color & 0x7f);
f96e0b
+      efi_call_2 (o->set_attributes, o, grub_term_highlight_color & 0x7f);
f96e0b
       break;
f96e0b
     default:
f96e0b
       break;
f96e0b
@@ -265,8 +266,6 @@ static struct grub_term_output grub_console_term_output =
f96e0b
     .cls = grub_console_cls,
f96e0b
     .setcolorstate = grub_console_setcolorstate,
f96e0b
     .setcursor = grub_console_setcursor,
f96e0b
-    .normal_color = GRUB_TERM_DEFAULT_NORMAL_COLOR,
f96e0b
-    .highlight_color = GRUB_TERM_DEFAULT_HIGHLIGHT_COLOR,
f96e0b
     .flags = GRUB_TERM_CODE_TYPE_VISUAL_GLYPHS
f96e0b
   };
f96e0b
 
f96e0b
diff --git a/grub-core/term/emu/console.c b/grub-core/term/emu/console.c
f96e0b
index 55e3a6b..5bd5db1 100644
f96e0b
--- a/grub-core/term/emu/console.c
f96e0b
+++ b/grub-core/term/emu/console.c
f96e0b
@@ -82,11 +82,11 @@ grub_ncurses_setcolorstate (struct grub_term_output *term,
f96e0b
       grub_console_attr = A_NORMAL;
f96e0b
       break;
f96e0b
     case GRUB_TERM_COLOR_NORMAL:
f96e0b
-      grub_console_cur_color = term->normal_color;
f96e0b
+      grub_console_cur_color = grub_term_normal_color;
f96e0b
       grub_console_attr = A_NORMAL;
f96e0b
       break;
f96e0b
     case GRUB_TERM_COLOR_HIGHLIGHT:
f96e0b
-      grub_console_cur_color = term->highlight_color;
f96e0b
+      grub_console_cur_color = grub_term_highlight_color;
f96e0b
       grub_console_attr = A_STANDOUT;
f96e0b
       break;
f96e0b
     default:
f96e0b
diff --git a/grub-core/term/gfxterm.c b/grub-core/term/gfxterm.c
f96e0b
index 12567d1..a168e01 100644
f96e0b
--- a/grub-core/term/gfxterm.c
f96e0b
+++ b/grub-core/term/gfxterm.c
f96e0b
@@ -1036,7 +1036,7 @@ grub_gfxterm_cls (struct grub_term_output *term)
f96e0b
 }
f96e0b
 
f96e0b
 static void
f96e0b
-grub_virtual_screen_setcolorstate (struct grub_term_output *term,
f96e0b
+grub_virtual_screen_setcolorstate (struct grub_term_output *term __attribute__ ((unused)),
f96e0b
 				   grub_term_color_state state)
f96e0b
 {
f96e0b
   switch (state)
f96e0b
@@ -1046,11 +1046,11 @@ grub_virtual_screen_setcolorstate (struct grub_term_output *term,
f96e0b
       break;
f96e0b
 
f96e0b
     case GRUB_TERM_COLOR_NORMAL:
f96e0b
-      virtual_screen.term_color = term->normal_color;
f96e0b
+      virtual_screen.term_color = grub_term_normal_color;
f96e0b
       break;
f96e0b
 
f96e0b
     case GRUB_TERM_COLOR_HIGHLIGHT:
f96e0b
-      virtual_screen.term_color = term->highlight_color;
f96e0b
+      virtual_screen.term_color = grub_term_highlight_color;
f96e0b
       break;
f96e0b
 
f96e0b
     default:
f96e0b
@@ -1246,8 +1246,6 @@ static struct grub_term_output grub_video_term =
f96e0b
     .refresh = grub_gfxterm_refresh,
f96e0b
     .fullscreen = grub_gfxterm_fullscreen,
f96e0b
     .flags = GRUB_TERM_CODE_TYPE_VISUAL_GLYPHS,
f96e0b
-    .normal_color = GRUB_TERM_DEFAULT_NORMAL_COLOR,
f96e0b
-    .highlight_color = GRUB_TERM_DEFAULT_HIGHLIGHT_COLOR,
f96e0b
     .next = 0
f96e0b
   };
f96e0b
 
f96e0b
diff --git a/grub-core/term/i386/pc/console.c b/grub-core/term/i386/pc/console.c
f96e0b
index a681435..2aa1943 100644
f96e0b
--- a/grub-core/term/i386/pc/console.c
f96e0b
+++ b/grub-core/term/i386/pc/console.c
f96e0b
@@ -259,7 +259,8 @@ grub_console_getwh (struct grub_term_output *term __attribute__ ((unused)))
f96e0b
 }
f96e0b
 
f96e0b
 static void
f96e0b
-grub_console_setcolorstate (struct grub_term_output *term,
f96e0b
+grub_console_setcolorstate (struct grub_term_output *term
f96e0b
+			    __attribute__ ((unused)),
f96e0b
 			    grub_term_color_state state)
f96e0b
 {
f96e0b
   switch (state) {
f96e0b
@@ -267,10 +268,10 @@ grub_console_setcolorstate (struct grub_term_output *term,
f96e0b
       grub_console_cur_color = GRUB_TERM_DEFAULT_STANDARD_COLOR & 0x7f;
f96e0b
       break;
f96e0b
     case GRUB_TERM_COLOR_NORMAL:
f96e0b
-      grub_console_cur_color = term->normal_color & 0x7f;
f96e0b
+      grub_console_cur_color = grub_term_normal_color & 0x7f;
f96e0b
       break;
f96e0b
     case GRUB_TERM_COLOR_HIGHLIGHT:
f96e0b
-      grub_console_cur_color = term->highlight_color & 0x7f;
f96e0b
+      grub_console_cur_color = grub_term_highlight_color & 0x7f;
f96e0b
       break;
f96e0b
     default:
f96e0b
       break;
f96e0b
@@ -295,8 +296,6 @@ static struct grub_term_output grub_console_term_output =
f96e0b
     .setcolorstate = grub_console_setcolorstate,
f96e0b
     .setcursor = grub_console_setcursor,
f96e0b
     .flags = GRUB_TERM_CODE_TYPE_CP437,
f96e0b
-    .normal_color = GRUB_TERM_DEFAULT_NORMAL_COLOR,
f96e0b
-    .highlight_color = GRUB_TERM_DEFAULT_HIGHLIGHT_COLOR,
f96e0b
   };
f96e0b
 
f96e0b
 void
f96e0b
diff --git a/grub-core/term/i386/pc/vga_text.c b/grub-core/term/i386/pc/vga_text.c
f96e0b
index 74c155c..e976aec 100644
f96e0b
--- a/grub-core/term/i386/pc/vga_text.c
f96e0b
+++ b/grub-core/term/i386/pc/vga_text.c
f96e0b
@@ -209,18 +209,18 @@ grub_vga_text_getwh (struct grub_term_output *term __attribute__ ((unused)))
f96e0b
 #ifndef MODE_MDA
f96e0b
 
f96e0b
 static void
f96e0b
-grub_vga_text_setcolorstate (struct grub_term_output *term,
f96e0b
-			    grub_term_color_state state)
f96e0b
+grub_vga_text_setcolorstate (struct grub_term_output *term __attribute__ ((unused)),
f96e0b
+			     grub_term_color_state state)
f96e0b
 {
f96e0b
   switch (state) {
f96e0b
     case GRUB_TERM_COLOR_STANDARD:
f96e0b
       cur_color = GRUB_TERM_DEFAULT_STANDARD_COLOR & 0x7f;
f96e0b
       break;
f96e0b
     case GRUB_TERM_COLOR_NORMAL:
f96e0b
-      cur_color = term->normal_color & 0x7f;
f96e0b
+      cur_color = grub_term_normal_color & 0x7f;
f96e0b
       break;
f96e0b
     case GRUB_TERM_COLOR_HIGHLIGHT:
f96e0b
-      cur_color = term->highlight_color & 0x7f;
f96e0b
+      cur_color = grub_term_highlight_color & 0x7f;
f96e0b
       break;
f96e0b
     default:
f96e0b
       break;
f96e0b
@@ -265,8 +265,6 @@ static struct grub_term_output grub_vga_text_term =
f96e0b
     .setcolorstate = grub_vga_text_setcolorstate,
f96e0b
     .setcursor = grub_vga_text_setcursor,
f96e0b
     .flags = GRUB_TERM_CODE_TYPE_CP437,
f96e0b
-    .normal_color = GRUB_TERM_DEFAULT_NORMAL_COLOR,
f96e0b
-    .highlight_color = GRUB_TERM_DEFAULT_HIGHLIGHT_COLOR,
f96e0b
   };
f96e0b
 
f96e0b
 #ifdef MODE_MDA
f96e0b
diff --git a/grub-core/term/ieee1275/console.c b/grub-core/term/ieee1275/console.c
f96e0b
index 93b81f4..3a80864 100644
f96e0b
--- a/grub-core/term/ieee1275/console.c
f96e0b
+++ b/grub-core/term/ieee1275/console.c
f96e0b
@@ -229,8 +229,6 @@ static struct grub_term_output grub_console_term_output =
f96e0b
     .setcursor = grub_console_setcursor,
f96e0b
     .flags = GRUB_TERM_CODE_TYPE_ASCII,
f96e0b
     .data = &grub_console_terminfo_output,
f96e0b
-    .normal_color = GRUB_TERM_DEFAULT_NORMAL_COLOR,
f96e0b
-    .highlight_color = GRUB_TERM_DEFAULT_HIGHLIGHT_COLOR,
f96e0b
   };
f96e0b
 
f96e0b
 void
f96e0b
diff --git a/grub-core/term/morse.c b/grub-core/term/morse.c
f96e0b
index 3d6c650..0fdc3b4 100644
f96e0b
--- a/grub-core/term/morse.c
f96e0b
+++ b/grub-core/term/morse.c
f96e0b
@@ -115,8 +115,6 @@ static struct grub_term_output grub_audio_term_output =
f96e0b
    .cls = (void *) dummy,
f96e0b
    .setcolorstate = (void *) dummy,
f96e0b
    .setcursor = (void *) dummy,
f96e0b
-   .normal_color = GRUB_TERM_DEFAULT_NORMAL_COLOR,
f96e0b
-   .highlight_color = GRUB_TERM_DEFAULT_HIGHLIGHT_COLOR,
f96e0b
    .flags = GRUB_TERM_CODE_TYPE_ASCII | GRUB_TERM_DUMB
f96e0b
   };
f96e0b
 
f96e0b
diff --git a/grub-core/term/serial.c b/grub-core/term/serial.c
f96e0b
index e1469e5..cfcfe84 100644
f96e0b
--- a/grub-core/term/serial.c
f96e0b
+++ b/grub-core/term/serial.c
f96e0b
@@ -121,8 +121,6 @@ static struct grub_term_output grub_serial_term_output =
f96e0b
   .setcursor = grub_terminfo_setcursor,
f96e0b
   .flags = GRUB_TERM_CODE_TYPE_ASCII,
f96e0b
   .data = &grub_serial_terminfo_output,
f96e0b
-  .normal_color = GRUB_TERM_DEFAULT_NORMAL_COLOR,
f96e0b
-  .highlight_color = GRUB_TERM_DEFAULT_HIGHLIGHT_COLOR,
f96e0b
 };
f96e0b
 
f96e0b
 
f96e0b
diff --git a/grub-core/term/spkmodem.c b/grub-core/term/spkmodem.c
f96e0b
index b6e7a04..5bff429 100644
f96e0b
--- a/grub-core/term/spkmodem.c
f96e0b
+++ b/grub-core/term/spkmodem.c
f96e0b
@@ -127,8 +127,6 @@ static struct grub_term_output grub_spkmodem_term_output =
f96e0b
     .setcursor = grub_terminfo_setcursor,
f96e0b
     .flags = GRUB_TERM_CODE_TYPE_ASCII,
f96e0b
     .data = &grub_spkmodem_terminfo_output,
f96e0b
-    .normal_color = GRUB_TERM_DEFAULT_NORMAL_COLOR,
f96e0b
-    .highlight_color = GRUB_TERM_DEFAULT_HIGHLIGHT_COLOR,
f96e0b
   };
f96e0b
 
f96e0b
 GRUB_MOD_INIT (spkmodem)
f96e0b
diff --git a/grub-core/term/terminfo.c b/grub-core/term/terminfo.c
f96e0b
index a0f8d18..eb0ef00 100644
f96e0b
--- a/grub-core/term/terminfo.c
f96e0b
+++ b/grub-core/term/terminfo.c
f96e0b
@@ -303,12 +303,12 @@ grub_terminfo_setcolorstate (struct grub_term_output *term,
f96e0b
 	{
f96e0b
 	case GRUB_TERM_COLOR_STANDARD:
f96e0b
 	case GRUB_TERM_COLOR_NORMAL:
f96e0b
-	  fg = term->normal_color & 0x0f;
f96e0b
-	  bg = term->normal_color >> 4;
f96e0b
+	  fg = grub_term_normal_color & 0x0f;
f96e0b
+	  bg = grub_term_normal_color >> 4;
f96e0b
 	  break;
f96e0b
 	case GRUB_TERM_COLOR_HIGHLIGHT:
f96e0b
-	  fg = term->highlight_color & 0x0f;
f96e0b
-	  bg = term->highlight_color >> 4;
f96e0b
+	  fg = grub_term_highlight_color & 0x0f;
f96e0b
+	  bg = grub_term_highlight_color >> 4;
f96e0b
 	  break;
f96e0b
 	default:
f96e0b
 	  return;
f96e0b
diff --git a/include/grub/term.h b/include/grub/term.h
f96e0b
index 39c3d5a..84f5766 100644
f96e0b
--- a/include/grub/term.h
f96e0b
+++ b/include/grub/term.h
f96e0b
@@ -221,10 +221,6 @@ struct grub_term_output
f96e0b
   /* The feature flags defined above.  */
f96e0b
   grub_uint32_t flags;
f96e0b
 
f96e0b
-  /* Current color state.  */
f96e0b
-  grub_uint8_t normal_color;
f96e0b
-  grub_uint8_t highlight_color;
f96e0b
-
f96e0b
   void *data;
f96e0b
 };
f96e0b
 typedef struct grub_term_output *grub_term_output_t;
f96e0b
@@ -233,6 +229,10 @@ typedef struct grub_term_output *grub_term_output_t;
f96e0b
 #define GRUB_TERM_DEFAULT_HIGHLIGHT_COLOR 0x70
f96e0b
 #define GRUB_TERM_DEFAULT_STANDARD_COLOR 0x07
f96e0b
 
f96e0b
+/* Current color state.  */
f96e0b
+extern grub_uint8_t EXPORT_VAR(grub_term_normal_color);
f96e0b
+extern grub_uint8_t EXPORT_VAR(grub_term_highlight_color);
f96e0b
+
f96e0b
 extern struct grub_term_output *EXPORT_VAR(grub_term_outputs_disabled);
f96e0b
 extern struct grub_term_input *EXPORT_VAR(grub_term_inputs_disabled);
f96e0b
 extern struct grub_term_output *EXPORT_VAR(grub_term_outputs);
f96e0b
@@ -391,16 +391,6 @@ grub_setcolorstate (grub_term_color_state state)
f96e0b
     grub_term_setcolorstate (term, state);
f96e0b
 }
f96e0b
 
f96e0b
-/* Set the normal color and the highlight color. The format of each
f96e0b
-   color is VGA's.  */
f96e0b
-static inline void 
f96e0b
-grub_term_setcolor (struct grub_term_output *term,
f96e0b
-		    grub_uint8_t normal_color, grub_uint8_t highlight_color)
f96e0b
-{
f96e0b
-  term->normal_color = normal_color;
f96e0b
-  term->highlight_color = highlight_color;
f96e0b
-}
f96e0b
-
f96e0b
 /* Turn on/off the cursor.  */
f96e0b
 static inline void 
f96e0b
 grub_term_setcursor (struct grub_term_output *term, int on)
f96e0b
@@ -460,14 +450,6 @@ grub_term_getcharwidth (struct grub_term_output *term,
f96e0b
     return 1;
f96e0b
 }
f96e0b
 
f96e0b
-static inline void 
f96e0b
-grub_term_getcolor (struct grub_term_output *term, 
f96e0b
-		    grub_uint8_t *normal_color, grub_uint8_t *highlight_color)
f96e0b
-{
f96e0b
-  *normal_color = term->normal_color;
f96e0b
-  *highlight_color = term->highlight_color;
f96e0b
-}
f96e0b
-
f96e0b
 struct grub_term_autoload
f96e0b
 {
f96e0b
   struct grub_term_autoload *next;
f96e0b
-- 
f96e0b
1.8.2.1
f96e0b