129
129
* 80000008:00003024000000000000000000000000-
131
131
* The returned eax of args[0] is used to determine the upper bound for
132
* the following input arguments. And the input args should be in ascending
132
* the following input arguments. And the input args should be in
136
136
* None. The string will be appended in buf.
155
155
__GET_CPUID(args[0], ®);
156
156
max_arg = reg.eax;
157
157
if (max_arg < args[0]) {
158
Warning(LGPFX" No CPUID information available. Based = %08X.\n", args[0]);
158
Warning(LGPFX" No CPUID information available. Based = %08X.\n",
161
162
DynBuf_Append(buf, temp,
162
Str_Sprintf(temp, sizeof temp, format, args[0], reg.eax, reg.ebx, reg.ecx, reg.edx));
163
Str_Sprintf(temp, sizeof temp, format, args[0], reg.eax,
164
reg.ebx, reg.ecx, reg.edx));
164
166
for (i = 1; i < args_size && args[i] <= max_arg; i++) {
165
167
ASSERT(args[i] > args[i - 1]); // Ascending order.
166
168
__GET_CPUID(args[i], ®);
168
170
DynBuf_Append(buf, temp,
169
Str_Sprintf(temp, sizeof temp, format, args[i], reg.eax, reg.ebx, reg.ecx, reg.edx));
171
Str_Sprintf(temp, sizeof temp, format, args[i], reg.eax,
172
reg.ebx, reg.ecx, reg.edx));
186
189
* If the extended CPUID is not available, only returns the basic CPUID.
189
* The CPUID string if the processor supports the CPUID instruction and this
190
* is a processor we recognize. It should never fail, since it would at least
191
* return leaf 0. Caller needs to free the returned string.
192
* The CPUID string if the processor supports the CPUID instruction and
193
* this is a processor we recognize. It should never fail, since it
194
* would at least return leaf 0. Caller needs to free the returned string.
555
*-----------------------------------------------------------------------------
557
* Hostinfo_SystemTimerUS --
560
* - These timers are documented to never go backwards.
561
* - These timers may take locks
564
* These are the routines to use when performing timing measurements.
566
* The value returned is valid (finish-time - start-time) only within a
567
* single process. Don't send a time measurement obtained with these
568
* routines to another process and expect a relative time measurement
571
* The actual resolution of these "clocks" are undefined - it varies
572
* depending on hardware, OSen and OS versions.
575
* The time in microseconds is returned. Zero upon error.
580
*-----------------------------------------------------------------------------
584
Hostinfo_SystemTimerUS(void)
586
return Hostinfo_SystemTimerNS() / 1000;