fix - ensure we don't use bootconsoles after init has been released
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / i386 / boot / mca.c
blob68222f2d4b670479fd7656f4036c848bfed7e5e8
1 /* -*- linux-c -*- ------------------------------------------------------- *
3 * Copyright (C) 1991, 1992 Linus Torvalds
4 * Copyright 2007 rPath, Inc. - All Rights Reserved
6 * This file is part of the Linux kernel, and is made available under
7 * the terms of the GNU General Public License version 2.
9 * ----------------------------------------------------------------------- */
12 * arch/i386/boot/mca.c
14 * Get the MCA system description table
17 #include "boot.h"
19 int query_mca(void)
21 u8 err;
22 u16 es, bx, len;
24 asm("pushw %%es ; "
25 "int $0x15 ; "
26 "setc %0 ; "
27 "movw %%es, %1 ; "
28 "popw %%es"
29 : "=acd" (err), "=acdSD" (es), "=b" (bx)
30 : "a" (0xc000));
32 if (err)
33 return -1; /* No MCA present */
35 set_fs(es);
36 len = rdfs16(bx);
38 if (len > sizeof(boot_params.sys_desc_table))
39 len = sizeof(boot_params.sys_desc_table);
41 copy_from_fs(&boot_params.sys_desc_table, bx, len);
42 return 0;