mca.c 945 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. * arch/i386/boot/mca.c
  12. *
  13. * Get the MCA system description table
  14. */
  15. #include "boot.h"
  16. int query_mca(void)
  17. {
  18. u8 err;
  19. u16 es, bx, len;
  20. asm("pushw %%es ; "
  21. "int $0x15 ; "
  22. "setc %0 ; "
  23. "movw %%es, %1 ; "
  24. "popw %%es"
  25. : "=acd" (err), "=acdSD" (es), "=b" (bx)
  26. : "a" (0xc000));
  27. if (err)
  28. return -1; /* No MCA present */
  29. set_fs(es);
  30. len = rdfs16(bx);
  31. if (len > sizeof(boot_params.sys_desc_table))
  32. len = sizeof(boot_params.sys_desc_table);
  33. copy_from_fs(&boot_params.sys_desc_table, bx, len);
  34. return 0;
  35. }