Subject: db_machdep.h patch ok?
To: None <port-amd64@netbsd.org>
From: Jeff Rizzo <riz@tastylime.net>
List: port-amd64
Date: 05/21/2006 11:15:17
--sm4nu43k4a2Rpi4c
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Does this change look ok?  gcc4 doesn't like lhs casts (and I suspect
lint doesn't, either, hence the #if test against lint), and this
is the way other ports have chosen to avoid one that otherwise comes
up in sys/ddb/db_run.c ...

The one part I'm not certain about is whether getting rid of the=20
#if defined(lint) case...

With this change, I can build and run a kernel with DDB using gcc4.

Index: sys/arch/amd64/include/db_machdep.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/src/sys/arch/amd64/include/db_machdep.h,v
retrieving revision 1.4
diff -u -r1.4 db_machdep.h
--- sys/arch/amd64/include/db_machdep.h	1 Apr 2006 15:44:59 -0000	1.4
+++ sys/arch/amd64/include/db_machdep.h	21 May 2006 18:08:48 -0000
@@ -51,11 +51,8 @@
 #define ddb_regs	(*ddb_regp)
 #endif
=20
-#if defined(lint)
-#define	PC_REGS(regs)	((regs)->tf_rip)
-#else
 #define	PC_REGS(regs)	((db_addr_t)(regs)->tf_rip)
-#endif
+#define	PC_ADVANCE(r)	((r)->tf_rip +=3D BKPT_SIZE)
=20
 #define	BKPT_ADDR(addr)	(addr)		/* breakpoint address */
 #define	BKPT_INST	0xcc		/* breakpoint instruction */

--sm4nu43k4a2Rpi4c
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (NetBSD)

iQCVAwUBRHCuNbOuUtxCgar5AQKiogP8CLqujWvtEdMNOmjKj//ZPK/V9tvbDbvY
YNklwXN5ZPvjBTO9VmPGUcdMOwxcYSR6wDEGH4Q7a6YqP3YA6a+0vgFiMXi5lfxE
IKiK5Lvn0ahXS8JxAQ186TyKKkOrgnudMONjR2MiP87qayGfJJfWdnGRLB/SM/+d
ewlApFaw/DY=
=WAre
-----END PGP SIGNATURE-----

--sm4nu43k4a2Rpi4c--