9
0
Fork 0

poller_call: move from getc to is_timeout

this will allow to always call poller_call even durring timeout
and still the case in getc

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Jean-Christophe PLAGNIOL-VILLARD 2012-01-03 06:00:47 +01:00 committed by Sascha Hauer
parent b5ba23865b
commit 4c4fae147d
2 changed files with 4 additions and 2 deletions

View File

@ -27,6 +27,7 @@
#include <common.h>
#include <asm-generic/div64.h>
#include <clock.h>
#include <poller.h>
static struct clocksource *current_clock;
static uint64_t time_ns;
@ -139,6 +140,9 @@ uint32_t clocksource_hz2mult(uint32_t hz, uint32_t shift_constant)
int is_timeout(uint64_t start_ns, uint64_t time_offset_ns)
{
if (time_offset_ns >= 100 * USECOND)
poller_call();
if ((int64_t)(start_ns + time_offset_ns - get_time_ns()) < 0)
return 1;
else

View File

@ -225,8 +225,6 @@ int getc(void)
*/
start = get_time_ns();
while (1) {
poller_call();
if (tstc_raw()) {
kfifo_putc(console_input_buffer, getc_raw());