Subject: port-i386/1445: linux_machdep.c has broken #else/#endif; should be #endif/(nothing)
To: None <gnats-bugs@gnats.netbsd.org>
From: John Kohl <jtk@kolvir.arlington.ma.us>
List: netbsd-bugs
Date: 09/07/1995 18:55:30
>Number:         1445
>Category:       port-i386
>Synopsis:       linux_machdep.c has broken #else/#endif; should be #endif/(nothing)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Sep  7 19:20:01 1995
>Last-Modified:
>Originator:     John Kohl
>Organization:
NetBSD Kernel Hackers `R` Us
>Release:        NetBSD-current as of 1995/09/05
>Environment:
	
System: NetBSD pattern 1.0A NetBSD 1.0A (PATTERN) #104: Tue Sep 5 22:24:10 EDT 1995 jtk@pattern:/u1/NetBSD-current/src/sys/arch/i386/compile/PATTERN i386


>Description:
linux_machdep.c has erroneous #ifdef/#else/#endif for VM86.

Thanks to Bill Sommerfeld for noticing this.

>How-To-Repeat:
read the code
>Fix:
===================================================================
RCS file: RCS/linux_machdep.c,v
retrieving revision 1.1.1.10
diff -c -r1.1.1.10 linux_machdep.c
*** linux_machdep.c	1995/09/05 02:27:03	1.1.1.10
--- linux_machdep.c	1995/09/06 01:40:50
***************
*** 134,147 ****
  		frame.sf_sc.sc_es = tf->tf_vm86_es;
  		frame.sf_sc.sc_ds = tf->tf_vm86_ds;
  	} else
! #else
  	{
  		__asm("movl %%gs,%w0" : "=r" (frame.sf_sc.sc_gs));
  		__asm("movl %%fs,%w0" : "=r" (frame.sf_sc.sc_fs));
  		frame.sf_sc.sc_es = tf->tf_es;
  		frame.sf_sc.sc_ds = tf->tf_ds;
  	}
- #endif
  	frame.sf_sc.sc_edi    = tf->tf_edi;
  	frame.sf_sc.sc_esi    = tf->tf_esi;
  	frame.sf_sc.sc_ebp    = tf->tf_ebp;
--- 134,146 ----
  		frame.sf_sc.sc_es = tf->tf_vm86_es;
  		frame.sf_sc.sc_ds = tf->tf_vm86_ds;
  	} else
! #endif
  	{
  		__asm("movl %%gs,%w0" : "=r" (frame.sf_sc.sc_gs));
  		__asm("movl %%fs,%w0" : "=r" (frame.sf_sc.sc_fs));
  		frame.sf_sc.sc_es = tf->tf_es;
  		frame.sf_sc.sc_ds = tf->tf_ds;
  	}
  	frame.sf_sc.sc_edi    = tf->tf_edi;
  	frame.sf_sc.sc_esi    = tf->tf_esi;
  	frame.sf_sc.sc_ebp    = tf->tf_ebp;

>Audit-Trail:
>Unformatted: