Date: Mon, 7 Oct 2013 13:35:16 -0700 From: Adrian Chadd <adrian@freebsd.org> To: Ian Lepore <ian@freebsd.org> Cc: Zbigniew Bodek <zbb@freebsd.org>, "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org>, freebsd-current <freebsd-current@freebsd.org>, "freebsd-embedded@freebsd.org" <freebsd-embedded@freebsd.org> Subject: Re: Changes to UART ns8250 Message-ID: <CAJ-VmokRCrx428UKH=QTpB9dB=G1EGwjSUgjbzSnGSR8t8Xs9A@mail.gmail.com> In-Reply-To: <1381177583.1130.17.camel@revolution.hippie.lan> References: <CALF_Tx=AwVnr0d75-K-yu97iVgmTJC7aaABoix73zHD%2B5eKJnQ@mail.gmail.com> <CAJ-VmokZHvLpUvvD9s8ES0PT%2BE1oVfHWhdbiXF77osBOK2_Yqg@mail.gmail.com> <1381177583.1130.17.camel@revolution.hippie.lan>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <ian@freebsd.org> 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 > > >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-VmokRCrx428UKH=QTpB9dB=G1EGwjSUgjbzSnGSR8t8Xs9A>