mca.c 918 B

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