Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145794
b: refs/heads/master
c: 0a706db
h: refs/heads/master
v: v3
  • Loading branch information
H. Peter Anvin authored and H. Peter Anvin committed Apr 9, 2009
1 parent 94b64c4 commit 5056ec2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3435d3476c5ed955d56a6216ed2d156847b3a575
refs/heads/master: 0a706db320768f8f6e43bbf73b58d2aabdc93354
27 changes: 12 additions & 15 deletions trunk/arch/x86/boot/mca.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*
* Copyright (C) 1991, 1992 Linus Torvalds
* Copyright 2007 rPath, Inc. - All Rights Reserved
* Copyright 2009 Intel Corporation; author H. Peter Anvin
*
* This file is part of the Linux kernel, and is made available under
* the terms of the GNU General Public License version 2.
Expand All @@ -16,26 +17,22 @@

int query_mca(void)
{
u8 err;
u16 es, bx, len;

asm("pushw %%es ; "
"int $0x15 ; "
"setc %0 ; "
"movw %%es, %1 ; "
"popw %%es"
: "=acd" (err), "=acdSD" (es), "=b" (bx)
: "a" (0xc000));

if (err)
struct biosregs ireg, oreg;
u16 len;

initregs(&ireg);
ireg.ah = 0xc0;
intcall(0x15, &ireg, &oreg);

if (oreg.eflags & X86_EFLAGS_CF)
return -1; /* No MCA present */

set_fs(es);
len = rdfs16(bx);
set_fs(oreg.es);
len = rdfs16(oreg.bx);

if (len > sizeof(boot_params.sys_desc_table))
len = sizeof(boot_params.sys_desc_table);

copy_from_fs(&boot_params.sys_desc_table, bx, len);
copy_from_fs(&boot_params.sys_desc_table, oreg.bx, len);
return 0;
}

0 comments on commit 5056ec2

Please sign in to comment.