bios.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef ASM_X86__UV__BIOS_H
  2. #define ASM_X86__UV__BIOS_H
  3. /*
  4. * BIOS layer definitions.
  5. *
  6. * Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. */
  22. #include <linux/rtc.h>
  23. #define BIOS_FREQ_BASE 0x01000001
  24. enum {
  25. BIOS_FREQ_BASE_PLATFORM = 0,
  26. BIOS_FREQ_BASE_INTERVAL_TIMER = 1,
  27. BIOS_FREQ_BASE_REALTIME_CLOCK = 2
  28. };
  29. # define BIOS_CALL(result, a0, a1, a2, a3, a4, a5, a6, a7) \
  30. do { \
  31. /* XXX - the real call goes here */ \
  32. result.status = BIOS_STATUS_UNIMPLEMENTED; \
  33. isrv.v0 = 0; \
  34. isrv.v1 = 0; \
  35. } while (0)
  36. enum {
  37. BIOS_STATUS_SUCCESS = 0,
  38. BIOS_STATUS_UNIMPLEMENTED = -1,
  39. BIOS_STATUS_EINVAL = -2,
  40. BIOS_STATUS_ERROR = -3
  41. };
  42. struct uv_bios_retval {
  43. /*
  44. * A zero status value indicates call completed without error.
  45. * A negative status value indicates reason of call failure.
  46. * A positive status value indicates success but an
  47. * informational value should be printed (e.g., "reboot for
  48. * change to take effect").
  49. */
  50. s64 status;
  51. u64 v0;
  52. u64 v1;
  53. u64 v2;
  54. };
  55. extern long
  56. x86_bios_freq_base(unsigned long which, unsigned long *ticks_per_second,
  57. unsigned long *drift_info);
  58. extern const char *x86_bios_strerror(long status);
  59. #endif /* ASM_X86__UV__BIOS_H */