blob: 911eaae5d696427c98fdad7f344a14bdc0340efc [file] [log] [blame]
H. Peter Anvin3b53d302007-07-11 12:18:49 -07001/* -*- linux-c -*- ------------------------------------------------------- *
2 *
3 * Copyright (C) 1991, 1992 Linus Torvalds
4 * Copyright 2007 rPath, Inc. - All Rights Reserved
5 *
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.
8 *
9 * ----------------------------------------------------------------------- */
10
11/*
H. Peter Anvin3b53d302007-07-11 12:18:49 -070012 * Get the MCA system description table
13 */
14
15#include "boot.h"
16
17int query_mca(void)
18{
19 u8 err;
20 u16 es, bx, len;
21
22 asm("pushw %%es ; "
23 "int $0x15 ; "
24 "setc %0 ; "
25 "movw %%es, %1 ; "
26 "popw %%es"
H. Peter Anvin5593eaa2007-07-14 16:47:13 -070027 : "=acd" (err), "=acdSD" (es), "=b" (bx)
H. Peter Anvin3b53d302007-07-11 12:18:49 -070028 : "a" (0xc000));
29
30 if (err)
31 return -1; /* No MCA present */
32
33 set_fs(es);
34 len = rdfs16(bx);
35
36 if (len > sizeof(boot_params.sys_desc_table))
37 len = sizeof(boot_params.sys_desc_table);
38
39 copy_from_fs(&boot_params.sys_desc_table, bx, len);
40 return 0;
41}