voyager.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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/voyager.c
  12. *
  13. * Get the Voyager config information
  14. */
  15. #include "boot.h"
  16. #ifdef CONFIG_X86_VOYAGER
  17. int query_voyager(void)
  18. {
  19. u8 err;
  20. u16 es, di;
  21. /* Abuse the apm_bios_info area for this */
  22. u8 *data_ptr = (u8 *)&boot_params.apm_bios_info;
  23. data_ptr[0] = 0xff; /* Flag on config not found(?) */
  24. asm("pushw %%es ; "
  25. "int $0x15 ; "
  26. "setc %0 ; "
  27. "movw %%es, %1 ; "
  28. "popw %%es"
  29. : "=q" (err), "=r" (es), "=D" (di)
  30. : "a" (0xffc0));
  31. if (err)
  32. return -1; /* Not Voyager */
  33. set_fs(es);
  34. copy_from_fs(data_ptr, di, 7); /* Table is 7 bytes apparently */
  35. return 0;
  36. }
  37. #endif /* CONFIG_X86_VOYAGER */