revert between 56095 -> 55830 in arch
[AROS.git] / workbench / tools / SysExplorer / cpu_i386.c
blob038c2be1f69a5ee870513daeed1679f4cddd7388
1 #include <resources/processor.h>
2 #include <proto/processor.h>
4 #include <stdio.h>
5 #include <string.h>
7 #include "cpuspecific.h"
9 #ifdef __x86__
11 #define FLAGS_NUM 14
13 static const char *features[] =
15 "FPU",
16 "MMX",
17 "MMXExt",
18 "3DNow!",
19 "3DNowExt!",
20 "SSE",
21 "SSE2",
22 "SSE3",
23 "SSSE3",
24 "SSE4.1",
25 "SSE4.2",
26 "SSE4A",
27 "NoExecute",
28 "64Bit"
31 void PrintCPUSpecificInfo(char *buffer, LONG bufsize, ULONG i, APTR ProcessorBase)
33 LONG slen;
34 char *bufptr = buffer;
36 BOOL nothing = TRUE;
37 BOOL flags[FLAGS_NUM];
38 struct TagItem tags [FLAGS_NUM + 2] =
40 {GCIT_SelectedProcessor, i},
41 {GCIT_SupportsFPU , (IPTR)&flags[0 ]},
42 {GCIT_SupportsMMX , (IPTR)&flags[1 ]},
43 {GCIT_SupportsMMXEXT , (IPTR)&flags[2 ]},
44 {GCIT_Supports3DNOW , (IPTR)&flags[3 ]},
45 {GCIT_Supports3DNOWEXT , (IPTR)&flags[4 ]},
46 {GCIT_SupportsSSE , (IPTR)&flags[5 ]},
47 {GCIT_SupportsSSE2 , (IPTR)&flags[6 ]},
48 {GCIT_SupportsSSE3 , (IPTR)&flags[7 ]},
49 {GCIT_SupportsSSSE3 , (IPTR)&flags[8 ]},
50 {GCIT_SupportsSSE41 , (IPTR)&flags[9 ]},
51 {GCIT_SupportsSSE42 , (IPTR)&flags[10]},
52 {GCIT_SupportsSSE4A , (IPTR)&flags[11]},
53 {GCIT_SupportsNoExecutionBit, (IPTR)&flags[12]},
54 {GCIT_Supports64BitMode , (IPTR)&flags[13]},
55 {TAG_DONE , 0 }
58 GetCPUInfo(tags);
60 for (i = 0; bufsize > 1 && i < FLAGS_NUM; i++)
62 if (flags[i])
64 nothing = FALSE;
65 snprintf(bufptr, bufsize, "%s ", features[i]);
66 slen = strlen(bufptr);
67 bufptr += slen;
68 bufsize -= slen;
72 if (bufsize > 5)
74 if (nothing)
76 sprintf(bufptr, "None");
77 slen = strlen(bufptr);
78 bufptr += slen;
79 bufsize -= slen;
81 sprintf(bufptr, "\n");
85 #endif