From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5648 invoked by alias); 9 Jun 2012 14:30:41 -0000 Received: (qmail 5637 invoked by uid 22791); 9 Jun 2012 14:30:39 -0000 X-SWARE-Spam-Status: No, hits=-5.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-qc0-f169.google.com (HELO mail-qc0-f169.google.com) (209.85.216.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 09 Jun 2012 14:30:25 +0000 Received: by qcsd16 with SMTP id d16so1521567qcs.0 for ; Sat, 09 Jun 2012 07:30:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.135.10 with SMTP id l10mr3567563qct.6.1339252224927; Sat, 09 Jun 2012 07:30:24 -0700 (PDT) Received: by 10.229.192.129 with HTTP; Sat, 9 Jun 2012 07:30:24 -0700 (PDT) In-Reply-To: <201206051316.q55DGSq4017712@glazunov.sibelius.xs4all.nl> References: <20120511181737.GP29339@adacore.com> <201205202043.q4KKhRGw022215@glazunov.sibelius.xs4all.nl> <201205202138.q4KLcWBf011913@glazunov.sibelius.xs4all.nl> <201205282026.q4SKQ737007589@glazunov.sibelius.xs4all.nl> <201206051316.q55DGSq4017712@glazunov.sibelius.xs4all.nl> Date: Sat, 09 Jun 2012 14:30:00 -0000 Message-ID: Subject: Re: x32 ABI Support (was Re: Three weeks to branching (gdb 7.5 release)) From: "H.J. Lu" To: Mark Kettenis Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-06/txt/msg00262.txt.bz2 On Tue, Jun 5, 2012 at 6:16 AM, Mark Kettenis wro= te: >> Date: Tue, 5 Jun 2012 05:58:18 -0700 >> From: "H.J. Lu" >> >> On Thu, May 31, 2012 at 11:18 AM, H.J. Lu wrote: >> > On Mon, May 28, 2012 at 2:18 PM, H.J. Lu wrote: >> >> On Mon, May 28, 2012 at 1:26 PM, Mark Kettenis wrote: >> >>>> Date: Sun, 20 May 2012 15:48:54 -0700 >> >>>> From: "H.J. Lu" >> >>>> >> >>>> Does this one look OK. =A0I extracted x32_init_abi from amd64_x32_i= nit_abi >> >>>> since amd64_x32_linux_init_abi can't call amd64_init_abi after >> >>>> calling amd64_linux_init_abi. >> >>> >> >>> I guess multiple-inheritance is a bad idea, even when implemented in= C ;) >> >>> >> >>> I really do think that amd64_x32_linux_init_abi() should call >> >>> amd64_x32_init_abi(). =A0That way it is immediately obvious that the= OS-specific ABI inherits everything from the generic ABI. >> >> >> >> X32 kernel interface are highly OS specific. =A0Different OSes can im= plement >> >> very different kernel interfaces. =A0The only generic x32 bits are >> >> >> >> =A0struct gdbarch_tdep *tdep =3D gdbarch_tdep (gdbarch); >> >> >> >> =A0tdep->num_dword_regs =3D 17; >> >> >> >> =A0set_tdesc_pseudo_register_type (gdbarch, amd64_x32_pseudo_register= _type); >> >> >> >> =A0set_gdbarch_long_bit (gdbarch, 32); >> >> =A0set_gdbarch_ptr_bit (gdbarch, 32); >> >> >> >> They are the same for all x32 OSes since they are determined by >> >> hardware, not OS. >> >> >> >>> In order too avoid too much code duplication, the common bits should >> >>> be split out from amd64_linux_init_abi() into a seperate function th= at >> >>> gets called from both amd64_linux_init_abi() and >> >>> amd64_x32_linux_init_abi(). =A0As I wrote earlier, it isn't entirely >> >>> obvious that everything in amd64_linix_init_abi() applies to the x32 >> >>> ABI. =A0So we should be conservative in moving stuff into the common >> >>> function. =A0In fact it might be a good idea to start out with somet= hing >> >>> like the attached diff, and gradually move things over. >> >> >> >> Linux x32 kernel interface shares > 90% of Linux amd64 kernel >> >> interface (309 system calls out of 337 are the same). =A0See >> >> 64-bit system call table in Linux kernel 3.4: >> >> >> >> http://git.kernel.org/?p=3Dlinux/kernel/git/stable/linux-stable.git;a= =3Dblob;f=3Darch/x86/syscalls/syscall_64.tbl;h=3Ddd29a9ea27c560a9d2fcb6e1c2= 983f8b8e9be407;hb=3DHEAD >> >> >> >> I believe we should start with sharing everything between Linux/x32 >> >> and Linux/amd64. =A0We can update x32 part as we go. >> >> >> > >> > >> > Here is the updated patch. =A0I added amd64_x32_init for generic x32 >> > setting. =A0It can be used by all x32 init_abi functions. =A0Since >> > tdep->tdesc can't be changed after being used, I renamed >> > amd64_init_abi/amd64_init_abi to amd64_init/amd64_linux_init >> > to take an =A0argument to set tdep->tdesc properly. =A0OK for trunk? >> > >> > Thanks. >> > >> >> Hi Mark, >> >> Do you have a chance to take a look at this? > > Sorry, no. =A0Unliekly to be able to look at it until Thrusday evening. Hi Mark, Have you got time to review my change? Thanks. --=20 H.J.