530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
|
}
#endif
+ (OFString *)CPUVendor
{
#if defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
struct x86_regs regs = x86_cpuid(0, 0);
char buffer[12];
if (regs.eax == 0)
return nil;
memcpy(buffer, ®s.ebx, 4);
memcpy(buffer + 4, ®s.edx, 4);
memcpy(buffer + 8, ®s.ecx, 4);
return [OFString stringWithCString: buffer
encoding: OF_STRING_ENCODING_ASCII
length: 12];
#else
return nil;
#endif
}
|
|
|
|
|
|
|
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
|
}
#endif
+ (OFString *)CPUVendor
{
#if defined(OF_X86_64_ASM) || defined(OF_X86_ASM)
struct x86_regs regs = x86_cpuid(0, 0);
uint32_t buffer[3];
if (regs.eax == 0)
return nil;
buffer[0] = regs.ebx;
buffer[1] = regs.edx;
buffer[2] = regs.ecx;
return [OFString stringWithCString: (char *)buffer
encoding: OF_STRING_ENCODING_ASCII
length: 12];
#else
return nil;
#endif
}
|