On Tue, Sep 19, 2006 at 12:36:38PM -0700, Maksim Yevmenkin wrote: > nope, same crash. the only thing that seems to help is to reverting > back to (int *) cast just like other keyboard drivers do. then it > works. > > i'm in the process of getting amd64 snapshot iso to try it on a couple > of boxes. if it will work then i'm going to back (int *) -> (intptr_t > *) changes introduced in rev 1.8. > Why? amd64 and i386 are unaffected (both of my i386 and amd64 work with the committed revision), and on sparc64 we need to find a proper fix. It cannot work properly with (intptr_t *) removed as demonstrated by the test program I sent to you. Here it's again for reference:
: $ cat Makefile
: PROG= bubu
: NO_MAN=
: SRCS= main.c ioctl.c
: WARNS?=3
:
: .include <bsd.prog.mk>
: $ cat main.c
: #include <sys/types.h>
:
: int ioctl(int, u_long, ...);
:
: int
: main(void)
: {
:
: ioctl(1, 2, 3);
: return (0);
: }
: $ cat ioctl.c
: #include <sys/types.h>
: #include <stdio.h>
:
: void ioctl(int, u_long, caddr_t);
:
: /*
: * This emulates what kernel's ioctl() does with IOC_VOID
: * type ioctls.
: */
: void
: ioctl(int fd, u_long req, caddr_t argp)
: {
: caddr_t data = (void *)&argp;
:
: printf("fd=%d req=%lu ", fd, req);
: printf("(int)(*(intptr_t *)data)=%d ", (int)(*(intptr_t *)data));
: printf("*(int *)data=%d\n", *(int *)data);
: }
On sparc64, it prints:
fd=1 req=2 (int)(*(intptr_t *)data)=3 *(int *)data=0
On i386 and amd64, it prints:
fd=1 req=2 (int)(*(intptr_t *)data)=3 *(int *)data=3
Cheers,
--
Ruslan Ermilov
[EMAIL PROTECTED]
FreeBSD committer
pgp57OkqmJErp.pgp
Description: PGP signature
