25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

99 satır
2.9 KiB

  1. /*
  2. * libcaca Colour ASCII-Art library
  3. * Copyright (c) 2006 Sam Hocevar <sam@hocevar.net>
  4. * 2009 Jean-Yves Lamoureux <jylam@lnxscene.org>
  5. * All Rights Reserved
  6. *
  7. * This library is free software. It comes without any warranty, to
  8. * the extent permitted by applicable law. You can redistribute it
  9. * and/or modify it under the terms of the Do What the Fuck You Want
  10. * to Public License, Version 2, as published by Sam Hocevar. See
  11. * http://www.wtfpl.net/ for more details.
  12. */
  13. enum cpuid_requests
  14. {
  15. CPUID_GETVENDORSTRING,
  16. CPUID_GETFEATURES,
  17. CPUID_GETTLB,
  18. CPUID_GETSERIAL,
  19. CPUID_INTELEXTENDED = 0x80000000,
  20. CPUID_INTELFEATURES,
  21. CPUID_INTELBRANDSTRING,
  22. CPUID_INTELBRANDSTRINGMORE,
  23. CPUID_INTELBRANDSTRINGEND,
  24. };
  25. enum
  26. {
  27. CPUID_FEAT_ECX_SSE3 = 1 << 0,
  28. CPUID_FEAT_ECX_PCLMUL = 1 << 1,
  29. CPUID_FEAT_ECX_DTES64 = 1 << 2,
  30. CPUID_FEAT_ECX_MONITOR = 1 << 3,
  31. CPUID_FEAT_ECX_DS_CPL = 1 << 4,
  32. CPUID_FEAT_ECX_VMX = 1 << 5,
  33. CPUID_FEAT_ECX_SMX = 1 << 6,
  34. CPUID_FEAT_ECX_EST = 1 << 7,
  35. CPUID_FEAT_ECX_TM2 = 1 << 8,
  36. CPUID_FEAT_ECX_SSSE3 = 1 << 9,
  37. CPUID_FEAT_ECX_CID = 1 << 10,
  38. CPUID_FEAT_ECX_FMA = 1 << 12,
  39. CPUID_FEAT_ECX_CX16 = 1 << 13,
  40. CPUID_FEAT_ECX_ETPRD = 1 << 14,
  41. CPUID_FEAT_ECX_PDCM = 1 << 15,
  42. CPUID_FEAT_ECX_DCA = 1 << 18,
  43. CPUID_FEAT_ECX_SSE4_1 = 1 << 19,
  44. CPUID_FEAT_ECX_SSE4_2 = 1 << 20,
  45. CPUID_FEAT_ECX_x2APIC = 1 << 21,
  46. CPUID_FEAT_ECX_MOVBE = 1 << 22,
  47. CPUID_FEAT_ECX_POPCNT = 1 << 23,
  48. CPUID_FEAT_ECX_XSAVE = 1 << 26,
  49. CPUID_FEAT_ECX_OSXSAVE = 1 << 27,
  50. CPUID_FEAT_ECX_AVX = 1 << 28,
  51. CPUID_FEAT_EDX_FPU = 1 << 0,
  52. CPUID_FEAT_EDX_VME = 1 << 1,
  53. CPUID_FEAT_EDX_DE = 1 << 2,
  54. CPUID_FEAT_EDX_PSE = 1 << 3,
  55. CPUID_FEAT_EDX_TSC = 1 << 4,
  56. CPUID_FEAT_EDX_MSR = 1 << 5,
  57. CPUID_FEAT_EDX_PAE = 1 << 6,
  58. CPUID_FEAT_EDX_MCE = 1 << 7,
  59. CPUID_FEAT_EDX_CX8 = 1 << 8,
  60. CPUID_FEAT_EDX_APIC = 1 << 9,
  61. CPUID_FEAT_EDX_SEP = 1 << 11,
  62. CPUID_FEAT_EDX_MTRR = 1 << 12,
  63. CPUID_FEAT_EDX_PGE = 1 << 13,
  64. CPUID_FEAT_EDX_MCA = 1 << 14,
  65. CPUID_FEAT_EDX_CMOV = 1 << 15,
  66. CPUID_FEAT_EDX_PAT = 1 << 16,
  67. CPUID_FEAT_EDX_PSE36 = 1 << 17,
  68. CPUID_FEAT_EDX_PSN = 1 << 18,
  69. CPUID_FEAT_EDX_CLF = 1 << 19,
  70. CPUID_FEAT_EDX_DTES = 1 << 21,
  71. CPUID_FEAT_EDX_ACPI = 1 << 22,
  72. CPUID_FEAT_EDX_MMX = 1 << 23,
  73. CPUID_FEAT_EDX_FXSR = 1 << 24,
  74. CPUID_FEAT_EDX_SSE = 1 << 25,
  75. CPUID_FEAT_EDX_SSE2 = 1 << 26,
  76. CPUID_FEAT_EDX_SS = 1 << 27,
  77. CPUID_FEAT_EDX_HTT = 1 << 28,
  78. CPUID_FEAT_EDX_TM1 = 1 << 29,
  79. CPUID_FEAT_EDX_IA64 = 1 << 30,
  80. CPUID_FEAT_EDX_PBE = 1 << 31
  81. };
  82. struct processor_info
  83. {
  84. int id;
  85. char vendor[13];
  86. unsigned int features;
  87. u32 frequency;
  88. };
  89. int processor_get_info(struct processor_info *processor_info);
  90. u32 processor_get_frequency(struct processor_info *processor_info);
  91. void processor_print_info(struct processor_info *processor_info);