Hi,

Find an attached patch to macrofy pos >> 8 and pos & 0xff in multiter.
In my opinion should be macrofied, it's more clear.

-- 
Carles Pina i Estany
        http://pinux.info
=== modified file 'include/grub/term.h'
--- include/grub/term.h	2009-12-25 02:37:20 +0000
+++ include/grub/term.h	2009-12-30 18:17:55 +0000
@@ -32,6 +32,8 @@
 #define GRUB_TERM_ESC		'\e'
 #define GRUB_TERM_TAB		'\t'
 #define GRUB_TERM_BACKSPACE	8
+#define GETX(XY)		(XY >> 8)
+#define GETY(XY)		(XY & 0xff)
 
 #ifndef ASM_FILE
 

=== modified file 'loader/i386/efi/linux.c'
--- loader/i386/efi/linux.c	2009-12-26 21:16:14 +0000
+++ loader/i386/efi/linux.c	2009-12-30 18:19:32 +0000
@@ -700,8 +700,8 @@ grub_cmd_linux (grub_command_t cmd __att
       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_cursor_x = GETX (pos);
+	  params->video_cursor_y = GETY (pos);
 	  params->video_width = grub_term_width (term);
 	  params->video_height = grub_term_height (term);
 	  found = 1;
@@ -711,8 +711,8 @@ grub_cmd_linux (grub_command_t cmd __att
 	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_cursor_x = GETX (pos);
+	    params->video_cursor_y = GETY (pos);
 	    params->video_width = grub_term_width (term);
 	    params->video_height = grub_term_height (term);
 	    found = 1;

=== modified file 'loader/i386/ieee1275/linux.c'
--- loader/i386/ieee1275/linux.c	2009-12-28 21:06:30 +0000
+++ loader/i386/ieee1275/linux.c	2009-12-30 18:20:17 +0000
@@ -116,8 +116,8 @@ grub_linux_boot (void)
       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_cursor_x = GETX (pos);
+	  params->video_cursor_y = GETY (pos);
 	  params->video_width = grub_term_width (term);
 	  params->video_height = grub_term_height (term);
 	  found = 1;
@@ -127,8 +127,8 @@ grub_linux_boot (void)
 	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_cursor_x = GETX (pos);
+	    params->video_cursor_y = GETY (pos);
 	    params->video_width = grub_term_width (term);
 	    params->video_height = grub_term_height (term);
 	    found = 1;

=== modified file 'loader/i386/linux.c'
--- loader/i386/linux.c	2009-12-24 23:07:52 +0000
+++ loader/i386/linux.c	2009-12-30 18:18:24 +0000
@@ -554,8 +554,8 @@ grub_linux_boot (void)
 	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_cursor_x = GETX (pos);
+	    params->video_cursor_y = GETY (pos);
 	    found = 1;
 	  }
       if (!found)
@@ -563,8 +563,8 @@ grub_linux_boot (void)
 	  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_cursor_x = GETX (pos);
+	    params->video_cursor_y = GETY (pos);
 	    found = 1;
 	  }
       if (!found)

=== modified file 'normal/menu_entry.c'
--- normal/menu_entry.c	2009-12-25 15:28:31 +0000
+++ normal/menu_entry.c	2009-12-30 18:19:09 +0000
@@ -1098,7 +1098,7 @@ complete (struct screen *screen, int con
 
 	if (*p)
 	  grub_putcode (GRUB_TERM_DISP_RIGHT, screen->terms[i].term);
-	grub_term_gotoxy (screen->terms[i].term, pos >> 8, pos & 0xFF);
+	grub_term_gotoxy (screen->terms[i].term, GETX (pos), GETY (pos));
       }
 
   if (insert)
@@ -1132,7 +1132,7 @@ clear_completions (struct per_term_scree
       grub_putcode ('\n', term_screen->term);
     }
 
-  grub_term_gotoxy (term_screen->term, pos >> 8, pos & 0xFF);
+  grub_term_gotoxy (term_screen->term, GETX (pos), GETY (pos));
   grub_term_refresh (term_screen->term);
 }
 

=== modified file 'term/efi/console.c'
--- term/efi/console.c	2009-12-24 23:13:03 +0000
+++ term/efi/console.c	2009-12-30 18:19:46 +0000
@@ -137,7 +137,7 @@ grub_console_checkkey (void)
 	grub_printf ("scan_code=%x,unicode_char=%x  ",
 		     (unsigned) key.scan_code,
 		     (unsigned) key.unicode_char);
-	grub_gotoxy (xy >> 8, xy & 0xff);
+	grub_gotoxy (GETX(xy), GETY(xy));
       }
       break;
 

=== modified file 'term/i386/pc/vga.c'
--- term/i386/pc/vga.c	2009-06-10 21:04:23 +0000
+++ term/i386/pc/vga.c	2009-12-30 18:27:04 +0000
@@ -379,8 +379,8 @@ grub_vga_putchar (grub_uint32_t c)
 
       show = 0;
       grub_gotoxy (0, 0);
-      grub_printf ("[%u:%u]", (unsigned) (pos >> 8), (unsigned) (pos & 0xff));
-      grub_gotoxy (pos >> 8, pos & 0xff);
+      grub_printf ("[%u:%u]", (unsigned) (GETX (pos)), (unsigned) (GETY (pos));
+      grub_gotoxy (GETX (pos), GETY (pos));
       show = 1;
     }
 #endif

=== modified file 'term/i386/pc/vga_text.c'
--- term/i386/pc/vga_text.c	2009-12-24 23:13:03 +0000
+++ term/i386/pc/vga_text.c	2009-12-30 18:18:40 +0000
@@ -54,9 +54,9 @@ update_cursor (void)
 {
   unsigned int pos = grub_curr_y * COLS + grub_curr_x;
   grub_outb (CRTC_CURSOR_ADDR_HIGH, CRTC_ADDR_PORT);
-  grub_outb (pos >> 8, CRTC_DATA_PORT);
+  grub_outb (GETX (pos), CRTC_DATA_PORT);
   grub_outb (CRTC_CURSOR_ADDR_LOW, CRTC_ADDR_PORT);
-  grub_outb (pos & 0xFF, CRTC_DATA_PORT);
+  grub_outb (GETY (pos), CRTC_DATA_PORT);
 }
 
 static void

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to