From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6464 invoked by alias); 2 Dec 2001 18:28:04 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 6443 invoked from network); 2 Dec 2001 18:28:04 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by hostedprojects.ges.redhat.com with SMTP; 2 Dec 2001 18:28:04 -0000 Received: from rtl.cygnus.com (cse.cygnus.com [205.180.230.236]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id KAA12034; Sun, 2 Dec 2001 10:28:02 -0800 (PST) Received: (from ezannoni@localhost) by rtl.cygnus.com (8.11.2/8.11.0) id fB2IYGg01337; Sun, 2 Dec 2001 13:34:16 -0500 X-Authentication-Warning: krustylu.cygnus.com: ezannoni set sender to ezannoni@cygnus.com using -f From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15370.29736.747589.390705@krustylu.cygnus.com> Date: Sun, 02 Dec 2001 10:28:00 -0000 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] W.I.P. AltiVec ppc registers support. In-Reply-To: <20011129012730.A19781@nevyn.them.org> References: <15365.39495.801289.497931@krustylu.cygnus.com> <20011129012730.A19781@nevyn.them.org> X-Mailer: VM 6.97 under Emacs 20.7.1 X-SW-Source: 2001-12/txt/msg00016.txt.bz2 Daniel Jacobowitz writes: > On Wed, Nov 28, 2001 at 09:15:35PM -0500, Elena Zannoni wrote: > > > > AltiVec registers are 32 128-bit wide registers found on the G4 > > powerpc processor family. This patch adds some initial support for > > such registers to gdb on a linux ppc platform. > > > > The Altivec registers are not displayed in a normal 'info reg' command > > output. They are shown (like fp regs) if one says 'info all' instead. > > Furthermore I added a specific 'info power altivec' command to display > > just the Altivec registers. (I am not sure that the word 'power' is > > the best choice, maybe simply 'ppc' or 'powerpc' is better). This way > > the command as just a specific powerpc info command, w/o it being a > > generic info command avaliable on every platform. > > > > If there is no kernel support for ptrace to handle the AltiVec > > registers, they will display as 0's. > > Wait, I knew I was forgetting something important. > > There is no kernel support for this feature in any public PowerPC > kernel tree, and to my knowledge there has been no suggested patch for > it on any of the public LinuxPPC forums. As such, the interface to it > is still up in the air. I've discussed this with other kernel folk at > various times, and the general consensus is that, instead of adding > them to the user area and using PEEKUSR, someone should simply > implement PTRACE_GETFPXREGS (perhaps just PTRACE_GETXREGS, as the FP > does not really apply, but consistency...). We almost never want to > fetch just one altivec register, excepting maybe VRSAVE, and GETFPXREGS > takes negligibly more time than a single PEEKUSR call. Hold on, I looked at the altivec.org and at the linuxppc.org mailing lists. There is actually a patch posted at the beginning of September to which you replied at some stage. And this patch is similar to the one I have used for implementing GDB altivec support. The version of the patch I have was provided by Motorola, and they are about to submit it publicly. The patch is virtually identical to the one posted on linuxppc.org except for the definition of PT_VR0 which in the latter is (errouneously) made to be aligned on 128-bits. So for the patch I have PT_VR0 is simply PT_FPSCR + 1, not 128. My gdb implementation works also for machines w/o altivec ptrace support, because in that case the ptrace call just errors out and that condition is detected (I am talking about my original patch, w/o the changes that Kevin suggested). This was one objection to the kernel patch that I've seen raised on the linuxppc list. The thread subject is "AltiVec aware ptrace for Linux" http://lists.linuxppc.org/linuxppc-dev/200109/msg00029.html and the original postings are on http://www.altivec.org/emailgroup follow the email archive link at the bottom of the page (this archive is a total pain to look through). Elena > > -- > Daniel Jacobowitz Carnegie Mellon University > MontaVista Software Debian GNU/Linux Developer