From: "Jan Beulich" Subject: [PATCH] x86: fix early option scanning Date: Tue, 19 Jun 2007 11:38:51 +0200 Message-ID: <4677C04B.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Make sure command lines like ... vgaxyz vga=3D ... console=3Dvga vga=3D mistakenly ignore the vga=3D option due to finding 'vga' earlier on the = line. Signed-off-by: Jan Beulich Index: 2007-06-18/xen/arch/x86/boot/cmdline.S =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 2007-06-18.orig/xen/arch/x86/boot/cmdline.S 2007-06-15 14:05:46.0000000= 00 +0200 +++ 2007-06-18/xen/arch/x86/boot/cmdline.S 2007-06-18 14:40:13.0000000= 00 +0200 @@ -119,9 +119,11 @@ ret =20 .Lfind_option: + mov 4(%esp),%eax push %ebx - push 4+8(%esp) - push 4+8(%esp) +0: + pushl 4+8(%esp) + push %eax call .Lstrstr add $8,%esp test %eax,%eax @@ -129,20 +131,20 @@ cmp %eax,4+4(%esp) je 1f cmpb $' ',-1(%eax) - jne 2f + je 1f +2: inc %eax + jmp 0b 1: mov %eax,%ebx - push 4+8(%esp) + pushl 4+8(%esp) call .Lstrlen add $4,%esp - xchg %eax,%ebx - add %eax,%ebx + xadd %eax,%ebx cmpb $'\0',(%ebx) je 3f cmpb $' ',(%ebx) je 3f cmpb $'=3D',(%ebx) - je 3f -2: xor %eax,%eax + jne 2b 3: pop %ebx ret =20