cpu.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * cpu.h
  3. *
  4. * Copyright (C) 2016 Aleksandar Andrejevic <theflash@sdf.lonestar.org>
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU Affero General Public License as
  8. * published by the Free Software Foundation, either version 3 of the
  9. * License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU Affero General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Affero General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef _CPU_H_
  20. #define _CPU_H_
  21. #include <common.h>
  22. #include <sdk/cpu.h>
  23. #define CPU_FEATURE_FPU (1 << 0)
  24. #define CPU_FEATURE_VME (1 << 1)
  25. #define CPU_FEATURE_DE (1 << 2)
  26. #define CPU_FEATURE_PSE (1 << 3)
  27. #define CPU_FEATURE_TSC (1 << 4)
  28. #define CPU_FEATURE_MSR (1 << 5)
  29. #define CPU_FEATURE_PAE (1 << 6)
  30. #define CPU_FEATURE_MCE (1 << 7)
  31. #define CPU_FEATURE_CX8 (1 << 8)
  32. #define CPU_FEATURE_APIC (1 << 9)
  33. #define CPU_FEATURE_SEP (1 << 11)
  34. #define CPU_FEATURE_MTRR (1 << 12)
  35. #define CPU_FEATURE_PGE (1 << 13)
  36. #define CPU_FEATURE_MCA (1 << 14)
  37. #define CPU_FEATURE_CMOV (1 << 15)
  38. #define CPU_FEATURE_PAT (1 << 16)
  39. #define CPU_FEATURE_PSE36 (1 << 17)
  40. #define CPU_FEATURE_PSN (1 << 18)
  41. #define CPU_FEATURE_CLFL (1 << 19)
  42. #define CPU_FEATURE_DTES (1 << 21)
  43. #define CPU_FEATURE_ACPI (1 << 22)
  44. #define CPU_FEATURE_MMX (1 << 23)
  45. #define CPU_FEATURE_FXSR (1 << 24)
  46. #define CPU_FEATURE_SSE (1 << 25)
  47. #define CPU_FEATURE_SSE2 (1 << 26)
  48. #define CPU_FEATURE_SS (1 << 27)
  49. #define CPU_FEATURE_HTT (1 << 28)
  50. #define CPU_FEATURE_TM1 (1 << 29)
  51. #define CPU_FEATURE_IA64 (1 << 30)
  52. #define CPU_FEATURE_PBE (1 << 31)
  53. extern void cpu_init(void);
  54. extern void cpu_measure_speed(void);
  55. extern void fpu_save(byte_t *data);
  56. extern void fpu_restore(byte_t *data);
  57. extern void stall(dword_t microseconds);
  58. extern char cpu_vendor[13];
  59. extern dword_t cpu_features[2];
  60. #endif