diff options
Diffstat (limited to 'arch/x86/boot/mca.c')
| -rw-r--r-- | arch/x86/boot/mca.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/arch/x86/boot/mca.c b/arch/x86/boot/mca.c index 911eaae5d696..a95a531148ef 100644 --- a/arch/x86/boot/mca.c +++ b/arch/x86/boot/mca.c | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | * | 2 | * |
| 3 | * Copyright (C) 1991, 1992 Linus Torvalds | 3 | * Copyright (C) 1991, 1992 Linus Torvalds |
| 4 | * Copyright 2007 rPath, Inc. - All Rights Reserved | 4 | * Copyright 2007 rPath, Inc. - All Rights Reserved |
| 5 | * Copyright 2009 Intel Corporation; author H. Peter Anvin | ||
| 5 | * | 6 | * |
| 6 | * This file is part of the Linux kernel, and is made available under | 7 | * 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 | * the terms of the GNU General Public License version 2. |
| @@ -16,26 +17,22 @@ | |||
| 16 | 17 | ||
| 17 | int query_mca(void) | 18 | int query_mca(void) |
| 18 | { | 19 | { |
| 19 | u8 err; | 20 | struct biosregs ireg, oreg; |
| 20 | u16 es, bx, len; | 21 | u16 len; |
| 21 | 22 | ||
| 22 | asm("pushw %%es ; " | 23 | initregs(&ireg); |
| 23 | "int $0x15 ; " | 24 | ireg.ah = 0xc0; |
| 24 | "setc %0 ; " | 25 | intcall(0x15, &ireg, &oreg); |
| 25 | "movw %%es, %1 ; " | 26 | |
| 26 | "popw %%es" | 27 | if (oreg.eflags & X86_EFLAGS_CF) |
| 27 | : "=acd" (err), "=acdSD" (es), "=b" (bx) | ||
| 28 | : "a" (0xc000)); | ||
| 29 | |||
| 30 | if (err) | ||
| 31 | return -1; /* No MCA present */ | 28 | return -1; /* No MCA present */ |
| 32 | 29 | ||
| 33 | set_fs(es); | 30 | set_fs(oreg.es); |
| 34 | len = rdfs16(bx); | 31 | len = rdfs16(oreg.bx); |
| 35 | 32 | ||
| 36 | if (len > sizeof(boot_params.sys_desc_table)) | 33 | if (len > sizeof(boot_params.sys_desc_table)) |
| 37 | len = sizeof(boot_params.sys_desc_table); | 34 | len = sizeof(boot_params.sys_desc_table); |
| 38 | 35 | ||
| 39 | copy_from_fs(&boot_params.sys_desc_table, bx, len); | 36 | copy_from_fs(&boot_params.sys_desc_table, oreg.bx, len); |
| 40 | return 0; | 37 | return 0; |
| 41 | } | 38 | } |
