From rafan@svm.csie.ntu.edu.tw  Tue Oct  5 02:12:56 2004
Return-Path: <rafan@svm.csie.ntu.edu.tw>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 288B816A4CF
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  5 Oct 2004 02:12:56 +0000 (GMT)
Received: from svm.csie.ntu.edu.tw (svm.csie.ntu.edu.tw [140.112.30.145])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 8CA4443D45
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  5 Oct 2004 02:12:55 +0000 (GMT)
	(envelope-from rafan@svm.csie.ntu.edu.tw)
Received: from svm.csie.ntu.edu.tw (fakerafan@localhost.csie.ntu.edu.tw [127.0.0.1])
	by svm.csie.ntu.edu.tw (8.13.1/8.13.1) with ESMTP id i952Csud028952
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 5 Oct 2004 10:12:54 +0800 (CST)
	(envelope-from rafan@svm.csie.ntu.edu.tw)
Received: (from rafan@localhost)
	by svm.csie.ntu.edu.tw (8.13.1/8.13.1/Submit) id i952Csop028951;
	Tue, 5 Oct 2004 10:12:54 +0800 (CST)
	(envelope-from rafan)
Message-Id: <200410050212.i952Csop028951@svm.csie.ntu.edu.tw>
Date: Tue, 5 Oct 2004 10:12:54 +0800 (CST)
From: Rong-En Fan <rafan@infor.org>
Reply-To:
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] add Pentium M, P3 M, P4 M support to bsd.cpu.mk 
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         72340
>Category:       i386
>Synopsis:       [bsd.cpu.mk] [patch] add Pentium M, P3 M, P4 M support to bsd.cpu.mk
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    des
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 05 02:20:24 GMT 2004
>Closed-Date:    Mon May 15 08:33:08 GMT 2006
>Last-Modified:  Mon May 15 08:33:08 GMT 2006
>Originator:     Rong-En Fan
>Release:        FreeBSD 5.3-BETA5 i386
>Organization:
NTU CSIE
>Environment:
System: FreeBSD svm.csie.ntu.edu.tw 5.3-BETA5 FreeBSD 5.3-BETA5 #13: Mon Sep 20 02:31:32 CST 2004 root@svm.csie.ntu.edu.tw:/usr/obj/usr/src/sys/SVM i386


	
>Description:
	newer GCC (not sure, but 3.4.2 has thoese) supports Pentium M,
	Pentium 3/4 M optimization. but, bsd.cpu.mk doesn't utilize
	these.
	
>How-To-Repeat:
	
>Fix:

	I have tested on my IBM X31 which has Pentium M.
	Hope others who have Pentinum 3/4 M or using ICC as
	default compiler can help to test this patch.

--- /usr/share/mk/bsd.cpu.mk	Sun Sep 26 02:36:03 2004
+++ bsd.cpu.mk	Mon Oct  4 02:47:42 2004
@@ -30,8 +30,14 @@
 . if ${MACHINE_ARCH} == "i386"
 .  if ${CPUTYPE} == "pentium4"
 CPUTYPE = p4
+.  elif ${CPUTYPE} == "pentium4m"
+CPUTYPE = p4m
 .  elif ${CPUTYPE} == "pentium3"
 CPUTYPE = p3
+.  elif ${CPUTYPE} == "pentium3m"
+CPUTYPE = p3m
+.  elif ${CPUTYPE} == "pentium-m"
+CPUTYPE = p-m
 .  elif ${CPUTYPE} == "pentiumpro"
 CPUTYPE = i686
 .  elif ${CPUTYPE} == "pentium"
@@ -74,9 +80,15 @@
 .  elif ${CPUTYPE} == "p4"
 _CPUCFLAGS = -march=pentium4
 _ICC_CPUCFLAGS = -tpp7 -xiMKW
+.  elif ${CPUTYPE} == "p4m"
+_CPUCFLAGS = -march=pentium4m
 .  elif ${CPUTYPE} == "p3"
 _CPUCFLAGS = -march=pentium3
 _ICC_CPUCFLAGS = -tpp6 -xiMK
+.  elif ${CPUTYPE} == "p3m"
+_CPUCFLAGS = -march=pentium3m
+.  elif ${CPUTYPE} == "p-m"
+_CPUCFLAGS = -march=pentium-m
 .  elif ${CPUTYPE} == "p2"
 _CPUCFLAGS = -march=pentium2
 _ICC_CPUCFLAGS = -tpp6 -xiM
@@ -127,9 +139,9 @@
 MACHINE_CPU = mmx k6 k5 i586 i486 i386
 .  elif ${CPUTYPE} == "k5"
 MACHINE_CPU = k5 i586 i486 i386
-.  elif ${CPUTYPE} == "p4"
+.  elif ${CPUTYPE} == "p4" || ${CPUTYPE} == "p4m" || ${CPUTYPE} == "p-m"
 MACHINE_CPU = sse2 sse i686 mmx i586 i486 i386
-.  elif ${CPUTYPE} == "p3"
+.  elif ${CPUTYPE} == "p3" || ${CPUTYPE} == "p3m"
 MACHINE_CPU = sse i686 mmx i586 i486 i386
 .  elif ${CPUTYPE} == "p2"
 MACHINE_CPU = i686 mmx i586 i486 i386
	


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-i386->des 
Responsible-Changed-By: des 
Responsible-Changed-When: Thu Oct 7 09:54:43 GMT 2004 
Responsible-Changed-Why:  
Me fix. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=72340 
State-Changed-From-To: open->patched 
State-Changed-By: des 
State-Changed-When: Thu Oct 7 10:25:26 GMT 2004 
State-Changed-Why:  
Committed to -CURRENT, awaiting MFC. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=72340 

From: Rong-En Fan <rafan@infor.org>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc: des@FreeBSD.org, llwang@infor.org
Subject: Re: i386/72340: [PATCH] add Pentium M, P3 M, P4 M support to bsd.cpu.mk
Date: Sun, 17 Oct 2004 20:46:28 +0800

 I have used CPUTYPE=p-m to compile -current yesterday
 however, after reboot, the kernel compilains that
 something like "FPU is not present", then it enters
 DDB. To verify this was caused by CPUTYPE=p-m, I compiled
 my kernel without CPUTYPE, then it works.
 
 Leland Wang (llwang@infor.org) has compiled his 5-STABLE
 few hours ago with CPUTYPE=p3,p4,p-m and it fails to boot
 the kernel with p-m (hang right after boot2, entering kernel...).
 According to his exp, CPUTYPE=p3,p4 are both ok.
 
 Not sure if this is GCC's optimization bug or ours?
 Is there any way to debug this? I'm willing to give help on this.
 
 -rafan

From: Rong-En Fan <rafan@infor.org>
To: FreeBSD-gnats-submit@FreeBSD.org, des@FreeBSD.org
Cc:  
Subject: Re: i386/72340: [PATCH] add Pentium M, P3 M, P4 M support to bsd.cpu.mk
Date: Tue, 2 May 2006 09:37:33 +0800

 Hi,
 
 This already appears in 5.4-STABLE and 6.x. I think we can close this one?
 
 Thanks,
 Rong-En Fan
State-Changed-From-To: patched->closed 
State-Changed-By: des 
State-Changed-When: Mon May 15 08:33:06 UTC 2006 
State-Changed-Why:  
fixed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=72340 
>Unformatted:
