[prev in list] [next in list] [prev in thread] [next in thread]
List: bochs-cvs
Subject: [Bochs-cvs] SF.net SVN: bochs:[10503] trunk/bochs/cpu
From: sshwarts () users ! sourceforge ! net
Date: 2011-07-28 19:20:17
Message-ID: E1QmW81-0003Uc-6x () sfp-svn-2 ! v30 ! ch3 ! sourceforge ! com
[Download RAW message or body]
Revision: 10503
http://bochs.svn.sourceforge.net/bochs/?rev=10503&view=rev
Author: sshwarts
Date: 2011-07-28 19:20:16 +0000 (Thu, 28 Jul 2011)
Log Message:
-----------
conditional compile for generic cpuid
Modified Paths:
--------------
trunk/bochs/cpu/generic_cpuid.cc
trunk/bochs/cpu/generic_cpuid.h
Modified: trunk/bochs/cpu/generic_cpuid.cc
===================================================================
--- trunk/bochs/cpu/generic_cpuid.cc 2011-07-28 16:38:22 UTC (rev 10502)
+++ trunk/bochs/cpu/generic_cpuid.cc 2011-07-28 19:20:16 UTC (rev 10503)
@@ -200,6 +200,8 @@
leaf->edx = get_std_cpuid_features();
}
+#if BX_CPU_LEVEL >= 6
+
// leaf 0x00000002 //
void bx_generic_cpuid_t::get_std_cpuid_leaf_2(cpuid_function_t *leaf)
{
@@ -570,6 +572,8 @@
#endif
}
+#if BX_SUPPORT_X86_64
+
// leaf 0x80000005 //
void bx_generic_cpuid_t::get_ext_cpuid_leaf_5(cpuid_function_t *leaf)
{
@@ -610,6 +614,10 @@
leaf->edx = 0;
}
+#endif
+
+#endif
+
void bx_generic_cpuid_t::init_isa_extensions_bitmask(void)
{
Bit32u features_bitmask = 0;
@@ -968,32 +976,6 @@
return features;
}
-#if BX_CPU_LEVEL >= 6
-Bit32u bx_generic_cpuid_t::get_ext3_cpuid_features(void)
-{
- Bit32u features = 0;
-
- // [0:0] FS/GS BASE access instructions
- // [2:1] reserved
- // [3:3] BMI1: Advanced Bit Manipulation Extensions
- // [4:4] reserved
- // [5:5] AVX2
- // [6:6] reserved
- // [7:7] SMEP: Supervisor Mode Execution Protection
- // [8:8] BMI2: Advanced Bit Manipulation Extensions
- // [9:9] Support for Enhanced REP MOVSB/STOSB
- // [10:10] Support for INVPCID instruction
- // [31:10] reserved
- if (BX_CPUID_SUPPORT_ISA_EXTENSION(BX_CPU_FSGSBASE))
- features |= BX_CPUID_EXT3_FSGSBASE;
-
- if (BX_CPUID_SUPPORT_CPU_EXTENSION(BX_CPU_SMEP))
- features |= BX_CPUID_EXT3_SMEP;
-
- return features;
-}
-#endif
-
/* Get CPU feature flags. Returned by CPUID functions 1 and 80000001. */
Bit32u bx_generic_cpuid_t::get_std_cpuid_features(void)
{
@@ -1113,6 +1095,8 @@
return features;
}
+#if BX_CPU_LEVEL >= 6
+
/* Get CPU feature flags. Returned by CPUID function 80000001 in EDX register */
Bit32u bx_generic_cpuid_t::get_std2_cpuid_features(void)
{
@@ -1197,6 +1181,32 @@
return features;
}
+Bit32u bx_generic_cpuid_t::get_ext3_cpuid_features(void)
+{
+ Bit32u features = 0;
+
+ // [0:0] FS/GS BASE access instructions
+ // [2:1] reserved
+ // [3:3] BMI1: Advanced Bit Manipulation Extensions
+ // [4:4] reserved
+ // [5:5] AVX2
+ // [6:6] reserved
+ // [7:7] SMEP: Supervisor Mode Execution Protection
+ // [8:8] BMI2: Advanced Bit Manipulation Extensions
+ // [9:9] Support for Enhanced REP MOVSB/STOSB
+ // [10:10] Support for INVPCID instruction
+ // [31:10] reserved
+ if (BX_CPUID_SUPPORT_ISA_EXTENSION(BX_CPU_FSGSBASE))
+ features |= BX_CPUID_EXT3_FSGSBASE;
+
+ if (BX_CPUID_SUPPORT_CPU_EXTENSION(BX_CPU_SMEP))
+ features |= BX_CPUID_EXT3_SMEP;
+
+ return features;
+}
+
+#endif
+
void bx_generic_cpuid_t::dump_cpuid(void)
{
struct cpuid_function_t leaf;
Modified: trunk/bochs/cpu/generic_cpuid.h
===================================================================
--- trunk/bochs/cpu/generic_cpuid.h 2011-07-28 16:38:22 UTC (rev 10502)
+++ trunk/bochs/cpu/generic_cpuid.h 2011-07-28 19:20:16 UTC (rev 10503)
@@ -56,6 +56,7 @@
void get_std_cpuid_leaf_0(cpuid_function_t *leaf);
void get_std_cpuid_leaf_1(cpuid_function_t *leaf);
+#if BX_CPU_LEVEL >= 6
void get_std_cpuid_leaf_2(cpuid_function_t *leaf);
void get_std_cpuid_leaf_3(cpuid_function_t *leaf);
void get_std_cpuid_leaf_4(Bit32u subfunction, cpuid_function_t *leaf);
@@ -72,17 +73,21 @@
void get_ext_cpuid_leaf_0(cpuid_function_t *leaf);
void get_ext_cpuid_leaf_1(cpuid_function_t *leaf);
void get_ext_cpuid_brand_string_leaf(Bit32u function, cpuid_function_t *leaf);
+#if BX_SUPPORT_X86_64
void get_ext_cpuid_leaf_5(cpuid_function_t *leaf);
void get_ext_cpuid_leaf_6(cpuid_function_t *leaf);
void get_ext_cpuid_leaf_7(cpuid_function_t *leaf);
void get_ext_cpuid_leaf_8(cpuid_function_t *leaf);
+#endif
- Bit32u get_cpu_version_information(void);
- Bit32u get_extended_cpuid_features(void);
- Bit32u get_std_cpuid_features(void);
Bit32u get_std2_cpuid_features(void);
Bit32u get_ext2_cpuid_features(void);
Bit32u get_ext3_cpuid_features(void);
+#endif
+
+ Bit32u get_extended_cpuid_features(void);
+ Bit32u get_cpu_version_information(void);
+ Bit32u get_std_cpuid_features(void);
};
extern bx_cpuid_t *create_bx_generic_cpuid(BX_CPU_C *cpu);
This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.
------------------------------------------------------------------------------
Got Input? Slashdot Needs You.
Take our quick survey online. Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Bochs-cvs mailing list
Bochs-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bochs-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic