From owner-freebsd-embedded@FreeBSD.ORG Mon Oct 7 20:26:34 2013 Return-Path: Delivered-To: freebsd-embedded@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4E109362; Mon, 7 Oct 2013 20:26:34 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 21C04207A; Mon, 7 Oct 2013 20:26:33 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1VTHNr-000457-0O; Mon, 07 Oct 2013 20:26:27 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r97KQNcE017584; Mon, 7 Oct 2013 14:26:23 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+SL+29gBFrnv96HWTdirAU Subject: Re: Changes to UART ns8250 From: Ian Lepore To: Adrian Chadd In-Reply-To: References: Content-Type: text/plain; charset="us-ascii" Date: Mon, 07 Oct 2013 14:26:23 -0600 Message-ID: <1381177583.1130.17.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: Zbigniew Bodek , "freebsd-arm@freebsd.org" , freebsd-current , "freebsd-embedded@freebsd.org" X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Oct 2013 20:26:34 -0000 On Mon, 2013-10-07 at 13:15 -0700, Adrian Chadd wrote: > Hi, > > You should add: > > *[snip] > * a DELAY(1) or something. > Why? Why oh why do people write while (!read_some_status_register()) DELAY(n); when DELAY() is implemented as, roughly: while (read_some_counter_register() < something) continue; The whole point of DELAY() is to busy-wait. What might be nice is some function that we can call in such a loop such as cpu_busywait(), so that when running in an emulated or virtualized environment the emulator or hypervisor could use that as a hint to do something smart. -- Ian