Date: Thu, 24 Jul 2003 10:28:10 +0200 From: Pawel Jakub Dawidek <nick@garage.freebsd.pl> To: Julian Elischer <julian@elischer.org> Cc: freebsd-current@freebsd.org Subject: Re: fuword(), suword(), etc. Message-ID: <20030724082810.GV43543@garage.freebsd.pl> In-Reply-To: <Pine.BSF.4.21.0307231441410.60197-100000@InterJet.elischer.org> References: <Pine.BSF.4.21.0307231441410.60197-100000@InterJet.elischer.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--b5sSX5qSQrSInIHt Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 23, 2003 at 02:48:41PM -0700, Julian Elischer wrote: +> I'd like to have a "suptr and fuptr" to be able to save and read +> user pointers in a "machine independent" manner.. +> at the moment ia need to know the size of a pointer and select the +> appropriate 32 or 64 version.. It would jus tbe another ENTRY files in= =20 +> support.[sS] alongside teh appropriate sized entry +> for each architecture so it wouldn't 'cost' anything.. +>=20 +> for i386 it would be an alternate name for fuword32() and suword32() +> I'm not sure what it would be on other architectures.... +>=20 +> comments? Yes, good idea. I'm using for now something like this: static __inline void * fuptr(void *uaddr) { void *ptr; if (copyin(uaddr, &ptr, sizeof(void *)) !=3D 0) return ((void *)-1); return (ptr); } For numbers is always better to use copyin(9)/copyout(9). Functions like fubyte(9), etc. make no sens for me. -1 is returned on error or if there is really -1, so one isn't able to find out if there is an error or not. --=20 Pawel Jakub Dawidek pawel@dawidek.net UNIX Systems Programmer/Administrator http://garage.freebsd.pl Am I Evil? Yes, I Am! http://cerber.sourceforge.net --b5sSX5qSQrSInIHt Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iQCVAwUBPx+Ymj/PhmMH/Mf1AQGV7gP+IgMsG/ea0wBeA7Td40Bf8xhns6lMR2Yq VXp+9i3YqF+xRI3xd784T9i5grQ72W657ZBy3H6TXA4gWn07oc3yLv7CNC3JFkC7 ZC7tTOOE19P5nm4gvpaHYVWtkWXooTGAqu487/PtPZ/aQjNJ6M6XC1y/+++5RZ2i +Q3pJwdJjE0= =VHUL -----END PGP SIGNATURE----- --b5sSX5qSQrSInIHt--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030724082810.GV43543>