Replace cpu_has* flags with single cpu_features variable and cpu_has_feature() getter.

This commit is contained in:
SarahW 2019-02-08 21:22:53 +00:00
commit ce4436054d
8 changed files with 53 additions and 87 deletions

View file

@ -114,13 +114,19 @@ extern int cpu_multi;
/*Cyrix 5x86/6x86 only has data misalignment penalties when crossing 8-byte boundaries*/
extern int cpu_cyrix_alignment;
extern int cpu_hasrdtsc;
extern int cpu_hasMSR;
extern int cpu_hasMMX;
extern int cpu_hasCR4;
extern int cpu_hasVME;
extern int cpu_hasCX8;
extern int cpu_has3DNOW;
#define CPU_FEATURE_RDTSC (1 << 0)
#define CPU_FEATURE_MSR (1 << 1)
#define CPU_FEATURE_MMX (1 << 2)
#define CPU_FEATURE_CR4 (1 << 3)
#define CPU_FEATURE_VME (1 << 4)
#define CPU_FEATURE_CX8 (1 << 5)
#define CPU_FEATURE_3DNOW (1 << 6)
extern uint32_t cpu_features;
static int cpu_has_feature(int feature)
{
return cpu_features & feature;
}
#define CR4_TSD (1 << 2)
#define CR4_DE (1 << 3)