45 m_Lines[m_LineCount++] =
"CPU information";
47#if X86_COMMON && !HOSTED
48 uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0;
50 const uint32_t maxLeaf = eax;
52 MemoryCopy(vendor, &ebx,
sizeof(ebx));
53 MemoryCopy(vendor + 4, &edx,
sizeof(edx));
54 MemoryCopy(vendor + 8, &ecx,
sizeof(ecx));
56 m_Lines[m_LineCount++] =
"Vendor: ";
57 m_Lines[m_LineCount - 1] += vendor;
61 const uint32_t baseFamily = (eax >> 8) & 0xf;
62 const uint32_t baseModel = (eax >> 4) & 0xf;
63 const uint32_t family = baseFamily == 0xf ? baseFamily + ((eax >> 20) & 0xff) : baseFamily;
64 const uint32_t model = (baseFamily == 0x6 || baseFamily == 0xf)
65 ? baseModel | (((eax >> 16) & 0xf) << 4)
67 m_Lines[m_LineCount++] =
"Family/model/stepping: ";
68 m_Lines[m_LineCount - 1].append(family, 10);
69 m_Lines[m_LineCount - 1] +=
"/";
70 m_Lines[m_LineCount - 1].append(model, 10);
71 m_Lines[m_LineCount - 1] +=
"/";
72 m_Lines[m_LineCount - 1].append(eax & 0xf, 10);
73 m_Lines[m_LineCount++] =
"Logical CPUs reported: ";
74 m_Lines[m_LineCount - 1].append((ebx >> 16) & 0xff, 10);
75 m_Lines[m_LineCount++] =
"Features: ";
77 m_Lines[m_LineCount - 1] +=
"SSE ";
79 m_Lines[m_LineCount - 1] +=
"SSE2 ";
81 m_Lines[m_LineCount - 1] +=
"SSE3 ";
83 m_Lines[m_LineCount - 1] +=
"SSSE3 ";
85 m_Lines[m_LineCount - 1] +=
"SSE4.1 ";
87 m_Lines[m_LineCount - 1] +=
"SSE4.2 ";
89 m_Lines[m_LineCount - 1] +=
"AVX ";
91 m_Lines[m_LineCount - 1] +=
"HTT";
95 if (eax >= 0x80000004) {
97 for (uint32_t leaf = 0; leaf < 3; ++leaf) {
99 MemoryCopy(brand + leaf * 16, &eax,
sizeof(eax));
100 MemoryCopy(brand + leaf * 16 + 4, &ebx,
sizeof(ebx));
101 MemoryCopy(brand + leaf * 16 + 8, &ecx,
sizeof(ecx));
102 MemoryCopy(brand + leaf * 16 + 12, &edx,
sizeof(edx));
105 for (
size_t i = 48; i && brand[i - 1] ==
' '; --i)
107 m_Lines[m_LineCount++] =
"Name: ";
108 m_Lines[m_LineCount - 1] += brand;
113 m_Lines[m_LineCount++] =
"Processor: ";
114 m_Lines[m_LineCount - 1] +=
identity;
117 m_Lines[m_LineCount++] =
"Online CPUs: ";
119 m_Lines[m_LineCount++] =
"Build revision: ";
120 m_Lines[m_LineCount - 1] += g_pBuildRevision;
121 m_Lines[m_LineCount++] =
"Built by ";
122 m_Lines[m_LineCount - 1] += g_pBuildUser;
123 m_Lines[m_LineCount - 1] +=
" at ";
124 m_Lines[m_LineCount - 1] += g_pBuildTime;
125 m_Lines[m_LineCount - 1] +=
" on ";
126 m_Lines[m_LineCount - 1] += g_pBuildMachine;
127 m_Lines[m_LineCount++] =
"Build target: ";
128 m_Lines[m_LineCount - 1] += g_pBuildTarget;
129 m_Lines[m_LineCount++] =
"Build flags: ";
130 m_Lines[m_LineCount - 1] += g_pBuildFlags;
132 screen->disableCli();
134 resize(screen->
getWidth(), screen->getHeight() - 2);
135 setScrollKeys(
'j',
'k');
138 screen->
drawString(
"Pedigree debugger - CPU/build info", 0, 0, DebuggerIO::White,
141 DebuggerIO::White, DebuggerIO::Green);
148 while (!(c = screen->
getChar()))
155 scroll(
static_cast<ssize_t
>(height()));
157 scroll(-
static_cast<ssize_t
>(height()));
162 screen->
drawString(
" ", 1, 0, DebuggerIO::White, DebuggerIO::Black);