diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2007-07-05 18:02:18 +0200 |
---|---|---|
committer | Sascha Hauer <sha@octopus.labnet.pengutronix.de> | 2007-07-05 18:02:18 +0200 |
commit | dccda9879bab1faaf22816a47c0b669d47cdadb2 (patch) | |
tree | c84b94d84d98983e282e01fe2da3faf708db7b4e /arch/linux/lib/common.c | |
parent | 1026d50c0b0c34a5a91c6e3e916614058054bafa (diff) | |
download | barebox-dccda9879bab1faaf22816a47c0b669d47cdadb2.tar.gz barebox-dccda9879bab1faaf22816a47c0b669d47cdadb2.tar.xz |
svn_rev_703
Diffstat (limited to 'arch/linux/lib/common.c')
-rw-r--r-- | arch/linux/lib/common.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/arch/linux/lib/common.c b/arch/linux/lib/common.c index c6aa91f385..99cbc98fc1 100644 --- a/arch/linux/lib/common.c +++ b/arch/linux/lib/common.c @@ -60,6 +60,13 @@ int linux_tstc(int fd) FD_ZERO(&rfds); FD_SET(fd, &rfds); + /* + * We set the timeout here to 100us, because otherwise + * U-Boot would eat all cpu resources while waiting + * for input. On the other hand this makes some + * things like networking slow, because U-Boot will + * poll this function very often. + */ tv.tv_sec = 0; tv.tv_usec = 100; @@ -127,14 +134,8 @@ int linux_read_nonblock(int fd, void *buf, size_t count) if (fcntl(fd, F_SETFL, oldflags) == -1) goto err_out; - if (ret == -1) { -// printf("errno\n"); - usleep(1000); - } - -// if (ret == -1 && errno == EAGAIN) { -// printf("delay\n"); -// } + if (ret == -1) + usleep(100); return ret; @@ -245,7 +246,7 @@ int main(int argc, char *argv[]) { void *ram; int opt, ret, fd; - int malloc_size = 1024 * 1024; + int malloc_size = 8 * 1024 * 1024; ram = malloc(malloc_size); if (!ram) { |