From owner-cvs-all@FreeBSD.ORG Sun Nov 14 22:45:57 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E1EDC16A4CE; Sun, 14 Nov 2004 22:45:57 +0000 (GMT) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6223443D3F; Sun, 14 Nov 2004 22:45:57 +0000 (GMT) (envelope-from marcel@xcllnt.net) Received: from [192.168.4.250] (dhcp50.pn.xcllnt.net [192.168.4.250]) by ns1.xcllnt.net (8.13.1/8.13.1) with ESMTP id iAEMjuvr076750; Sun, 14 Nov 2004 14:45:56 -0800 (PST) (envelope-from marcel@xcllnt.net) In-Reply-To: <57113.1100468445@critter.freebsd.dk> References: <57113.1100468445@critter.freebsd.dk> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Marcel Moolenaar Date: Sun, 14 Nov 2004 14:45:56 -0800 To: "Poul-Henning Kamp" X-Mailer: Apple Mail (2.619) cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/uart uart_subr.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Nov 2004 22:45:58 -0000 On Nov 14, 2004, at 1:40 PM, Poul-Henning Kamp wrote: >> Make sure the baudrate specified with the BR tag is somewhat sane. >> A baudrate we consider insane is silently replaced with 0. When the >> baudrate is 0, we will not try to program the hardware. Instead we >> leave the communication speed unaltered, maximizing the chance to >> have a working console. Obviously this means we allow specifying a >> 0 baudrate for exactly that purpose. > > Setting a zero speed used to have magic meaning, sometimes sending > a break, on other systems it would hang up the line. Overloading > with yet a meaning may not be a good idea. (I'm not sure what > the standards demand btw). Yes, a 0 baudrate does have special meaning in the higher layers and process inferfaces. And currently when you specify a 0 baudrate for the serial console, it interferes at the TTY layer to the extend that tcsetattr(3) and getty(8) stop functioning. You can and could already specify a baudrate of -1 and it will and would just work. However for various reasons it's better and more convenient to use 0 and make sure this value doesn't propagate up to the TTY layer. This I'm testing currently. It makes the whole thing much more robust in the end. The various reasons include: o 0 is a more user-friendly value than -1 (i.e. more intuitive). o Any uninitialized variable is implicitly 0, not -1. o 0 works for signed and unsigned types. o There's no confusion possible between the different meanings of 0, because there's no domain overlap. So, I don't see a problem. Especially because the sysadmin can use -1 for the loader variables to achieve exactly the same. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net