From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L2Zni-0004j4-7X for qemu-devel@nongnu.org; Tue, 18 Nov 2008 18:16:06 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L2Zng-0004ik-Q7 for qemu-devel@nongnu.org; Tue, 18 Nov 2008 18:16:05 -0500 Received: from [199.232.76.173] (port=56238 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L2Zng-0004ih-IW for qemu-devel@nongnu.org; Tue, 18 Nov 2008 18:16:04 -0500 Received: from fmmailgate02.web.de ([217.72.192.227]:37309) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L2Zng-0007gp-Ly for qemu-devel@nongnu.org; Tue, 18 Nov 2008 18:16:05 -0500 Received: from smtp08.web.de (fmsmtp08.dlan.cinetic.de [172.20.5.216]) by fmmailgate02.web.de (Postfix) with ESMTP id 21D62F6D16C3 for ; Wed, 19 Nov 2008 00:16:03 +0100 (CET) Received: from [88.64.11.56] (helo=[192.168.1.198]) by smtp08.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.109 #226) id 1L2Zne-0004an-00 for qemu-devel@nongnu.org; Wed, 19 Nov 2008 00:16:02 +0100 Message-ID: <49234C85.2030701@web.de> Date: Wed, 19 Nov 2008 00:15:17 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <20081117161857.26880.45423.stgit@mchn012c.ww002.siemens.net> <20081117161859.26880.26254.stgit@mchn012c.ww002.siemens.net> <4923314F.2090604@codemonkey.ws> In-Reply-To: <4923314F.2090604@codemonkey.ws> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig289CEB04DAF2AB7C8A1AB492" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: [PATCH v5 17/18] gdbstub: x86: Support for setting segment registers Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig289CEB04DAF2AB7C8A1AB492 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Anthony Liguori wrote: > Jan Kiszka wrote: >> diff --git a/target-i386/cpu.h b/target-i386/cpu.h >> index eed1f62..b7c8a2f 100644 >> --- a/target-i386/cpu.h >> +++ b/target-i386/cpu.h >> @@ -651,6 +651,20 @@ int cpu_get_pic_interrupt(CPUX86State *s); >> /* MSDOS compatibility mode FPU exception support */ >> void cpu_set_ferr(CPUX86State *s); >> =20 >> +static inline unsigned int get_seg_limit(uint32_t e1, uint32_t e2) >> +{ >> + unsigned int limit; >> + limit =3D (e1 & 0xffff) | (e2 & 0x000f0000); >> + if (e2 & DESC_G_MASK) >> + limit =3D (limit << 12) | 0xfff; >> + return limit; >> +} >> + >> +static inline uint32_t get_seg_base(uint32_t e1, uint32_t e2) >> +{ >> + return ((e1 >> 16) | ((e2 & 0xff) << 16) | (e2 & 0xff000000)); >> +} >> + >> =20 >=20 > I like this patch but if you're going to export new x86 helper > functions, please prefix them with cpu_x86. In this case, these helpers= > are awfully low level (they're taking a GDT entry split into two 32-bit= > words). I would rather see an interface that took a CPUState and a > segment register index. In the very least, it won't be very obvious to= > anyone what this API expects to take so a comment would be required. That was a result of the decision process "quick feature enhancement or also some more refactoring?". :) Will think out a new interface instead, leaving those two where they came from. Jan --------------enig289CEB04DAF2AB7C8A1AB492 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkkjTIUACgkQniDOoMHTA+kWlwCbBJ/I2fMoN/OklP9heOlEUfEm IqUAnApsj1fa1+JE1zPD2VadRbO4yQI/ =izIT -----END PGP SIGNATURE----- --------------enig289CEB04DAF2AB7C8A1AB492--