From owner-freebsd-embedded@FreeBSD.ORG Mon Oct 7 20:35:17 2013 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D4AA1A53; Mon, 7 Oct 2013 20:35:17 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qe0-x229.google.com (mail-qe0-x229.google.com [IPv6:2607:f8b0:400d:c02::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4D9A72125; Mon, 7 Oct 2013 20:35:17 +0000 (UTC) Received: by mail-qe0-f41.google.com with SMTP id 1so5886348qee.28 for ; Mon, 07 Oct 2013 13:35:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=C0bVkeqCeSIkBzP0hQRakNb4vw/Kr+rxE1as5CfGiOc=; b=r56pKS6hicCewTo1XG904txIP9Pt1WNzvJlFRnFliYTSWEOZ0lpEfHzTD7fL20uld9 qqmwkeoK+t7a5yKtqybYEXAXhRPPjJT1cJ+pqniMRh9OHzdCz8HnzyZpUwA9x2IRvk4B vKwsxi9GaQIer1ib88HQFdS7Lm0mH2C+Od7fqQTXaiTxH2D6na7YU0gKOwPMxPUmayOE B0YkrgUMf8P/TkbLSGgkWfaUFxnnzHIMp63028LNRkbs/7yc36CASrbchz1fyF9uyf4j FDSGUyVrTe4/azmGoHP+QdcgnUlgADWv9mbOlNkF6HJTqUjT+/USJwk+UlVe1QonkYp5 1dBw== MIME-Version: 1.0 X-Received: by 10.224.114.201 with SMTP id f9mr40013910qaq.4.1381178116392; Mon, 07 Oct 2013 13:35:16 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Mon, 7 Oct 2013 13:35:16 -0700 (PDT) In-Reply-To: <1381177583.1130.17.camel@revolution.hippie.lan> References: <1381177583.1130.17.camel@revolution.hippie.lan> Date: Mon, 7 Oct 2013 13:35:16 -0700 X-Google-Sender-Auth: KqZl9pJp_NdYLenJ5mi2a7PL3GM Message-ID: Subject: Re: Changes to UART ns8250 From: Adrian Chadd To: Ian Lepore Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 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:35:18 -0000 I'd love to see a linux style way of saying "I'd like to sleep from roughly this time interval to this time interval; feel free to do what you need." Then yes, it could be implemented as a sleep wakeup from a timer, or as a call to a hypervisor to do the same, or .. or... -adrian On 7 October 2013 13:26, Ian Lepore wrote: > 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 > > >