From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NQPoq-00032L-T2 for mharc-grub-devel@gnu.org; Thu, 31 Dec 2009 13:32:20 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NQPop-000328-CO for grub-devel@gnu.org; Thu, 31 Dec 2009 13:32:19 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NQPol-00031X-U2 for grub-devel@gnu.org; Thu, 31 Dec 2009 13:32:19 -0500 Received: from [199.232.76.173] (port=37021 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NQPol-00031U-Nq for grub-devel@gnu.org; Thu, 31 Dec 2009 13:32:15 -0500 Received: from 197.red-80-32-81.staticip.rima-tde.net ([80.32.81.197]:56859 helo=mail.pina.cat) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NQPok-0003PY-Vb for grub-devel@gnu.org; Thu, 31 Dec 2009 13:32:15 -0500 Received: from pinux (unknown [192.168.0.78]) by mail.pina.cat (Postfix) with ESMTPA id 92DE42894B244 for ; Thu, 31 Dec 2009 19:32:02 +0100 (CET) Received: by pinux (Postfix, from userid 1000) id BDB3CEE1FA; Thu, 31 Dec 2009 19:31:56 +0100 (CET) Date: Thu, 31 Dec 2009 19:31:56 +0100 From: Carles Pina i Estany To: grub-devel@gnu.org Message-ID: <20091231183156.GA25874@pina.cat> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="GvXjxJ+pjyke8COw" Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [PATCH] macrofy (multiterm branch) X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2009 18:32:20 -0000 --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --GvXjxJ+pjyke8COw Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="macrofy.patch" === 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 --GvXjxJ+pjyke8COw--