Friday, September 22, 2017

Re: mednafen 0.9.39.2 -> 0.9.46

On 20/09/17(Wed) 09:13, Anthony J. Bentley wrote:
> Martin Pieuchot writes:
> > Do you know if the games are multi-threaded? Could you run "top -H" and
> > "kdump -H"?
>
> top -H shows a single line for gambatte.

Thanks. Could you try the diff below? It includes some debug stuff and
a potential fix.

I'm guessing that the problem is that my last change made uhid_do_ioctl()
return an error for FIOASYNC. This makes the following syscall fall:

390: /* The poll blocks the event thread. */
391: fcntl(fd, F_SETFL, O_NONBLOCK)


As a result FNONBLOCK is not set on the 'struct file' and uhid_do_read()
block, or "freeze", when there's nothing to read instead of returning
EWOULDBLOCK.


Index: uhid.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/uhid.c,v
retrieving revision 1.68
diff -u -p -r1.68 uhid.c
--- uhid.c 20 Jul 2017 16:54:45 -0000 1.68
+++ uhid.c 22 Sep 2017 12:31:56 -0000
@@ -59,10 +59,12 @@

#include <dev/usb/uhidev.h>

+#define UHID_DEBUG
+
#ifdef UHID_DEBUG
#define DPRINTF(x) do { if (uhiddebug) printf x; } while (0)
#define DPRINTFN(n,x) do { if (uhiddebug>(n)) printf x; } while (0)
-int uhiddebug = 0;
+int uhiddebug = 6;
#else
#define DPRINTF(x)
#define DPRINTFN(n,x)
@@ -179,7 +181,7 @@ uhid_intr(struct uhidev *addr, void *dat
struct uhid_softc *sc = (struct uhid_softc *)addr;

#ifdef UHID_DEBUG
- if (uhiddebug > 5) {
+ if (uhiddebug > 6) {
u_int32_t i;

DPRINTF(("uhid_intr: data ="));
@@ -359,6 +361,7 @@ uhid_do_ioctl(struct uhid_softc *sc, u_l

switch (cmd) {
case FIONBIO:
+ case FIOASYNC:
/* All handled in the upper FS layer. */
break;

No comments:

Post a Comment