~ubuntu-branches/ubuntu/lucid/linux-rt/lucid

« back to all changes in this revision

Viewing changes to arch/x86/boot/video.c

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2009-08-05 23:00:52 UTC
  • Revision ID: james.westby@ubuntu.com-20090805230052-7xedvqcyk9dnnxb2
Tags: 2.6.31-1.1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 *
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
5
6
 *
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.
18
19
 
19
20
static void store_cursor_position(void)
20
21
{
21
 
        u16 curpos;
22
 
        u16 ax, bx;
23
 
 
24
 
        ax = 0x0300;
25
 
        bx = 0;
26
 
        asm(INT10
27
 
            : "=d" (curpos), "+a" (ax), "+b" (bx)
28
 
            : : "ecx", "esi", "edi");
29
 
 
30
 
        boot_params.screen_info.orig_x = curpos;
31
 
        boot_params.screen_info.orig_y = curpos >> 8;
 
22
        struct biosregs ireg, oreg;
 
23
 
 
24
        initregs(&ireg);
 
25
        ireg.ah = 0x03;
 
26
        intcall(0x10, &ireg, &oreg);
 
27
 
 
28
        boot_params.screen_info.orig_x = oreg.dl;
 
29
        boot_params.screen_info.orig_y = oreg.dh;
32
30
}
33
31
 
34
32
static void store_video_mode(void)
35
33
{
36
 
        u16 ax, page;
 
34
        struct biosregs ireg, oreg;
37
35
 
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. */
40
 
        ax = 0x0f00;
41
 
        asm(INT10
42
 
            : "+a" (ax), "=b" (page)
43
 
            : : "ecx", "edx", "esi", "edi");
 
38
        initregs(&ireg);
 
39
        ireg.ah = 0x0f;
 
40
        intcall(0x10, &ireg, &oreg);
44
41
 
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;
48
45
}
49
46
 
50
47
/*
257
254
        int y;
258
255
        addr_t dst = 0;
259
256
        u16 *src = saved.data;
260
 
        u16 ax, bx, dx;
 
257
        struct biosregs ireg;
261
258
 
262
259
        if (graphic_mode)
263
260
                return;         /* Can't restore onto a graphic mode */
296
293
        }
297
294
 
298
295
        /* Restore cursor position */
299
 
        ax = 0x0200;            /* Set cursor position */
300
 
        bx = 0;                 /* Page number (<< 8) */
301
 
        dx = (saved.cury << 8)+saved.curx;
302
 
        asm volatile(INT10
303
 
                     : "+a" (ax), "+b" (bx), "+d" (dx)
304
 
                     : : "ecx", "esi", "edi");
 
296
        initregs(&ireg);
 
297
        ireg.ah = 0x02;         /* Set cursor position */
 
298
        ireg.dh = saved.cury;
 
299
        ireg.dl = saved.curx;
 
300
        intcall(0x10, &ireg, NULL);
305
301
}
306
302
#else
307
303
#define save_screen()           ((void)0)