Linux MIPS Architecture development
 help / color / mirror / Atom feed
* SIGIO Handler
@ 2000-05-18 14:11 Guido Guenther
  2000-05-19 12:37 ` Ralf Baechle
  2000-05-22  2:32 ` Hiroyuki Machida
  0 siblings, 2 replies; 10+ messages in thread
From: Guido Guenther @ 2000-05-18 14:11 UTC (permalink / raw)
  To: linux-mips, linux

[-- Attachment #1: Type: text/plain, Size: 584 bytes --]

I'm still trying to get the mouse to work under X. The problem seems not
to be related to X itself but to a kernel/glibc problem. X uses a SIGIO
handler to "get notified" about mouse events. I wrote my own small SIGIO
handler(see attached program) which works fine on my intel box but not
on an indy (glibc-2.0.6-3lm/linux-2.2.13-20000211). Could please someone
else run the attached program on mips/mipsel and check if it works or
give me a hint where to start to look for the problem.
Regards,
 -- Guido

-- 
GPG-Public Key: http://honk.physik.uni-konstanz.de/~agx/guenther.gpg.asc

[-- Attachment #2: sigio.c --]
[-- Type: text/x-csrc, Size: 1105 bytes --]

# include <unistd.h>
# include <signal.h>
# include <fcntl.h>
# include <sys/time.h>
# include <errno.h>
# include <stdio.h>
# include <string.h>

static int fd = 0;
fd_set sig_mask;

static void
sigio_handler (int sig)
{
	int	    i;
	fd_set  ready;
	struct timeval  to;
	int	    r;

	ready = sig_mask;
	to.tv_sec = 0;
	to.tv_usec = 0;
	while(((r = select (fd+1, &ready, 0, 0, &to)) == -1) && (errno == EINTR));
	if (FD_ISSET (fd, &ready))
    		printf("SIGIO Handler for fd %d\n", fd);
}

main()
{
	struct sigaction sa;
	struct sigaction osa;

	printf("Installing SIGIO handler for fd: %d\n", fd);
	printf("Hitting return should call the SIGIO Handler\n");
	sigemptyset(&sa.sa_mask);
	sigaddset(&sa.sa_mask, SIGIO);
	sa.sa_flags   = 0;
	sa.sa_handler = sigio_handler;
	sigaction(SIGIO, &sa, &osa);

	FD_SET (fd, &sig_mask);
	if (fcntl(fd, F_SETOWN, getpid()) == -1) {
		printf("fcntl(%d, F_SETOWN): %s\n", fd, strerror(errno));
		return 1;
	}
	if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_ASYNC) == -1) {
		printf("fcntl(%d, O_ASYNC): %s\n", fd, strerror(errno));
		return 1;
	}
	while(1);
	return 0;
}

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: SIGIO Handler
  2000-05-18 14:11 SIGIO Handler Guido Guenther
@ 2000-05-19 12:37 ` Ralf Baechle
  2000-05-22  2:32 ` Hiroyuki Machida
  1 sibling, 0 replies; 10+ messages in thread
From: Ralf Baechle @ 2000-05-19 12:37 UTC (permalink / raw)
  To: Guido Guenther, linux-mips, linux

On Thu, May 18, 2000 at 04:11:36PM +0200, Guido Guenther wrote:

> I'm still trying to get the mouse to work under X. The problem seems not
> to be related to X itself but to a kernel/glibc problem. X uses a SIGIO
> handler to "get notified" about mouse events. I wrote my own small SIGIO
> handler(see attached program) which works fine on my intel box but not
> on an indy (glibc-2.0.6-3lm/linux-2.2.13-20000211). Could please someone
> else run the attached program on mips/mipsel and check if it works or
> give me a hint where to start to look for the problem.

Sigh...  Looking at this the first thing I noticed was that the ancient
strace that probably most of us are using prints wrong signal names and
in general seems to have problems.  Maybe I even just found the source of
a good fraction of the GDB problems.  Affects both mips and mips64.
Looking at those ptrace problems first ...

  Ralf

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: SIGIO Handler
  2000-05-18 14:11 SIGIO Handler Guido Guenther
  2000-05-19 12:37 ` Ralf Baechle
@ 2000-05-22  2:32 ` Hiroyuki Machida
  2000-05-22 11:31   ` Ralf Baechle
  1 sibling, 1 reply; 10+ messages in thread
From: Hiroyuki Machida @ 2000-05-22  2:32 UTC (permalink / raw)
  To: agx; +Cc: linux-mips, linux


Hi, Guido

From: Guido Guenther <agx@bert.physik.uni-konstanz.de>
Subject: SIGIO Handler
Date: Thu, 18 May 2000 16:11:36 +0200

> I'm still trying to get the mouse to work under X. The problem seems not
> to be related to X itself but to a kernel/glibc problem. X uses a SIGIO
> handler to "get notified" about mouse events. I wrote my own small SIGIO
> handler(see attached program) which works fine on my intel box but not
> on an indy (glibc-2.0.6-3lm/linux-2.2.13-20000211). 

I had experienced same SIGIO problem. It that time, the definitions
of glibc's FASYNC (in fnctbits.h) and kernel's FASYNC (in
asm/fcnt..h) were not same. 

Check those values in your system, first.

---
Hiroyuki Machida

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: SIGIO Handler
  2000-05-22  2:32 ` Hiroyuki Machida
