24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#include "unistd_wrapper.h"
#include "platform.h"
#ifdef HAVE_SYS_UTSNAME_H
# include <sys/utsname.h>
#endif
#ifdef OF_MACOS
# include <sys/sysctl.h>
#endif
#if defined(OF_AMIGAOS4)
# define __USE_INLINE__
# define __NOLIBBASE__
# define __NOGLOBALIFACE__
|
|
|
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#include "unistd_wrapper.h"
#include "platform.h"
#ifdef HAVE_SYS_UTSNAME_H
# include <sys/utsname.h>
#endif
#if defined(OF_MACOS) || defined(OF_NETBSD)
# include <sys/sysctl.h>
#endif
#if defined(OF_AMIGAOS4)
# define __USE_INLINE__
# define __NOLIBBASE__
# define __NOGLOBALIFACE__
|
566
567
568
569
570
571
572
573
574
575
576
577
578
579
|
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
}
#if defined(OF_X86_64) || defined(OF_X86)
+ (bool)supportsMMX
{
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
|
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
}
+ (OFString *)CPUModel
{
#if defined(OF_MACOS) || defined(OF_NETBSD)
char value[256];
size_t length = sizeof(value);
# if defined(OF_MACOS)
if (sysctlbyname("machdep.cpu.brand_string",
# elif defined(OF_NETBSD)
if (sysctlbyname("machdep.cpu_brand",
# endif
&value, &length, NULL, 0) != 0)
return nil;
return [OFString stringWithCString: value
encoding: OF_STRING_ENCODING_ASCII];
#elif defined(OF_AMIGAOS4)
CONST_STRPTR model, version;
GetCPUInfoTags(GCIT_ModelString, &model,
GCIT_VersionString, &version, TAG_END);
if (version != NULL)
return [OFString stringWithFormat: @"%s V%s", model, version];
else
return [OFString stringWithCString: model
encoding: OF_STRING_ENCODING_ASCII];
#else
return nil;
#endif
}
#if defined(OF_X86_64) || defined(OF_X86)
+ (bool)supportsMMX
{
|