projects
/
microwatt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fb5c16d
)
sim_console: Fix polling to check for POLLIN
author
Benjamin Herrenschmidt
<benh@kernel.crashing.org>
Fri, 19 Jun 2020 10:27:31 +0000
(20:27 +1000)
committer
Benjamin Herrenschmidt
<benh@kernel.crashing.org>
Thu, 25 Jun 2020 22:17:23 +0000
(08:17 +1000)
Under some circumstances we get POLLHUP which we incorrectly
treat as having a character in the buffer.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
sim_console_c.c
patch
|
blob
|
history
diff --git
a/sim_console_c.c
b/sim_console_c.c
index b3920c1e276219ec078431c4f90aecff4a1e1fe6..a2c9d55f6a0dc45ece3bf1e04c56268cfc1891fd 100644
(file)
--- a/
sim_console_c.c
+++ b/
sim_console_c.c
@@
-71,8
+71,11
@@
void sim_console_poll(unsigned char *__rt)
ret = poll(fdset, 1, 0);
//fprintf(stderr, "poll returns %d\n", ret);
- if (ret == 1)
- val = 1;
+ if (ret == 1) {
+ if (fdset[0].revents & POLLIN)
+ val = 1;
+// fprintf(stderr, "poll revents: 0x%x\n", fdset[0].revents);
+ }
to_std_logic_vector(val, __rt, 64);
}