patch-2.4.26 linux-2.4.26/arch/x86_64/boot/setup.S
Next file: linux-2.4.26/arch/x86_64/config.in
Previous file: linux-2.4.26/arch/x86_64/Makefile
Back to the patch index
Back to the overall index
- Lines: 48
- Date:
2004-04-14 06:05:28.000000000 -0700
- Orig file:
linux-2.4.25/arch/x86_64/boot/setup.S
- Orig date:
2003-11-28 10:26:19.000000000 -0800
diff -urN linux-2.4.25/arch/x86_64/boot/setup.S linux-2.4.26/arch/x86_64/boot/setup.S
@@ -289,8 +289,9 @@
/* minimum CPUID flags for x86-64 */
/* see http://www.x86-64.org/lists/discuss/msg02971.html */
#define SSE_MASK ((1<<25)|(1<<26))
-#define REQUIRED_MASK1 ((1<<0)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<8)|(1<<11)| \
- (1<<13)|(1<<15)|(1<<24)|(1<<29))
+#define REQUIRED_MASK1 ((1<<0)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<8)|\
+ (1<<13)|(1<<15)|(1<<24))
+#define REQUIRED_MASK2 (1<<29)
pushfl /* standard way to check for cpuid */
popl %eax
@@ -302,10 +303,10 @@
popl %eax
cmpl %eax,%ebx
jz no_longmode /* cpu has no cpuid */
- movl $0x80000000,%eax
+ movl $0x0,%eax
cpuid
- cmpl $0x80000001,%eax
- jb no_longmode /* no extended cpuid */
+ cmpl $0x1,%eax
+ jb no_longmode /* no cpuid 1 */
xor %di,%di
cmpl $0x68747541,%ebx /* AuthenticAMD */
jnz noamd
@@ -315,11 +316,20 @@
jnz noamd
mov $1,%di /* cpu is from AMD */
noamd:
- movl $0x80000001,%eax
+ movl $0x1,%eax
cpuid
andl $REQUIRED_MASK1,%edx
xorl $REQUIRED_MASK1,%edx
jnz no_longmode
+ movl $0x80000000,%eax
+ cpuid
+ cmpl $0x80000001,%eax
+ jb no_longmode /* no extended cpuid */
+ movl $0x80000001,%eax
+ cpuid
+ andl $REQUIRED_MASK2,%edx
+ xorl $REQUIRED_MASK2,%edx
+ jnz no_longmode
sse_test:
movl $1,%eax
cpuid
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)