@ 2000-05-22 11:31   ` Ralf Baechle
  2000-05-22 13:30     ` Guido Guenther
  0 siblings, 1 reply; 10+ messages in thread
From: Ralf Baechle @ 2000-05-22 11:31 UTC (permalink / raw)
  To: Hiroyuki Machida; +Cc: agx, linux-mips, linux

On Mon, May 22, 2000 at 11:32:13AM +0900, Hiroyuki Machida wrote:

> > I'm still trying to get the mouse to work under X. The problem seems not
> > to be related to X itself but to a kernel/glibc problem. X uses a SIGIO
> > handler to "get notified" about mouse events. I wrote my own small SIGIO
> > handler(see attached program) which works fine on my intel box but not
> > on an indy (glibc-2.0.6-3lm/linux-2.2.13-20000211). 
> 
> I had experienced same SIGIO problem. It that time, the definitions
> of glibc's FASYNC (in fnctbits.h) and kernel's FASYNC (in
> asm/fcnt..h) were not same. 
> 
> Check those values in your system, first.

I'll prepare a new glibc 2.0 release with the header file fixed.  Glibc 2.2's
<bits/fcntl.h> is ok.

  Ralf

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: SIGIO Handler
  2000-05-22 11:31   ` Ralf Baechle
@ 2000-05-22 13:30     ` Guido Guenther
  2000-05-22 19:57       ` Ralf Baechle
  0 siblings, 1 reply; 10+ messages in thread
From: Guido Guenther @ 2000-05-22 13:30 UTC (permalink / raw)
  To: Hiroyuki Machida, Ralf Baechle; +Cc: linux-mips, linux

As a temporary workaround I changed the definition in asm/fcntl.h and 
recomiled the kernel, this makes the little test program work. Hope it
works for the xserver too...
Thanks a lot,
 -- Guido

On Mon, May 22, 2000 at 01:31:49PM +0200, Ralf Baechle wrote:
> On Mon, May 22, 2000 at 11:32:13AM +0900, Hiroyuki Machida wrote:
> 
> > > I'm still trying to get the mouse to work under X. The problem seems not
> > > to be related to X itself but to a kernel/glibc problem. X uses a SIGIO
> > > handler to "get notified" about mouse events. I wrote my own small SIGIO
> > > handler(see attached program) which works fine on my intel box but not
> > > on an indy (glibc-2.0.6-3lm/linux-2.2.13-20000211). 
> > 
> > I had experienced same SIGIO problem. It that time, the definitions
> > of glibc's FASYNC (in fnctbits.h) and kernel's FASYNC (in
> > asm/fcnt..h) were not same. 
> > 
> > Check those values in your system, first.
> 
> I'll prepare a new glibc 2.0 release with the header file fixed.  Glibc 2.2's
> <bits/fcntl.h> is ok.
> 
>   Ralf

-- 
GPG-Public Key: http://honk.physik.uni-konstanz.de/~agx/guenther.gpg.asc

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: SIGIO Handler
  2000-05-22 13:30     ` Guido Guenther
@ 2000-05-22 19:57       ` Ralf Baechle
  2000-05-22 20:07         ` Guido Guenther
  2000-05-23  2:11         ` Ralf Baechle
  0 siblings, 2 replies; 10+ messages in thread
From: Ralf Baechle @ 2000-05-22 19:57 UTC (permalink / raw)
  To: Guido Guenther, Hiroyuki Machida, Ralf Baechle, linux-mips, linux

On Mon, May 22, 2000 at 03:30:05PM +0200, Guido Guenther wrote:

> As a temporary workaround I changed the definition in asm/fcntl.h and 
> recomiled the kernel, this makes the little test program work. Hope it
> works for the xserver too...

Ok, but you changed the wrong side, libc's definition is what is broken.

  Ralf

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: SIGIO Handler
  2000-05-22 19:57       ` Ralf Baechle
