Commit fb25886c authored by Sam Lantinga's avatar Sam Lantinga

Greatly simplified the SDL CPU info code

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40746
parent c1da62cb
...@@ -37,6 +37,10 @@ static char rcsid = ...@@ -37,6 +37,10 @@ static char rcsid =
extern "C" { extern "C" {
#endif #endif
/* This function returns true if the CPU has the RDTSC instruction
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC();
/* This function returns true if the CPU has MMX features /* This function returns true if the CPU has MMX features
*/ */
extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(); extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX();
......
This diff is collapsed.
###########################################################################
#
# Some consistent rules for building asm files:
STRIP_FPIC = sh $(top_srcdir)/strip_fPIC.sh
SUFFIXES = .asm
.asm.lo:
$(LIBTOOL) --tag=CC --mode=compile $(STRIP_FPIC) $(NASM) -t -D __FLAT__ @NASMFLAGS@ $< -o $*.o
###########################################################################
# The cpuinfo library target # The cpuinfo library target
noinst_LTLIBRARIES = libcpuinfo.la noinst_LTLIBRARIES = libcpuinfo.la
if HAVE_NASM
ARCH_SRCS = \
_cpuinfo.asm \
_pcihelp.asm
else
ARCH_SRCS =
endif
COMMON_SRCS = \ COMMON_SRCS = \
cpuinfo.h \
gcpuinfo.c \
SDL_cpuinfo.c SDL_cpuinfo.c
libcpuinfo_la_SOURCES = $(ARCH_SRCS) $(COMMON_SRCS) libcpuinfo_la_SOURCES = $(COMMON_SRCS)
EXTRA_DIST = \
COPYING.LIB \
README
This is a stripped down version of the portable CPU detection code included
in the SciTech SNAP Graphics SDK. It is redistributed under the LGPL license,
which can be found in COPYING.LIB.
You can visit SciTech Software Inc. at: http://www.scitechsoft.com/
...@@ -28,16 +28,160 @@ static char rcsid = ...@@ -28,16 +28,160 @@ static char rcsid =
/* CPU feature detection for SDL */ /* CPU feature detection for SDL */
#include "SDL.h" #include "SDL.h"
//#include "SDL_cpuinfo.h" #include "SDL_cpuinfo.h"
#define CPU_HAS_MMX 0x00000001 #define CPU_HAS_RDTSC 0x00000001
#define CPU_HAS_3DNOW 0x00000002 #define CPU_HAS_MMX 0x00000002
#define CPU_HAS_SSE 0x00000004 #define CPU_HAS_3DNOW 0x00000004
#define CPU_HAS_SSE 0x00000008
/* These functions come from SciTech's PM library */ static __inline__ int CPU_haveCPUID()
extern int CPU_haveMMX(); {
extern int CPU_have3DNow(); int has_CPUID = 0;
extern int CPU_haveSSE(); #if defined(__GNUC__) && defined(i386)
__asm__ (
"push %%ecx\n"
" pushfl # Get original EFLAGS \n"
" popl %%eax \n"
" movl %%eax,%%ecx \n"
" xorl $0x200000,%%eax # Flip ID bit in EFLAGS \n"
" pushl %%eax # Save new EFLAGS value on stack \n"
" popfl # Replace current EFLAGS value \n"
" pushfl # Get new EFLAGS \n"
" popl %%eax # Store new EFLAGS in EAX \n"
" xorl %%ecx,%%eax # Can not toggle ID bit, \n"
" jz 1f # Processor=80486 \n"
" movl $1,%0 # We have CPUID support \n"
"1: \n"
"pop %%ecx\n"
: "=r" (has_CPUID)
:
: "%eax", "%ecx"
);
#elif defined(_MSC_VER)
__asm__ {
pushfd ; Get original EFLAGS
pop eax
mov ecx, eax
xor eax, 200000h ; Flip ID bit in EFLAGS
push eax ; Save new EFLAGS value on stack
popfd ; Replace current EFLAGS value
pushfd ; Get new EFLAGS
pop eax ; Store new EFLAGS in EAX
xor eax, ecx ; Can not toggle ID bit,
jz done ; Processor=80486
mov has_CPUID,1 ; We have CPUID support
done:
}
#endif
return has_CPUID;
}
static __inline__ int CPU_getCPUIDFeatures()
{
int features = 0;
#if defined(__GNUC__) && defined(i386)
__asm__ (
"push %%ebx\n"
"push %%ecx\n"
"push %%edx\n"
" xorl %%eax,%%eax # Set up for CPUID instruction \n"
" cpuid # Get and save vendor ID \n"
" cmpl $1,%%eax # Make sure 1 is valid input for CPUID\n"
" jl 1f # We dont have the CPUID instruction\n"
" xorl %%eax,%%eax \n"
" incl %%eax \n"
" cpuid # Get family/model/stepping/features\n"
" movl %%edx,%0 \n"
"1: \n"
"pop %%edx\n"
"pop %%ecx\n"
"pop %%ebx\n"
: "=r" (features)
:
: "%eax", "%ebx", "%ecx", "%edx"
);
#elif defined(_MSC_VER)
__asm__ {
xor eax, eax ; Set up for CPUID instruction
cpuid ; Get and save vendor ID
cmp eax, 1 ; Make sure 1 is valid input for CPUID
jl done ; We dont have the CPUID instruction
xor eax, eax
inc eax
cpuid ; Get family/model/stepping/features
mov features, edx
done:
}
#endif
return features;
}
static __inline__ int CPU_haveRDTSC()
{
if ( CPU_haveCPUID() ) {
return (CPU_getCPUIDFeatures() & 0x00000010);
}
return 0;
}
static __inline__ int CPU_haveMMX()
{
if ( CPU_haveCPUID() ) {
return (CPU_getCPUIDFeatures() & 0x00800000);
}
return 0;
}
static __inline__ int CPU_have3DNow()
{
int has_3DNow = 0;
#if defined(__GNUC__) && defined(i386)
__asm__ (
"push %%ebx\n"
"push %%ecx\n"
"push %%edx\n"
" movl $0x80000000,%%eax # Query for extended functions \n"
" cpuid # Get extended function limit \n"
" cmpl $0x80000001,%%eax \n"
" jbe 1f # Nope, we dont have function 800000001h\n"
" movl $0x80000001,%%eax # Setup extended function 800000001h\n"
" cpuid # and get the information \n"
" testl $0x80000000,%%edx # Bit 31 is set if 3DNow! present \n"
" jz 1f # Nope, we dont have 3DNow support\n"
" movl $1,%0 # Yep, we have 3DNow! support! \n"
"1: \n"
"pop %%edx\n"
"pop %%ecx\n"
"pop %%ebx\n"
: "=r" (has_3DNow)
:
: "%eax", "%ebx", "%ecx", "%edx"
);
#elif defined(_MSC_VER)
__asm__ {
mov eax,80000000h ; Query for extended functions
cpuid ; Get extended function limit
cmp eax,80000001h
jbe done ; Nope, we dont have function 800000001h
mov eax,80000001h ; Setup extended function 800000001h
cpuid ; and get the information
test edx,80000000h ; Bit 31 is set if 3DNow! present
jz done ; Nope, we dont have 3DNow support
mov has_3DNow,1 ; Yep, we have 3DNow! support!
done:
}
#endif
return has_3DNow;
}
static __inline__ int CPU_haveSSE()
{
if ( CPU_haveCPUID() ) {
return (CPU_getCPUIDFeatures() & 0x02000000);
}
return 0;
}
static Uint32 SDL_CPUFeatures = 0xFFFFFFFF; static Uint32 SDL_CPUFeatures = 0xFFFFFFFF;
...@@ -45,6 +189,9 @@ static Uint32 SDL_GetCPUFeatures() ...@@ -45,6 +189,9 @@ static Uint32 SDL_GetCPUFeatures()
{ {
if ( SDL_CPUFeatures == 0xFFFFFFFF ) { if ( SDL_CPUFeatures == 0xFFFFFFFF ) {
SDL_CPUFeatures = 0; SDL_CPUFeatures = 0;
if ( CPU_haveRDTSC() ) {
SDL_CPUFeatures |= CPU_HAS_RDTSC;
}
if ( CPU_haveMMX() ) { if ( CPU_haveMMX() ) {
SDL_CPUFeatures |= CPU_HAS_MMX; SDL_CPUFeatures |= CPU_HAS_MMX;
} }
...@@ -58,6 +205,14 @@ static Uint32 SDL_GetCPUFeatures() ...@@ -58,6 +205,14 @@ static Uint32 SDL_GetCPUFeatures()
return SDL_CPUFeatures; return SDL_CPUFeatures;
} }
SDL_bool SDL_HasRDTSC()
{
if ( SDL_GetCPUFeatures() & CPU_HAS_RDTSC ) {
return SDL_TRUE;
}
return SDL_FALSE;
}
SDL_bool SDL_HasMMX() SDL_bool SDL_HasMMX()
{ {
if ( SDL_GetCPUFeatures() & CPU_HAS_MMX ) { if ( SDL_GetCPUFeatures() & CPU_HAS_MMX ) {
...@@ -91,6 +246,7 @@ int main() ...@@ -91,6 +246,7 @@ int main()
printf("MMX: %d\n", SDL_HasMMX()); printf("MMX: %d\n", SDL_HasMMX());
printf("3DNow: %d\n", SDL_Has3DNow()); printf("3DNow: %d\n", SDL_Has3DNow());
printf("SSE: %d\n", SDL_HasSSE()); printf("SSE: %d\n", SDL_HasSSE());
return 0;
} }
#endif /* TEST_MAIN */ #endif /* TEST_MAIN */
This diff is collapsed.
;****************************************************************************
;*
;* SciTech OS Portability Manager Library
;*
;* ========================================================================
;*
;* Copyright (C) 1991-2002 SciTech Software, Inc. All rights reserved.
;*
;* This file may be distributed and/or modified under the terms of the
;* GNU Lesser General Public License version 2.1 as published by the Free
;* Software Foundation and appearing in the file LICENSE.LGPL included
;* in the packaging of this file.
;*
;* Licensees holding a valid Commercial License for this product from
;* SciTech Software, Inc. may use this file in accordance with the
;* Commercial License Agreement provided with the Software.
;*
;* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING
;* THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
;* PURPOSE.
;*
;* See http://www.scitechsoft.com/license/ for information about
;* the licensing options available and how to purchase a Commercial
;* License Agreement.
;*
;* Contact license@scitechsoft.com if any conditions of this licensing
;* are not clear to you, or you have questions about licensing options.
;*
;* ========================================================================
;*
;* Language: NASM
;* Environment: Any
;*
;* Description: Helper assembler functions for PCI access module.
;*
;****************************************************************************
include "scitech.mac" ; Memory model macros
header _pcilib
begcodeseg _pcilib
ifdef flatmodel
;----------------------------------------------------------------------------
; uchar _ASMAPI _BIOS32_service(
; ulong service,
; ulong func,
; ulong *physBase,
; ulong *length,
; ulong *serviceOffset,
; PCIBIOS_entry entry);
;----------------------------------------------------------------------------
; Call the BIOS32 services directory
;----------------------------------------------------------------------------
cprocstart _BIOS32_service
ARG service:ULONG, func:ULONG, physBase:DPTR, len:DPTR, off:DPTR, entry:QWORD
enter_c
mov eax,[service]
mov ebx,[func]
call far dword [entry]
mov esi,[physBase]
mov [esi],ebx
mov esi,[len]
mov [esi],ecx
mov esi,[off]
mov [esi],edx
leave_c
ret
cprocend
endif
;----------------------------------------------------------------------------
; ushort _ASMAPI _PCIBIOS_isPresent(ulong i_eax,ulong *o_edx,ushort *oeax,
; uchar *o_cl,PCIBIOS_entry entry)
;----------------------------------------------------------------------------
; Call the PCI BIOS to determine if it is present.
;----------------------------------------------------------------------------
cprocstart _PCIBIOS_isPresent
ARG i_eax:ULONG, o_edx:DPTR, oeax:DPTR, o_cl:DPTR, entry:QWORD
enter_c
mov eax,[i_eax]
ifdef flatmodel
call far dword [entry]
else
int 1Ah
endif
_les _si,[o_edx]
mov [_ES _si],edx
_les _si,[oeax]
mov [_ES _si],ax
_les _si,[o_cl]
mov [_ES _si],cl
mov ax,bx
leave_c
ret
cprocend
;----------------------------------------------------------------------------
; ulong _PCIBIOS_service(ulong r_eax,ulong r_ebx,ulong r_edi,ulong r_ecx,
; PCIBIOS_entry entry)
;----------------------------------------------------------------------------
; Call the PCI BIOS services, either via the 32-bit protected mode entry
; point or via the Int 1Ah 16-bit interrupt.
;----------------------------------------------------------------------------
cprocstart _PCIBIOS_service
ARG r_eax:ULONG, r_ebx:ULONG, r_edi:ULONG, r_ecx:ULONG, entry:QWORD
enter_c
mov eax,[r_eax]
mov ebx,[r_ebx]
mov edi,[r_edi]
mov ecx,[r_ecx]
ifdef flatmodel
call far dword [entry]
else
int 1Ah
endif
mov eax,ecx
ifndef flatmodel
shld edx,eax,16 ; Return result in DX:AX
endif
leave_c
ret
cprocend
;----------------------------------------------------------------------------
; int _PCIBIOS_getRouting(PCIRoutingOptionsBuffer *buf,PCIBIOS_entry entry);
;----------------------------------------------------------------------------
; Get the routing options for PCI devices
;----------------------------------------------------------------------------
cprocstart _PCIBIOS_getRouting
ARG buf:DPTR, entry:QWORD
enter_c
mov eax,0B10Eh
mov bx,0
_les _di,[buf]
ifdef flatmodel
call far dword [entry]
else
int 1Ah
endif
movzx eax,ah
leave_c
ret
cprocend
;----------------------------------------------------------------------------
; ibool _PCIBIOS_setIRQ(int busDev,int intPin,int IRQ,PCIBIOS_entry entry);
;----------------------------------------------------------------------------
; Change the IRQ routing for the PCI device
;----------------------------------------------------------------------------
cprocstart _PCIBIOS_setIRQ
ARG busDev:UINT, intPin:UINT, IRQ:UINT, entry:QWORD
enter_c
mov eax,0B10Fh
mov bx,[USHORT busDev]
mov cl,[BYTE intPin]
mov ch,[BYTE IRQ]
ifdef flatmodel
call far dword [entry]
else
int 1Ah
endif
mov eax,1
jnc @@1
xor eax,eax ; Function failed!
@@1: leave_c
ret
cprocend
;----------------------------------------------------------------------------
; ulong _PCIBIOS_specialCycle(int bus,ulong data,PCIBIOS_entry entry);
;----------------------------------------------------------------------------
; Generate a special cycle via the PCI BIOS.
;----------------------------------------------------------------------------
cprocstart _PCIBIOS_specialCycle
ARG bus:UINT, data:ULONG, entry:QWORD
enter_c
mov eax,0B106h
mov bh,[BYTE bus]
mov ecx,[data]
ifdef flatmodel
call far dword [entry]
else
int 1Ah
endif
leave_c
ret
cprocend
;----------------------------------------------------------------------------
; ushort _PCI_getCS(void)
;----------------------------------------------------------------------------
cprocstart _PCI_getCS
mov ax,cs
ret
cprocend
;----------------------------------------------------------------------------
; int PM_inpb(int port)
;----------------------------------------------------------------------------
; Reads a byte from the specified port
;----------------------------------------------------------------------------
cprocstart PM_inpb
ARG port:UINT
push _bp
mov _bp,_sp
xor _ax,_ax
mov _dx,[port]
in al,dx
pop _bp
ret
cprocend
;----------------------------------------------------------------------------
; int PM_inpw(int port)
;----------------------------------------------------------------------------
; Reads a word from the specified port
;----------------------------------------------------------------------------
cprocstart PM_inpw
ARG port:UINT
push _bp
mov _bp,_sp
xor _ax,_ax
mov _dx,[port]
in ax,dx
pop _bp
ret
cprocend
;----------------------------------------------------------------------------
; ulong PM_inpd(int port)
;----------------------------------------------------------------------------
; Reads a word from the specified port
;----------------------------------------------------------------------------
cprocstart PM_inpd
ARG port:UINT
push _bp
mov _bp,_sp
mov _dx,[port]
in eax,dx
ifndef flatmodel
shld edx,eax,16 ; DX:AX = result
endif
pop _bp
ret
cprocend
;----------------------------------------------------------------------------
; void PM_outpb(int port,int value)
;----------------------------------------------------------------------------
; Write a byte to the specified port.
;----------------------------------------------------------------------------
cprocstart PM_outpb
ARG port:UINT, value:UINT
push _bp
mov _bp,_sp
mov _dx,[port]
mov _ax,[value]
out dx,al
pop _bp
ret
cprocend
;----------------------------------------------------------------------------
; void PM_outpw(int port,int value)
;----------------------------------------------------------------------------
; Write a word to the specified port.
;----------------------------------------------------------------------------
cprocstart PM_outpw
ARG port:UINT, value:UINT
push _bp
mov _bp,_sp
mov _dx,[port]
mov _ax,[value]
out dx,ax
pop _bp
ret
cprocend
;----------------------------------------------------------------------------
; void PM_outpd(int port,ulong value)
;----------------------------------------------------------------------------
; Write a word to the specified port.
;----------------------------------------------------------------------------
cprocstart PM_outpd
ARG port:UINT, value:ULONG
push _bp
mov _bp,_sp
mov _dx,[port]
mov eax,[value]
out dx,eax
pop _bp
ret
cprocend
endcodeseg _pcilib
END
/****************************************************************************
*
* SciTech OS Portability Manager Library
*
* ========================================================================
*
* Copyright (C) 1991-2002 SciTech Software, Inc. All rights reserved.
*
* This file may be distributed and/or modified under the terms of the
* GNU Lesser General Public License version 2.1 as published by the Free
* Software Foundation and appearing in the file LICENSE.LGPL included
* in the packaging of this file.
*
* Licensees holding a valid Commercial License for this product from
* SciTech Software, Inc. may use this file in accordance with the
* Commercial License Agreement provided with the Software.
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING
* THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE.
*
* See http://www.scitechsoft.com/license/ for information about
* the licensing options available and how to purchase a Commercial
* License Agreement.
*
* Contact license@scitechsoft.com if any conditions of this licensing
* are not clear to you, or you have questions about licensing options.
*
* ========================================================================
*
* Language: ANSI C
* Environment: Any
*
* Description: Header file for PM library functions for querying the CPU
* type, CPU speed and CPU features. Includes support for
* high precision timing on Pentium based systems using the
* Read Time Stamp Counter.
*
****************************************************************************/
#ifndef __CPUINFO_H
#define __CPUINFO_H
//#include "scitech.h"
#include "SDL.h"
#ifdef USE_ASMBLIT
#define __INTEL__
#endif
typedef enum {
false,
true
} ibool;
typedef Uint8 uchar;
typedef Uint16 ushort;
typedef Uint32 uint;
typedef Uint32 ulong;
typedef Uint64 u64;
#define _ASMAPI SDLCALL
/*--------------------- Macros and type definitions -----------------------*/
/* Define the calling conventions - C always */
#define ZAPI _ASMAPI
/****************************************************************************
REMARKS:
Defines the types of processors returned by CPU_getProcessorType.
HEADER:
cpuinfo.h
MEMBERS:
CPU_i386 - Intel 80386 processor
CPU_i486 - Intel 80486 processor
CPU_Pentium - Intel Pentium(R) processor
CPU_PentiumPro - Intel PentiumPro(R) processor
CPU_PentiumII - Intel PentiumII(R) processor
CPU_Celeron - Intel Celeron(R) processor
CPU_PentiumIII - Intel PentiumIII(R) processor
CPU_Pentium4 - Intel Pentium4(R) processor
CPU_UnkIntel - Unknown Intel processor
CPU_Cyrix6x86 - Cyrix 6x86 processor
CPU_Cyrix6x86MX - Cyrix 6x86MX processor
CPU_CyrixMediaGX - Cyrix MediaGX processor
CPU_CyrixMediaGXm - Cyrix MediaGXm processor
CPU_UnkCyrix - Unknown Cyrix processor
CPU_AMDAm486 - AMD Am486 processor
CPU_AMDAm5x86 - AMD Am5x86 processor
CPU_AMDK5 - AMD K5 processor
CPU_AMDK6 - AMD K6 processor
CPU_AMDK6_2 - AMD K6-2 processor
CPU_AMDK6_2plus - AMD K6-2+ processor
CPU_AMDK6_III - AMD K6-III processor
CPU_AMDK6_IIIplus - AMD K6-III+ processor
CPU_AMDAthlon - AMD Athlon processor
CPU_AMDDuron - AMD Duron processor
CPU_UnkAMD - Unknown AMD processor
CPU_WinChipC6 - IDT WinChip C6 processor
CPU_WinChip2 - IDT WinChip 2 processor
CPU_UnkIDT - Unknown IDT processor
CPU_ViaCyrixIII - Via Cyrix III
CPU_UnkVIA - Unknown Via processor
CPU_Alpha - DEC Alpha processor
CPU_Mips - MIPS processor
CPU_PowerPC - PowerPC processor
CPU_mask - Mask to remove flags and get CPU type
CPU_IDT - This bit is set if the processor vendor is IDT
CPU_Cyrix - This bit is set if the processor vendor is Cyrix
CPU_AMD - This bit is set if the processor vendor is AMD
CPU_Intel - This bit is set if the processor vendor is Intel
CPU_VIA - This bit is set if the processor vendor is Via
CPU_familyMask - Mask to isolate CPU family
CPU_steppingMask - Mask to isolate CPU stepping
CPU_steppingShift - Shift factor for CPU stepping
****************************************************************************/
typedef enum {
CPU_i386 = 0,
CPU_i486 = 1,
CPU_Pentium = 2,
CPU_PentiumPro = 3,
CPU_PentiumII = 4,
CPU_Celeron = 5,
CPU_PentiumIII = 6,
CPU_Pentium4 = 7,
CPU_UnkIntel = 8,
CPU_Cyrix6x86 = 100,
CPU_Cyrix6x86MX = 101,
CPU_CyrixMediaGX = 102,
CPU_CyrixMediaGXm = 104,
CPU_UnkCyrix = 105,
CPU_AMDAm486 = 200,
CPU_AMDAm5x86 = 201,
CPU_AMDK5 = 202,
CPU_AMDK6 = 203,
CPU_AMDK6_2 = 204,
CPU_AMDK6_2plus = 205,
CPU_AMDK6_III = 206,
CPU_AMDK6_IIIplus = 207,
CPU_UnkAMD = 208,
CPU_AMDAthlon = 250,
CPU_AMDDuron = 251,
CPU_WinChipC6 = 300,
CPU_WinChip2 = 301,
CPU_UnkIDT = 302,
CPU_ViaCyrixIII = 400,
CPU_UnkVIA = 401,
CPU_Alpha = 500,
CPU_Mips = 600,
CPU_PowerPC = 700,
CPU_mask = 0x00000FFF,
CPU_IDT = 0x00001000,
CPU_Cyrix = 0x00002000,
CPU_AMD = 0x00004000,
CPU_Intel = 0x00008000,
CPU_VIA = 0x00010000,
CPU_familyMask = 0x00FFF000,
CPU_steppingMask = 0x0F000000,
CPU_steppingShift = 24
} CPU_processorType;
#pragma pack(1)
/****************************************************************************
REMARKS:
Defines the structure for holding 64-bit integers used for storing the values
returned by the Intel RDTSC instruction.
HEADER:
cpuinfo.h
MEMBERS:
low - Low 32-bits of the 64-bit integer
high - High 32-bits of the 64-bit integer
****************************************************************************/
typedef struct {
ulong low;
ulong high;
} CPU_largeInteger;
#pragma pack()
/*-------------------------- Function Prototypes --------------------------*/
#ifdef __cplusplus
extern "C" { /* Use "C" linkage when in C++ mode */
#endif
/* Routines to obtain CPU information */
uint ZAPI CPU_getProcessorType(void);
ibool ZAPI CPU_haveMMX(void);
ibool ZAPI CPU_have3DNow(void);
ibool ZAPI CPU_haveSSE(void);
ibool ZAPI CPU_haveRDTSC(void);
ulong ZAPI CPU_getProcessorSpeed(ibool accurate);
void ZAPI CPU_getProcessorSpeedInHZ(ibool accurate,CPU_largeInteger *speed);
char * ZAPI CPU_getProcessorName(void);
#ifdef __cplusplus
} /* End of "C" linkage for C++ */
#endif
#endif /* __CPUINFO_H */
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment