From owner-freebsd-ppc@FreeBSD.ORG Sun Feb 18 09:11:15 2007 Return-Path: X-Original-To: freebsd-ppc@freebsd.org Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6070B16A402 for ; Sun, 18 Feb 2007 09:11:15 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fep03.xtra.co.nz (fep03.xtra.co.nz [210.54.141.243]) by mx1.freebsd.org (Postfix) with ESMTP id EC2E813C481 for ; Sun, 18 Feb 2007 09:11:14 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from serv.int.fubar.geek.nz ([125.237.110.135]) by fep03.xtra.co.nz with ESMTP id <20070218091108.LUBP22426.fep03.xtra.co.nz@serv.int.fubar.geek.nz> for ; Sun, 18 Feb 2007 22:11:08 +1300 Date: Sun, 18 Feb 2007 22:11:07 +1300 From: Andrew Turner To: freebsd-ppc@freebsd.org Message-ID: <20070218221107.2a453e4a@hermies.int.fubar.geek.nz> X-Mailer: Claws Mail 2.6.1 (GTK+ 2.10.9; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=MP_Q8n0WYAB9TK4b.xc9kYkbou Subject: Bug in cpu.c X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Feb 2007 09:11:15 -0000 --MP_Q8n0WYAB9TK4b.xc9kYkbou Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline When booting on an unknown cpu the loop in sys/powerpc/powerpc/cpu.c to find the model will run past the end of the list of possible models. The attached patch fixes this. Andrew --MP_Q8n0WYAB9TK4b.xc9kYkbou Content-Type: text/x-patch; name=freebsd-ppc-cpu.diff Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=freebsd-ppc-cpu.diff Index: sys/powerpc/powerpc/cpu.c =================================================================== RCS file: /cvsroot/src/sys/powerpc/powerpc/cpu.c,v retrieving revision 1.7 diff -u -r1.7 cpu.c --- sys/powerpc/powerpc/cpu.c 4 Feb 2005 01:59:48 -0000 1.7 +++ sys/powerpc/powerpc/cpu.c 18 Feb 2007 04:43:54 -0000 @@ -126,7 +126,7 @@ min = (pvr >> 0) & 0xf; } - for (cp = models; cp->name[0] != '\0'; cp++) { + for (cp = models; cp->version != 0; cp++) { if (cp->version == vers) break; } --MP_Q8n0WYAB9TK4b.xc9kYkbou--