3
3
* Copyright (C) 1991, 1992 Linus Torvalds
4
4
* Copyright 2007 rPath, Inc. - All Rights Reserved
5
* Copyright 2009 Intel Corporation; author H. Peter Anvin
6
7
* This file is part of the Linux kernel, and is made available under
7
8
* the terms of the GNU General Public License version 2.
19
20
static void store_cursor_position(void)
27
: "=d" (curpos), "+a" (ax), "+b" (bx)
28
: : "ecx", "esi", "edi");
30
boot_params.screen_info.orig_x = curpos;
31
boot_params.screen_info.orig_y = curpos >> 8;
22
struct biosregs ireg, oreg;
26
intcall(0x10, &ireg, &oreg);
28
boot_params.screen_info.orig_x = oreg.dl;
29
boot_params.screen_info.orig_y = oreg.dh;
34
32
static void store_video_mode(void)
34
struct biosregs ireg, oreg;
38
36
/* N.B.: the saving of the video page here is a bit silly,
39
37
since we pretty much assume page 0 everywhere. */
42
: "+a" (ax), "=b" (page)
43
: : "ecx", "edx", "esi", "edi");
40
intcall(0x10, &ireg, &oreg);
45
42
/* Not all BIOSes are clean with respect to the top bit */
46
boot_params.screen_info.orig_video_mode = ax & 0x7f;
47
boot_params.screen_info.orig_video_page = page >> 8;
43
boot_params.screen_info.orig_video_mode = oreg.al & 0x7f;
44
boot_params.screen_info.orig_video_page = oreg.bh;
298
295
/* Restore cursor position */
299
ax = 0x0200; /* Set cursor position */
300
bx = 0; /* Page number (<< 8) */
301
dx = (saved.cury << 8)+saved.curx;
303
: "+a" (ax), "+b" (bx), "+d" (dx)
304
: : "ecx", "esi", "edi");
297
ireg.ah = 0x02; /* Set cursor position */
298
ireg.dh = saved.cury;
299
ireg.dl = saved.curx;
300
intcall(0x10, &ireg, NULL);
307
303
#define save_screen() ((void)0)