Subject: Re: port-i386/2053: incorrect comment in sys_machdep.c
To: None <mycroft@domino.org>
From: John Kohl <jtk@kolvir.arlington.ma.us>
List: netbsd-bugs
Date: 02/10/1996 14:14:37
>>>>> "CH" == "Charles M Hannum" <mycroft@domino.org> writes:

CH> Huh?  That comment describes exactly what the code does.  I don't
CH> understand what you think is wrong with it.

Upon further reading, I now see what the code is doing but it's not what
I initially thought it was doing; I think the comments there are too
terse.

Something along the lines of this would explain it better:

*** /sys/arch/i386/i386/sys_machdep.c	Tue Jan  9 07:23:04 1996
--- /tmp/sys_machdep.c	Sat Feb 10 14:12:35 1996
***************
*** 300,305 ****
--- 300,316 ----
  			break;
  		}
  
+ 		/*
+ 		 * Users may install segment descriptors at a DPL != SEL_UPL
+ 		 * if they're also marked not present.  Attempts to use such
+ 		 * segment descriptors will yield a SIGBUS.
+ 		 * Also, we don't allow users to replace the segment referenced
+ 		 * by their current %fs or %gs with a non-present descriptor.
+ 		 *
+ 		 * If the user wants to install a segment descriptor marked
+ 		 * present, it must have DPL == SEL_UPL.
+ 		 * 
+ 		 */
  		if (desc.sd.sd_p != 0) {
  			/* Only user (ring-3) descriptors may be present. */
  			if (desc.sd.sd_dpl != SEL_UPL)