this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Adding max_basic

authored by

Balint66 and committed by
GitHub
18751d66 0ae8c4a7

+26
+26
src/kernel/emulation/linux/misc/sysctl_machdep.c
··· 7 7 8 8 enum { 9 9 _CPU_BRAND_STRING = 1000, 10 + _CPU_MAX_BASIC=999, 10 11 }; 11 12 12 13 static sysctl_handler(handle_brand_string); 14 + static sysctl_handler(handle_max_basic); 13 15 14 16 const struct known_sysctl sysctls_machdep_cpu[] = { 15 17 { .oid = _CPU_BRAND_STRING, .type = CTLTYPE_STRING, .exttype = "S", .name = "brand_string", .handler = handle_brand_string }, 18 + { .oid = _CPU_MAX_BASIC, .type = CTLTYPE_INT, .exttype = "I", .name = "max_basic", .handler = handle_max_basic }, 16 19 { .oid = -1 } 17 20 }; 18 21 ··· 51 54 return 0; 52 55 } 53 56 57 + sysctl_handler(handle_max_basic) 58 + { 59 + unsigned int level = 0; 60 + unsigned int eax = 0; 61 + union 62 + { 63 + struct 64 + { 65 + unsigned int ebx; 66 + unsigned int edx; 67 + unsigned int ecx; 68 + }; 69 + char name[13]; 70 + } v; 71 + 72 + __cpuid(level, eax, v.ebx, v.ecx, v.edx); 73 + 74 + 75 + sprintf(old,"%d",eax); 76 + 77 + return 0; 78 + } 79 +