diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-07-11 15:18:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-12 13:55:55 -0400 |
commit | 3b53d3045bbb8ea3c9dce663b102eab0903817c5 (patch) | |
tree | 34c2838ad33555f1b28953d1b8be44004a7950fe /arch/i386 | |
parent | d13444a5a53b0159e6316a7a7be9890143a5af71 (diff) |
MCA support for new x86 setup code
MCA probing support for the new x86 setup code. This implements the
same functionality as the assembly version.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/i386')
-rw-r--r-- | arch/i386/boot/mca.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/arch/i386/boot/mca.c b/arch/i386/boot/mca.c new file mode 100644 index 000000000000..9b68bd1aef19 --- /dev/null +++ b/arch/i386/boot/mca.c | |||
@@ -0,0 +1,43 @@ | |||
1 | /* -*- 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 | /* | ||
12 | * arch/i386/boot/mca.c | ||
13 | * | ||
14 | * Get the MCA system description table | ||
15 | */ | ||
16 | |||
17 | #include "boot.h" | ||
18 | |||
19 | int query_mca(void) | ||
20 | { | ||
21 | u8 err; | ||
22 | u16 es, bx, len; | ||
23 | |||
24 | asm("pushw %%es ; " | ||
25 | "int $0x15 ; " | ||
26 | "setc %0 ; " | ||
27 | "movw %%es, %1 ; " | ||
28 | "popw %%es" | ||
29 | : "=acdSDm" (err), "=acdSDm" (es), "=b" (bx) | ||
30 | : "a" (0xc000)); | ||
31 | |||
32 | if (err) | ||
33 | return -1; /* No MCA present */ | ||
34 | |||
35 | set_fs(es); | ||
36 | len = rdfs16(bx); | ||
37 | |||
38 | if (len > sizeof(boot_params.sys_desc_table)) | ||
39 | len = sizeof(boot_params.sys_desc_table); | ||
40 | |||
41 | copy_from_fs(&boot_params.sys_desc_table, bx, len); | ||
42 | return 0; | ||
43 | } | ||