@ 2000-05-22 20:07         ` Guido Guenther
  2000-05-22 20:13           ` Ralf Baechle
  2000-05-23  2:11         ` Ralf Baechle
  1 sibling, 1 reply; 10+ messages in thread
From: Guido Guenther @ 2000-05-22 20:07 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Hiroyuki Machida, linux-mips, linux

On Mon, May 22, 2000 at 09:57:05PM +0200, Ralf Baechle wrote:
> On Mon, May 22, 2000 at 03:30:05PM +0200, Guido Guenther wrote:
> 
> > As a temporary workaround I changed the definition in asm/fcntl.h and 
> > recomiled the kernel, this makes the little test program work. Hope it
> > works for the xserver too...
> 
> Ok, but you changed the wrong side, libc's definition is what is broken.
I know, but kernel recompiling is much quicker and easier for me to do -
therefore I stated it as "workaround" above (until you release a new glibc ;)
Xserver works now btw, but is incredible slow(will try to play with dma
transfers to speed things up). 
 -- Guido

-- 
GPG-Public Key: http://honk.physik.uni-konstanz.de/~agx/guenther.gpg.asc

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: SIGIO Handler
  2000-05-22 20:07         ` Guido Guenther
@ 2000-05-22 20:13           ` Ralf Baechle
  2000-05-24  9:57             ` Guido Guenther
  0 siblings, 1 reply; 10+ messages in thread
From: Ralf Baechle @ 2000-05-22 20:13 UTC (permalink / raw)
  To: Guido Guenther, Hiroyuki Machida, linux-mips, linux

On Mon, May 22, 2000 at 10:07:55PM +0200, Guido Guenther wrote:

> > Ok, but you changed the wrong side, libc's definition is what is broken.
>
> I know, but kernel recompiling is much quicker and easier for me to do -
> therefore I stated it as "workaround" above (until you release a new glibc ;)

Is uploading as I write this.

> Xserver works now btw, but is incredible slow(will try to play with dma
> transfers to speed things up). 

Excellent.  Even if it's slow as molasses, how about making a first release?

  Ralf

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: SIGIO Handler
  2000-05-22 19:57       ` Ralf Baechle
  2000-05-22 20:07         ` Guido Guenther
@ 2000-05-23  2:11         ` Ralf Baechle
  1 sibling, 0 replies; 10+ messages in thread
From: Ralf Baechle @ 2000-05-23  2:11 UTC (permalink / raw)
  To: Guido Guenther, Hiroyuki Machida, linux-mips, linux

On Mon, May 22, 2000 at 09:57:05PM +0200, Ralf Baechle wrote:

> > As a temporary workaround I changed the definition in asm/fcntl.h and 
> > recomiled the kernel, this makes the little test program work. Hope it
> > works for the xserver too...
> 
> Ok, but you changed the wrong side, libc's definition is what is broken.

Ok, glibc 2.0.6-5lm can be downloaded from oss.sgi.com, directory
/pub/linux/mips/test-glibc.

  Ralf

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: SIGIO Handler
  2000-05-22 20:13           ` Ralf Baechle
@ 2000-05-24  9:57             ` Guido Guenther
  0 siblings, 0 replies; 10+ messages in thread
From: Guido Guenther @ 2000-05-24  9:57 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Guido Guenther, Hiroyuki Machida, linux-mips, linux

On Mon, May 22, 2000 at 10:13:41PM +0200, Ralf Baechle wrote:
> On Mon, May 22, 2000 at 10:07:55PM +0200, Guido Guenther wrote:
> 
> > > Ok, but you changed the wrong side, libc's definition is what is broken.
> >
> > I know, but kernel recompiling is much quicker and easier for me to do -
> > therefore I stated it as "workaround" above (until you release a new glibc ;)
> 
> Is uploading as I write this.
> 
> > Xserver works now btw, but is incredible slow(will try to play with dma
> > transfers to speed things up). 
> 
> Excellent.  Even if it's slow as molasses, how about making a first release?
I've stitched together some binaries which are completely untested due
to time constraints. They can be found at:
 http://honk.physik.uni-konstanz.de/~agx/mipslinux/x/binaries

Note that the driver code is really messy, has still a problem with the colormap 
in PseudoColor visual and has never been tested on the 24bit newport since
I don't have such a card(exactly speaking I don't even have an Indy but
that's another story ;). I hope I'll find the time to clean up and test
a bit of the code near the weekend.
Regards,
 -- Guido

-- 
GPG-Public Key: http://honk.physik.uni-konstanz.de/~agx/guenther.gpg.asc

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2000-05-24 10:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-05-18 14:11 SIGIO Handler Guido Guenther
2000-05-19 12:37 ` Ralf Baechle
2000-05-22  2:32 ` Hiroyuki Machida
2000-05-22 11:31   ` Ralf Baechle
2000-05-22 13:30     ` Guido Guenther
2000-05-22 19:57       ` Ralf Baechle
2000-05-22 20:07         ` Guido Guenther
2000-05-22 20:13           ` Ralf Baechle
2000-05-24  9:57             ` Guido Guenther
2000-05-23  2:11         ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox