Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Sep 2006 23:48:19 +0400
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        Maksim Yevmenkin <maksim.yevmenkin@gmail.com>, Marius Strobl <marius@FreeBSD.org>
Cc:        cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/dev/kbdmux kbdmux.c
Message-ID:  <20060919194819.GA23360@rambler-co.ru>
In-Reply-To: <bb4a86c70609191236j13fe1563w123cb046261ee129@mail.gmail.com>
References:  <200609191303.k8JD3AHl050783@repoman.freebsd.org> <bb4a86c70609190944o2438a4a4vae7b3bb2332522ee@mail.gmail.com> <20060919190645.GA23068@rambler-co.ru> <bb4a86c70609191236j13fe1563w123cb046261ee129@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--GvXjxJ+pjyke8COw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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.
>=20
> 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.
>=20
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=3D   bubu
: NO_MAN=3D
: SRCS=3D   main.c ioctl.c
: WARNS?=3D3
:=20
: .include <bsd.prog.mk>
: $ cat main.c
: #include <sys/types.h>
:=20
: int ioctl(int, u_long, ...);
:=20
: int
: main(void)
: {
:=20
:         ioctl(1, 2, 3);
:         return (0);
: }
: $ cat ioctl.c
: #include <sys/types.h>
: #include <stdio.h>
:=20
: void ioctl(int, u_long, caddr_t);
:=20
: /*
:  * 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 =3D (void *)&argp;
:=20
:         printf("fd=3D%d req=3D%lu ", fd, req);
:         printf("(int)(*(intptr_t *)data)=3D%d ", (int)(*(intptr_t *)data)=
);
:         printf("*(int *)data=3D%d\n", *(int *)data);
: }

On sparc64, it prints:

fd=3D1 req=3D2 (int)(*(intptr_t *)data)=3D3 *(int *)data=3D0

On i386 and amd64, it prints:

fd=3D1 req=3D2 (int)(*(intptr_t *)data)=3D3 *(int *)data=3D3


Cheers,
--=20
Ruslan Ermilov
ru@FreeBSD.org
FreeBSD committer

--GvXjxJ+pjyke8COw
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (FreeBSD)

iD8DBQFFEEmDqRfpzJluFF4RAisVAKCYk1wSzIxOGxIvAeekm6xaaLn+eQCcDuXE
9dPELCSpIH8lahnhin0VCR0=
=W9Zl
-----END PGP SIGNATURE-----

--GvXjxJ+pjyke8COw--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060919194819.GA23360>