Subject: Re: grfmmap bug?
To: None <leo@wau.mis.ah.nl>
From: maximum entropy <entropy@zippy.bernstein.com>
List: port-atari
Date: 12/16/1998 19:54:44
>Date: Wed, 16 Dec 1998 15:33:02 +0100
>From: Leo Weppelman <leo@wau.mis.ah.nl>
>
>+	if (off >= gi->gd_regsize && off < gi->gd_regsize+gi->gd_fbsize) {
>+		off -= gi->gd_regsize;
> 		return (((u_int)gi->gd_fbaddr + off) >> PGSHIFT);
>+	}

For the ET4000 that's fine, since gi->gd_regsize is 8192 ( == NBPG*1).
But I don't think it will work if gi->gd_regsize is not an exact
multiple of the page size.

Should the code be changed, or should a comment be added in
e.g. grfioctl.h that the gd_regsize value must be rounded up to the
nearest whole page?

The reason I was looking at all this is I'm thinking about changing
the Leonardo driver to a "grf" front end.  The tms34061 chip used by
the Leonardo only needs 6 bits to address all its registers, so it
would be most natural to use a gd_regsize of 64.  I realize that a
whole page will be mapped anyway, so maybe it should be up to the
front-end driver to do this round-up...

Cheers,
entropy

--
entropy -- it's not just a good idea, it's the second law.