Commit ffa930ef authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] x86: early_printk(): remove MAX_YPOS and MAX_XPOS macros

Expand out these fairly pointless macros.

Cc: Chuck Ebbert <76306.1226@compuserve.com>
Cc: Stas Sergeev <stsp@aknet.ru>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 98e7d9b0
...@@ -17,9 +17,6 @@ ...@@ -17,9 +17,6 @@
#define VGABASE ((void __iomem *)0xffffffff800b8000UL) #define VGABASE ((void __iomem *)0xffffffff800b8000UL)
#endif #endif
#define MAX_YPOS max_ypos
#define MAX_XPOS max_xpos
static int max_ypos = 25, max_xpos = 80; static int max_ypos = 25, max_xpos = 80;
static int current_ypos = 25, current_xpos = 0; static int current_ypos = 25, current_xpos = 0;
...@@ -29,26 +26,26 @@ static void early_vga_write(struct console *con, const char *str, unsigned n) ...@@ -29,26 +26,26 @@ static void early_vga_write(struct console *con, const char *str, unsigned n)
int i, k, j; int i, k, j;
while ((c = *str++) != '\0' && n-- > 0) { while ((c = *str++) != '\0' && n-- > 0) {
if (current_ypos >= MAX_YPOS) { if (current_ypos >= max_ypos) {
/* scroll 1 line up */ /* scroll 1 line up */
for (k = 1, j = 0; k < MAX_YPOS; k++, j++) { for (k = 1, j = 0; k < max_ypos; k++, j++) {
for (i = 0; i < MAX_XPOS; i++) { for (i = 0; i < max_xpos; i++) {
writew(readw(VGABASE + 2*(MAX_XPOS*k + i)), writew(readw(VGABASE+2*(max_xpos*k+i)),
VGABASE + 2*(MAX_XPOS*j + i)); VGABASE + 2*(max_xpos*j + i));
} }
} }
for (i = 0; i < MAX_XPOS; i++) for (i = 0; i < max_xpos; i++)
writew(0x720, VGABASE + 2*(MAX_XPOS*j + i)); writew(0x720, VGABASE + 2*(max_xpos*j + i));
current_ypos = MAX_YPOS-1; current_ypos = max_ypos-1;
} }
if (c == '\n') { if (c == '\n') {
current_xpos = 0; current_xpos = 0;
current_ypos++; current_ypos++;
} else if (c != '\r') { } else if (c != '\r') {
writew(((0x7 << 8) | (unsigned short) c), writew(((0x7 << 8) | (unsigned short) c),
VGABASE + 2*(MAX_XPOS*current_ypos + VGABASE + 2*(max_xpos*current_ypos +
current_xpos++)); current_xpos++));
if (current_xpos >= MAX_XPOS) { if (current_xpos >= max_xpos) {
current_xpos = 0; current_xpos = 0;
current_ypos++; current_ypos++;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment